@@ -514,6 +514,102 @@ def get_authorization_role_comparedefault_right_role_id(self, left_role_id, righ
514514 callback = params .get ('callback' ))
515515 return response
516516
517+ def get_authorization_role_subjectgrants (self , role_id , ** kwargs ):
518+ """
519+ Get the subjects' granted divisions in the specified role.
520+ Includes the divisions for which the subject has a grant.
521+
522+ This method makes a synchronous HTTP request by default. To make an
523+ asynchronous HTTP request, please define a `callback` function
524+ to be invoked when receiving the response.
525+ >>> def callback_function(response):
526+ >>> pprint(response)
527+ >>>
528+ >>> thread = api.get_authorization_role_subjectgrants(role_id, callback=callback_function)
529+
530+ :param callback function: The callback function
531+ for asynchronous request. (optional)
532+ :param str role_id: Role ID (required)
533+ :param int page_size: The total page size requested
534+ :param int page_number: The page number requested
535+ :param str sort_by: variable name requested to sort by
536+ :param list[str] expand: variable name requested by expand list
537+ :param str next_page: next page token
538+ :param str previous_page: Previous page token
539+ :return: SubjectDivisionGrantsEntityListing
540+ If the method is called asynchronously,
541+ returns the request thread.
542+ """
543+
544+ all_params = ['role_id' , 'page_size' , 'page_number' , 'sort_by' , 'expand' , 'next_page' , 'previous_page' ]
545+ all_params .append ('callback' )
546+
547+ params = locals ()
548+ for key , val in iteritems (params ['kwargs' ]):
549+ if key not in all_params :
550+ raise TypeError (
551+ "Got an unexpected keyword argument '%s'"
552+ " to method get_authorization_role_subjectgrants" % key
553+ )
554+ params [key ] = val
555+ del params ['kwargs' ]
556+
557+ # verify the required parameter 'role_id' is set
558+ if ('role_id' not in params ) or (params ['role_id' ] is None ):
559+ raise ValueError ("Missing the required parameter `role_id` when calling `get_authorization_role_subjectgrants`" )
560+
561+
562+ resource_path = '/api/v2/authorization/roles/{roleId}/subjectgrants' .replace ('{format}' , 'json' )
563+ path_params = {}
564+ if 'role_id' in params :
565+ path_params ['roleId' ] = params ['role_id' ]
566+
567+ query_params = {}
568+ if 'page_size' in params :
569+ query_params ['pageSize' ] = params ['page_size' ]
570+ if 'page_number' in params :
571+ query_params ['pageNumber' ] = params ['page_number' ]
572+ if 'sort_by' in params :
573+ query_params ['sortBy' ] = params ['sort_by' ]
574+ if 'expand' in params :
575+ query_params ['expand' ] = params ['expand' ]
576+ if 'next_page' in params :
577+ query_params ['nextPage' ] = params ['next_page' ]
578+ if 'previous_page' in params :
579+ query_params ['previousPage' ] = params ['previous_page' ]
580+
581+ header_params = {}
582+
583+ form_params = []
584+ local_var_files = {}
585+
586+ body_params = None
587+
588+ # HTTP header `Accept`
589+ header_params ['Accept' ] = self .api_client .\
590+ select_header_accept (['application/json' ])
591+ if not header_params ['Accept' ]:
592+ del header_params ['Accept' ]
593+
594+ # HTTP header `Content-Type`
595+ header_params ['Content-Type' ] = self .api_client .\
596+ select_header_content_type (['application/json' ])
597+
598+ # Authentication setting
599+ auth_settings = ['PureCloud Auth' ]
600+
601+ response = self .api_client .call_api (resource_path , 'GET' ,
602+ path_params ,
603+ query_params ,
604+ header_params ,
605+ body = body_params ,
606+ post_params = form_params ,
607+ files = local_var_files ,
608+ response_type = 'SubjectDivisionGrantsEntityListing' ,
609+ auth_settings = auth_settings ,
610+ callback = params .get ('callback' ))
611+ return response
612+
517613 def get_authorization_roles (self , ** kwargs ):
518614 """
519615 Retrieve a list of all roles defined for the organization
0 commit comments