@@ -2347,6 +2347,177 @@ def post_authorization_roles_default(self, **kwargs):
23472347 callback = params .get ('callback' ))
23482348 return response
23492349
2350+ def post_authorization_subject_bulkadd (self , subject_id , body , ** kwargs ):
2351+ """
2352+ Bulk-grant roles and divisions to a subject.
2353+
2354+
2355+ This method makes a synchronous HTTP request by default. To make an
2356+ asynchronous HTTP request, please define a `callback` function
2357+ to be invoked when receiving the response.
2358+ >>> def callback_function(response):
2359+ >>> pprint(response)
2360+ >>>
2361+ >>> thread = api.post_authorization_subject_bulkadd(subject_id, body, callback=callback_function)
2362+
2363+ :param callback function: The callback function
2364+ for asynchronous request. (optional)
2365+ :param str subject_id: Subject ID (user or group) (required)
2366+ :param RoleDivisionGrants body: Pairs of role and division IDs (required)
2367+ :param str subject_type: what the type of the subject is (PC_GROUP, PC_USER or PC_OAUTH_CLIENT)
2368+ :return: None
2369+ If the method is called asynchronously,
2370+ returns the request thread.
2371+ """
2372+
2373+ all_params = ['subject_id' , 'body' , 'subject_type' ]
2374+ all_params .append ('callback' )
2375+
2376+ params = locals ()
2377+ for key , val in iteritems (params ['kwargs' ]):
2378+ if key not in all_params :
2379+ raise TypeError (
2380+ "Got an unexpected keyword argument '%s'"
2381+ " to method post_authorization_subject_bulkadd" % key
2382+ )
2383+ params [key ] = val
2384+ del params ['kwargs' ]
2385+
2386+ # verify the required parameter 'subject_id' is set
2387+ if ('subject_id' not in params ) or (params ['subject_id' ] is None ):
2388+ raise ValueError ("Missing the required parameter `subject_id` when calling `post_authorization_subject_bulkadd`" )
2389+ # verify the required parameter 'body' is set
2390+ if ('body' not in params ) or (params ['body' ] is None ):
2391+ raise ValueError ("Missing the required parameter `body` when calling `post_authorization_subject_bulkadd`" )
2392+
2393+
2394+ resource_path = '/api/v2/authorization/subjects/{subjectId}/bulkadd' .replace ('{format}' , 'json' )
2395+ path_params = {}
2396+ if 'subject_id' in params :
2397+ path_params ['subjectId' ] = params ['subject_id' ]
2398+
2399+ query_params = {}
2400+ if 'subject_type' in params :
2401+ query_params ['subjectType' ] = params ['subject_type' ]
2402+
2403+ header_params = {}
2404+
2405+ form_params = []
2406+ local_var_files = {}
2407+
2408+ body_params = None
2409+ if 'body' in params :
2410+ body_params = params ['body' ]
2411+
2412+ # HTTP header `Accept`
2413+ header_params ['Accept' ] = self .api_client .\
2414+ select_header_accept (['application/json' ])
2415+ if not header_params ['Accept' ]:
2416+ del header_params ['Accept' ]
2417+
2418+ # HTTP header `Content-Type`
2419+ header_params ['Content-Type' ] = self .api_client .\
2420+ select_header_content_type (['application/json' ])
2421+
2422+ # Authentication setting
2423+ auth_settings = ['PureCloud OAuth' ]
2424+
2425+ response = self .api_client .call_api (resource_path , 'POST' ,
2426+ path_params ,
2427+ query_params ,
2428+ header_params ,
2429+ body = body_params ,
2430+ post_params = form_params ,
2431+ files = local_var_files ,
2432+ response_type = None ,
2433+ auth_settings = auth_settings ,
2434+ callback = params .get ('callback' ))
2435+ return response
2436+
2437+ def post_authorization_subject_bulkremove (self , subject_id , body , ** kwargs ):
2438+ """
2439+ Bulk-remove grants from a subject.
2440+
2441+
2442+ This method makes a synchronous HTTP request by default. To make an
2443+ asynchronous HTTP request, please define a `callback` function
2444+ to be invoked when receiving the response.
2445+ >>> def callback_function(response):
2446+ >>> pprint(response)
2447+ >>>
2448+ >>> thread = api.post_authorization_subject_bulkremove(subject_id, body, callback=callback_function)
2449+
2450+ :param callback function: The callback function
2451+ for asynchronous request. (optional)
2452+ :param str subject_id: Subject ID (user or group) (required)
2453+ :param RoleDivisionGrants body: Pairs of role and division IDs (required)
2454+ :return: None
2455+ If the method is called asynchronously,
2456+ returns the request thread.
2457+ """
2458+
2459+ all_params = ['subject_id' , 'body' ]
2460+ all_params .append ('callback' )
2461+
2462+ params = locals ()
2463+ for key , val in iteritems (params ['kwargs' ]):
2464+ if key not in all_params :
2465+ raise TypeError (
2466+ "Got an unexpected keyword argument '%s'"
2467+ " to method post_authorization_subject_bulkremove" % key
2468+ )
2469+ params [key ] = val
2470+ del params ['kwargs' ]
2471+
2472+ # verify the required parameter 'subject_id' is set
2473+ if ('subject_id' not in params ) or (params ['subject_id' ] is None ):
2474+ raise ValueError ("Missing the required parameter `subject_id` when calling `post_authorization_subject_bulkremove`" )
2475+ # verify the required parameter 'body' is set
2476+ if ('body' not in params ) or (params ['body' ] is None ):
2477+ raise ValueError ("Missing the required parameter `body` when calling `post_authorization_subject_bulkremove`" )
2478+
2479+
2480+ resource_path = '/api/v2/authorization/subjects/{subjectId}/bulkremove' .replace ('{format}' , 'json' )
2481+ path_params = {}
2482+ if 'subject_id' in params :
2483+ path_params ['subjectId' ] = params ['subject_id' ]
2484+
2485+ query_params = {}
2486+
2487+ header_params = {}
2488+
2489+ form_params = []
2490+ local_var_files = {}
2491+
2492+ body_params = None
2493+ if 'body' in params :
2494+ body_params = params ['body' ]
2495+
2496+ # HTTP header `Accept`
2497+ header_params ['Accept' ] = self .api_client .\
2498+ select_header_accept (['application/json' ])
2499+ if not header_params ['Accept' ]:
2500+ del header_params ['Accept' ]
2501+
2502+ # HTTP header `Content-Type`
2503+ header_params ['Content-Type' ] = self .api_client .\
2504+ select_header_content_type (['application/json' ])
2505+
2506+ # Authentication setting
2507+ auth_settings = ['PureCloud OAuth' ]
2508+
2509+ response = self .api_client .call_api (resource_path , 'POST' ,
2510+ path_params ,
2511+ query_params ,
2512+ header_params ,
2513+ body = body_params ,
2514+ post_params = form_params ,
2515+ files = local_var_files ,
2516+ response_type = None ,
2517+ auth_settings = auth_settings ,
2518+ callback = params .get ('callback' ))
2519+ return response
2520+
23502521 def post_authorization_subject_division_role (self , subject_id , division_id , role_id , ** kwargs ):
23512522 """
23522523 Make a grant of a role in a division
0 commit comments