@@ -552,6 +552,24 @@ def create_messenger(self, request, messenger_id=None):
552552 .post () \
553553 .go ()
554554
555+ def create_o_auth_scope (self , application_id , request , scope_id = None ):
556+ """
557+ Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
558+ You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
559+
560+ Attributes:
561+ application_id: The Id of the application to create the OAuth scope on.
562+ scope_id: (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
563+ request: The request object that contains all the information used to create the OAuth OAuth scope.
564+ """
565+ return self .start ().uri ('/api/application' ) \
566+ .url_segment (application_id ) \
567+ .url_segment ("scope" ) \
568+ .url_segment (scope_id ) \
569+ .body_handler (JSONBodyHandler (request )) \
570+ .post () \
571+ .go ()
572+
555573 def create_tenant (self , request , tenant_id = None ):
556574 """
557575 Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
@@ -773,7 +791,7 @@ def delete_application_role(self, application_id, role_id):
773791 permanently removes the given role from all users that had it.
774792
775793 Attributes:
776- application_id: The Id of the application to deactivate .
794+ application_id: The Id of the application that the role belongs to .
777795 role_id: The Id of the role to delete.
778796 """
779797 return self .start ().uri ('/api/application' ) \
@@ -996,6 +1014,22 @@ def delete_messenger(self, messenger_id):
9961014 .delete () \
9971015 .go ()
9981016
1017+ def delete_o_auth_scope (self , application_id , scope_id ):
1018+ """
1019+ Hard deletes a custom OAuth scope.
1020+ OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
1021+
1022+ Attributes:
1023+ application_id: The Id of the application that the OAuth scope belongs to.
1024+ scope_id: The Id of the OAuth scope to delete.
1025+ """
1026+ return self .start ().uri ('/api/application' ) \
1027+ .url_segment (application_id ) \
1028+ .url_segment ("scope" ) \
1029+ .url_segment (scope_id ) \
1030+ .delete () \
1031+ .go ()
1032+
9991033 def delete_registration (self , user_id , application_id ):
10001034 """
10011035 Deletes the user registration for the given user and application.
@@ -1897,6 +1931,23 @@ def patch_messenger(self, messenger_id, request):
18971931 .patch () \
18981932 .go ()
18991933
1934+ def patch_o_auth_scope (self , application_id , scope_id , request ):
1935+ """
1936+ Updates, via PATCH, the custom OAuth scope with the given Id for the application.
1937+
1938+ Attributes:
1939+ application_id: The Id of the application that the OAuth scope belongs to.
1940+ scope_id: The Id of the OAuth scope to update.
1941+ request: The request that contains just the new OAuth scope information.
1942+ """
1943+ return self .start ().uri ('/api/application' ) \
1944+ .url_segment (application_id ) \
1945+ .url_segment ("scope" ) \
1946+ .url_segment (scope_id ) \
1947+ .body_handler (JSONBodyHandler (request )) \
1948+ .patch () \
1949+ .go ()
1950+
19001951 def patch_registration (self , user_id , request ):
19011952 """
19021953 Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
@@ -2815,6 +2866,21 @@ def retrieve_monthly_active_report(self, start, end, application_id=None):
28152866 .get () \
28162867 .go ()
28172868
2869+ def retrieve_o_auth_scope (self , application_id , scope_id ):
2870+ """
2871+ Retrieves a custom OAuth scope.
2872+
2873+ Attributes:
2874+ application_id: The Id of the application that the OAuth scope belongs to.
2875+ scope_id: The Id of the OAuth scope to retrieve.
2876+ """
2877+ return self .start ().uri ('/api/application' ) \
2878+ .url_segment (application_id ) \
2879+ .url_segment ("scope" ) \
2880+ .url_segment (scope_id ) \
2881+ .get () \
2882+ .go ()
2883+
28182884 def retrieve_oauth_configuration (self , application_id ):
28192885 """
28202886 Retrieves the Oauth2 configuration for the application for the given Application Id.
@@ -4317,6 +4383,23 @@ def update_messenger(self, messenger_id, request):
43174383 .put () \
43184384 .go ()
43194385
4386+ def update_o_auth_scope (self , application_id , scope_id , request ):
4387+ """
4388+ Updates the OAuth scope with the given Id for the application.
4389+
4390+ Attributes:
4391+ application_id: The Id of the application that the OAuth scope belongs to.
4392+ scope_id: The Id of the OAuth scope to update.
4393+ request: The request that contains all the new OAuth scope information.
4394+ """
4395+ return self .start ().uri ('/api/application' ) \
4396+ .url_segment (application_id ) \
4397+ .url_segment ("scope" ) \
4398+ .url_segment (scope_id ) \
4399+ .body_handler (JSONBodyHandler (request )) \
4400+ .put () \
4401+ .go ()
4402+
43204403 def update_registration (self , user_id , request ):
43214404 """
43224405 Updates the registration for the user with the given Id and the application defined in the request.
0 commit comments