docusign_esign.apis.groups_api
Docusign eSignature REST API
The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501
OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git
1# coding: utf-8 2 3""" 4 Docusign eSignature REST API 5 6 The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501 7 8 OpenAPI spec version: v2.1 9 Contact: devcenter@docusign.com 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13 14from __future__ import absolute_import 15 16import sys 17import os 18import re 19 20# python 2 and python 3 compatibility library 21from six import iteritems 22 23from ..client.configuration import Configuration 24from ..client.api_client import ApiClient 25 26 27class GroupsApi(object): 28 """ 29 NOTE: This class is auto generated by the swagger code generator program. 30 Do not edit the class manually. 31 Ref: https://github.com/swagger-api/swagger-codegen 32 """ 33 34 def __init__(self, api_client=None): 35 config = Configuration() 36 if api_client: 37 self.api_client = api_client 38 else: 39 if not config.api_client: 40 config.api_client = ApiClient() 41 self.api_client = config.api_client 42 43 def create_groups(self, account_id, **kwargs): 44 """ 45 Creates one or more groups for the account. 46 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 47 This method makes a synchronous HTTP request by default. To make an 48 asynchronous HTTP request, please define a `callback` function 49 to be invoked when receiving the response. 50 >>> def callback_function(response): 51 >>> pprint(response) 52 >>> 53 >>> thread = api.create_groups(account_id, callback=callback_function) 54 55 :param callback function: The callback function 56 for asynchronous request. (optional) 57 :param str account_id: The external account number (int) or account ID Guid. (required) 58 :param GroupInformation group_information: 59 :return: GroupInformation 60 If the method is called asynchronously, 61 returns the request thread. 62 """ 63 kwargs['_return_http_data_only'] = True 64 if kwargs.get('callback'): 65 return self.create_groups_with_http_info(account_id, **kwargs) 66 else: 67 (data) = self.create_groups_with_http_info(account_id, **kwargs) 68 return data 69 70 def create_groups_with_http_info(self, account_id, **kwargs): 71 """ 72 Creates one or more groups for the account. 73 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 74 This method makes a synchronous HTTP request by default. To make an 75 asynchronous HTTP request, please define a `callback` function 76 to be invoked when receiving the response. 77 >>> def callback_function(response): 78 >>> pprint(response) 79 >>> 80 >>> thread = api.create_groups_with_http_info(account_id, callback=callback_function) 81 82 :param callback function: The callback function 83 for asynchronous request. (optional) 84 :param str account_id: The external account number (int) or account ID Guid. (required) 85 :param GroupInformation group_information: 86 :return: GroupInformation 87 If the method is called asynchronously, 88 returns the request thread. 89 """ 90 91 all_params = ['account_id', 'group_information'] 92 all_params.append('callback') 93 all_params.append('_return_http_data_only') 94 all_params.append('_preload_content') 95 all_params.append('_request_timeout') 96 97 params = locals() 98 for key, val in iteritems(params['kwargs']): 99 if key not in all_params: 100 raise TypeError( 101 "Got an unexpected keyword argument '%s'" 102 " to method create_groups" % key 103 ) 104 params[key] = val 105 del params['kwargs'] 106 # verify the required parameter 'account_id' is set 107 if ('account_id' not in params) or (params['account_id'] is None): 108 raise ValueError("Missing the required parameter `account_id` when calling `create_groups`") 109 110 111 collection_formats = {} 112 113 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 114 path_params = {} 115 if 'account_id' in params: 116 path_params['accountId'] = params['account_id'] 117 118 query_params = {} 119 120 header_params = {} 121 122 form_params = [] 123 local_var_files = {} 124 125 body_params = None 126 if 'group_information' in params: 127 body_params = params['group_information'] 128 # HTTP header `Accept` 129 header_params['Accept'] = self.api_client.\ 130 select_header_accept(['application/json']) 131 132 # Authentication setting 133 auth_settings = [] 134 135 return self.api_client.call_api(resource_path, 'POST', 136 path_params, 137 query_params, 138 header_params, 139 body=body_params, 140 post_params=form_params, 141 files=local_var_files, 142 response_type='GroupInformation', 143 auth_settings=auth_settings, 144 callback=params.get('callback'), 145 _return_http_data_only=params.get('_return_http_data_only'), 146 _preload_content=params.get('_preload_content', True), 147 _request_timeout=params.get('_request_timeout'), 148 collection_formats=collection_formats) 149 150 def delete_brands(self, account_id, group_id, **kwargs): 151 """ 152 Deletes brand information from the requested group. 153 Deletes brand information from the requested group. 154 This method makes a synchronous HTTP request by default. To make an 155 asynchronous HTTP request, please define a `callback` function 156 to be invoked when receiving the response. 157 >>> def callback_function(response): 158 >>> pprint(response) 159 >>> 160 >>> thread = api.delete_brands(account_id, group_id, callback=callback_function) 161 162 :param callback function: The callback function 163 for asynchronous request. (optional) 164 :param str account_id: The external account number (int) or account ID Guid. (required) 165 :param str group_id: The ID of the group being accessed. (required) 166 :param BrandsRequest brands_request: 167 :return: GroupBrands 168 If the method is called asynchronously, 169 returns the request thread. 170 """ 171 kwargs['_return_http_data_only'] = True 172 if kwargs.get('callback'): 173 return self.delete_brands_with_http_info(account_id, group_id, **kwargs) 174 else: 175 (data) = self.delete_brands_with_http_info(account_id, group_id, **kwargs) 176 return data 177 178 def delete_brands_with_http_info(self, account_id, group_id, **kwargs): 179 """ 180 Deletes brand information from the requested group. 181 Deletes brand information from the requested group. 182 This method makes a synchronous HTTP request by default. To make an 183 asynchronous HTTP request, please define a `callback` function 184 to be invoked when receiving the response. 185 >>> def callback_function(response): 186 >>> pprint(response) 187 >>> 188 >>> thread = api.delete_brands_with_http_info(account_id, group_id, callback=callback_function) 189 190 :param callback function: The callback function 191 for asynchronous request. (optional) 192 :param str account_id: The external account number (int) or account ID Guid. (required) 193 :param str group_id: The ID of the group being accessed. (required) 194 :param BrandsRequest brands_request: 195 :return: GroupBrands 196 If the method is called asynchronously, 197 returns the request thread. 198 """ 199 200 all_params = ['account_id', 'group_id', 'brands_request'] 201 all_params.append('callback') 202 all_params.append('_return_http_data_only') 203 all_params.append('_preload_content') 204 all_params.append('_request_timeout') 205 206 params = locals() 207 for key, val in iteritems(params['kwargs']): 208 if key not in all_params: 209 raise TypeError( 210 "Got an unexpected keyword argument '%s'" 211 " to method delete_brands" % key 212 ) 213 params[key] = val 214 del params['kwargs'] 215 # verify the required parameter 'account_id' is set 216 if ('account_id' not in params) or (params['account_id'] is None): 217 raise ValueError("Missing the required parameter `account_id` when calling `delete_brands`") 218 # verify the required parameter 'group_id' is set 219 if ('group_id' not in params) or (params['group_id'] is None): 220 raise ValueError("Missing the required parameter `group_id` when calling `delete_brands`") 221 222 223 collection_formats = {} 224 225 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 226 path_params = {} 227 if 'account_id' in params: 228 path_params['accountId'] = params['account_id'] 229 if 'group_id' in params: 230 path_params['groupId'] = params['group_id'] 231 232 query_params = {} 233 234 header_params = {} 235 236 form_params = [] 237 local_var_files = {} 238 239 body_params = None 240 if 'brands_request' in params: 241 body_params = params['brands_request'] 242 # HTTP header `Accept` 243 header_params['Accept'] = self.api_client.\ 244 select_header_accept(['application/json']) 245 246 # Authentication setting 247 auth_settings = [] 248 249 return self.api_client.call_api(resource_path, 'DELETE', 250 path_params, 251 query_params, 252 header_params, 253 body=body_params, 254 post_params=form_params, 255 files=local_var_files, 256 response_type='GroupBrands', 257 auth_settings=auth_settings, 258 callback=params.get('callback'), 259 _return_http_data_only=params.get('_return_http_data_only'), 260 _preload_content=params.get('_preload_content', True), 261 _request_timeout=params.get('_request_timeout'), 262 collection_formats=collection_formats) 263 264 def delete_group_users(self, account_id, group_id, **kwargs): 265 """ 266 Deletes one or more users from a gro 267 Deletes one or more users from a group. 268 This method makes a synchronous HTTP request by default. To make an 269 asynchronous HTTP request, please define a `callback` function 270 to be invoked when receiving the response. 271 >>> def callback_function(response): 272 >>> pprint(response) 273 >>> 274 >>> thread = api.delete_group_users(account_id, group_id, callback=callback_function) 275 276 :param callback function: The callback function 277 for asynchronous request. (optional) 278 :param str account_id: The external account number (int) or account ID Guid. (required) 279 :param str group_id: The ID of the group being accessed. (required) 280 :param UserInfoList user_info_list: 281 :return: UsersResponse 282 If the method is called asynchronously, 283 returns the request thread. 284 """ 285 kwargs['_return_http_data_only'] = True 286 if kwargs.get('callback'): 287 return self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 288 else: 289 (data) = self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 290 return data 291 292 def delete_group_users_with_http_info(self, account_id, group_id, **kwargs): 293 """ 294 Deletes one or more users from a gro 295 Deletes one or more users from a group. 296 This method makes a synchronous HTTP request by default. To make an 297 asynchronous HTTP request, please define a `callback` function 298 to be invoked when receiving the response. 299 >>> def callback_function(response): 300 >>> pprint(response) 301 >>> 302 >>> thread = api.delete_group_users_with_http_info(account_id, group_id, callback=callback_function) 303 304 :param callback function: The callback function 305 for asynchronous request. (optional) 306 :param str account_id: The external account number (int) or account ID Guid. (required) 307 :param str group_id: The ID of the group being accessed. (required) 308 :param UserInfoList user_info_list: 309 :return: UsersResponse 310 If the method is called asynchronously, 311 returns the request thread. 312 """ 313 314 all_params = ['account_id', 'group_id', 'user_info_list'] 315 all_params.append('callback') 316 all_params.append('_return_http_data_only') 317 all_params.append('_preload_content') 318 all_params.append('_request_timeout') 319 320 params = locals() 321 for key, val in iteritems(params['kwargs']): 322 if key not in all_params: 323 raise TypeError( 324 "Got an unexpected keyword argument '%s'" 325 " to method delete_group_users" % key 326 ) 327 params[key] = val 328 del params['kwargs'] 329 # verify the required parameter 'account_id' is set 330 if ('account_id' not in params) or (params['account_id'] is None): 331 raise ValueError("Missing the required parameter `account_id` when calling `delete_group_users`") 332 # verify the required parameter 'group_id' is set 333 if ('group_id' not in params) or (params['group_id'] is None): 334 raise ValueError("Missing the required parameter `group_id` when calling `delete_group_users`") 335 336 337 collection_formats = {} 338 339 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 340 path_params = {} 341 if 'account_id' in params: 342 path_params['accountId'] = params['account_id'] 343 if 'group_id' in params: 344 path_params['groupId'] = params['group_id'] 345 346 query_params = {} 347 348 header_params = {} 349 350 form_params = [] 351 local_var_files = {} 352 353 body_params = None 354 if 'user_info_list' in params: 355 body_params = params['user_info_list'] 356 # HTTP header `Accept` 357 header_params['Accept'] = self.api_client.\ 358 select_header_accept(['application/json']) 359 360 # Authentication setting 361 auth_settings = [] 362 363 return self.api_client.call_api(resource_path, 'DELETE', 364 path_params, 365 query_params, 366 header_params, 367 body=body_params, 368 post_params=form_params, 369 files=local_var_files, 370 response_type='UsersResponse', 371 auth_settings=auth_settings, 372 callback=params.get('callback'), 373 _return_http_data_only=params.get('_return_http_data_only'), 374 _preload_content=params.get('_preload_content', True), 375 _request_timeout=params.get('_request_timeout'), 376 collection_formats=collection_formats) 377 378 def delete_groups(self, account_id, **kwargs): 379 """ 380 Deletes an existing user group. 381 Deletes an existing user group. 382 This method makes a synchronous HTTP request by default. To make an 383 asynchronous HTTP request, please define a `callback` function 384 to be invoked when receiving the response. 385 >>> def callback_function(response): 386 >>> pprint(response) 387 >>> 388 >>> thread = api.delete_groups(account_id, callback=callback_function) 389 390 :param callback function: The callback function 391 for asynchronous request. (optional) 392 :param str account_id: The external account number (int) or account ID Guid. (required) 393 :param GroupInformation group_information: 394 :return: GroupInformation 395 If the method is called asynchronously, 396 returns the request thread. 397 """ 398 kwargs['_return_http_data_only'] = True 399 if kwargs.get('callback'): 400 return self.delete_groups_with_http_info(account_id, **kwargs) 401 else: 402 (data) = self.delete_groups_with_http_info(account_id, **kwargs) 403 return data 404 405 def delete_groups_with_http_info(self, account_id, **kwargs): 406 """ 407 Deletes an existing user group. 408 Deletes an existing user group. 409 This method makes a synchronous HTTP request by default. To make an 410 asynchronous HTTP request, please define a `callback` function 411 to be invoked when receiving the response. 412 >>> def callback_function(response): 413 >>> pprint(response) 414 >>> 415 >>> thread = api.delete_groups_with_http_info(account_id, callback=callback_function) 416 417 :param callback function: The callback function 418 for asynchronous request. (optional) 419 :param str account_id: The external account number (int) or account ID Guid. (required) 420 :param GroupInformation group_information: 421 :return: GroupInformation 422 If the method is called asynchronously, 423 returns the request thread. 424 """ 425 426 all_params = ['account_id', 'group_information'] 427 all_params.append('callback') 428 all_params.append('_return_http_data_only') 429 all_params.append('_preload_content') 430 all_params.append('_request_timeout') 431 432 params = locals() 433 for key, val in iteritems(params['kwargs']): 434 if key not in all_params: 435 raise TypeError( 436 "Got an unexpected keyword argument '%s'" 437 " to method delete_groups" % key 438 ) 439 params[key] = val 440 del params['kwargs'] 441 # verify the required parameter 'account_id' is set 442 if ('account_id' not in params) or (params['account_id'] is None): 443 raise ValueError("Missing the required parameter `account_id` when calling `delete_groups`") 444 445 446 collection_formats = {} 447 448 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 449 path_params = {} 450 if 'account_id' in params: 451 path_params['accountId'] = params['account_id'] 452 453 query_params = {} 454 455 header_params = {} 456 457 form_params = [] 458 local_var_files = {} 459 460 body_params = None 461 if 'group_information' in params: 462 body_params = params['group_information'] 463 # HTTP header `Accept` 464 header_params['Accept'] = self.api_client.\ 465 select_header_accept(['application/json']) 466 467 # Authentication setting 468 auth_settings = [] 469 470 return self.api_client.call_api(resource_path, 'DELETE', 471 path_params, 472 query_params, 473 header_params, 474 body=body_params, 475 post_params=form_params, 476 files=local_var_files, 477 response_type='GroupInformation', 478 auth_settings=auth_settings, 479 callback=params.get('callback'), 480 _return_http_data_only=params.get('_return_http_data_only'), 481 _preload_content=params.get('_preload_content', True), 482 _request_timeout=params.get('_request_timeout'), 483 collection_formats=collection_formats) 484 485 def get_brands(self, account_id, group_id, **kwargs): 486 """ 487 Gets group brand ID Information. 488 Retrieves information about the brands associated with the requested group. 489 This method makes a synchronous HTTP request by default. To make an 490 asynchronous HTTP request, please define a `callback` function 491 to be invoked when receiving the response. 492 >>> def callback_function(response): 493 >>> pprint(response) 494 >>> 495 >>> thread = api.get_brands(account_id, group_id, callback=callback_function) 496 497 :param callback function: The callback function 498 for asynchronous request. (optional) 499 :param str account_id: The external account number (int) or account ID Guid. (required) 500 :param str group_id: The ID of the group being accessed. (required) 501 :return: GroupBrands 502 If the method is called asynchronously, 503 returns the request thread. 504 """ 505 kwargs['_return_http_data_only'] = True 506 if kwargs.get('callback'): 507 return self.get_brands_with_http_info(account_id, group_id, **kwargs) 508 else: 509 (data) = self.get_brands_with_http_info(account_id, group_id, **kwargs) 510 return data 511 512 def get_brands_with_http_info(self, account_id, group_id, **kwargs): 513 """ 514 Gets group brand ID Information. 515 Retrieves information about the brands associated with the requested group. 516 This method makes a synchronous HTTP request by default. To make an 517 asynchronous HTTP request, please define a `callback` function 518 to be invoked when receiving the response. 519 >>> def callback_function(response): 520 >>> pprint(response) 521 >>> 522 >>> thread = api.get_brands_with_http_info(account_id, group_id, callback=callback_function) 523 524 :param callback function: The callback function 525 for asynchronous request. (optional) 526 :param str account_id: The external account number (int) or account ID Guid. (required) 527 :param str group_id: The ID of the group being accessed. (required) 528 :return: GroupBrands 529 If the method is called asynchronously, 530 returns the request thread. 531 """ 532 533 all_params = ['account_id', 'group_id'] 534 all_params.append('callback') 535 all_params.append('_return_http_data_only') 536 all_params.append('_preload_content') 537 all_params.append('_request_timeout') 538 539 params = locals() 540 for key, val in iteritems(params['kwargs']): 541 if key not in all_params: 542 raise TypeError( 543 "Got an unexpected keyword argument '%s'" 544 " to method get_brands" % key 545 ) 546 params[key] = val 547 del params['kwargs'] 548 # verify the required parameter 'account_id' is set 549 if ('account_id' not in params) or (params['account_id'] is None): 550 raise ValueError("Missing the required parameter `account_id` when calling `get_brands`") 551 # verify the required parameter 'group_id' is set 552 if ('group_id' not in params) or (params['group_id'] is None): 553 raise ValueError("Missing the required parameter `group_id` when calling `get_brands`") 554 555 556 collection_formats = {} 557 558 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 559 path_params = {} 560 if 'account_id' in params: 561 path_params['accountId'] = params['account_id'] 562 if 'group_id' in params: 563 path_params['groupId'] = params['group_id'] 564 565 query_params = {} 566 567 header_params = {} 568 569 form_params = [] 570 local_var_files = {} 571 572 body_params = None 573 # HTTP header `Accept` 574 header_params['Accept'] = self.api_client.\ 575 select_header_accept(['application/json']) 576 577 # Authentication setting 578 auth_settings = [] 579 580 return self.api_client.call_api(resource_path, 'GET', 581 path_params, 582 query_params, 583 header_params, 584 body=body_params, 585 post_params=form_params, 586 files=local_var_files, 587 response_type='GroupBrands', 588 auth_settings=auth_settings, 589 callback=params.get('callback'), 590 _return_http_data_only=params.get('_return_http_data_only'), 591 _preload_content=params.get('_preload_content', True), 592 _request_timeout=params.get('_request_timeout'), 593 collection_formats=collection_formats) 594 595 def list_group_users(self, account_id, group_id, **kwargs): 596 """ 597 Gets a list of users in a group. 598 Retrieves a list of users in a group. 599 This method makes a synchronous HTTP request by default. To make an 600 asynchronous HTTP request, please define a `callback` function 601 to be invoked when receiving the response. 602 >>> def callback_function(response): 603 >>> pprint(response) 604 >>> 605 >>> thread = api.list_group_users(account_id, group_id, callback=callback_function) 606 607 :param callback function: The callback function 608 for asynchronous request. (optional) 609 :param str account_id: The external account number (int) or account ID Guid. (required) 610 :param str group_id: The ID of the group being accessed. (required) 611 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 612 :param str start_position: Starting value for the list. 613 :return: UsersResponse 614 If the method is called asynchronously, 615 returns the request thread. 616 """ 617 kwargs['_return_http_data_only'] = True 618 if kwargs.get('callback'): 619 return self.list_group_users_with_http_info(account_id, group_id, **kwargs) 620 else: 621 (data) = self.list_group_users_with_http_info(account_id, group_id, **kwargs) 622 return data 623 624 def list_group_users_with_http_info(self, account_id, group_id, **kwargs): 625 """ 626 Gets a list of users in a group. 627 Retrieves a list of users in a group. 628 This method makes a synchronous HTTP request by default. To make an 629 asynchronous HTTP request, please define a `callback` function 630 to be invoked when receiving the response. 631 >>> def callback_function(response): 632 >>> pprint(response) 633 >>> 634 >>> thread = api.list_group_users_with_http_info(account_id, group_id, callback=callback_function) 635 636 :param callback function: The callback function 637 for asynchronous request. (optional) 638 :param str account_id: The external account number (int) or account ID Guid. (required) 639 :param str group_id: The ID of the group being accessed. (required) 640 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 641 :param str start_position: Starting value for the list. 642 :return: UsersResponse 643 If the method is called asynchronously, 644 returns the request thread. 645 """ 646 647 all_params = ['account_id', 'group_id', 'count', 'start_position'] 648 all_params.append('callback') 649 all_params.append('_return_http_data_only') 650 all_params.append('_preload_content') 651 all_params.append('_request_timeout') 652 653 params = locals() 654 for key, val in iteritems(params['kwargs']): 655 if key not in all_params: 656 raise TypeError( 657 "Got an unexpected keyword argument '%s'" 658 " to method list_group_users" % key 659 ) 660 params[key] = val 661 del params['kwargs'] 662 # verify the required parameter 'account_id' is set 663 if ('account_id' not in params) or (params['account_id'] is None): 664 raise ValueError("Missing the required parameter `account_id` when calling `list_group_users`") 665 # verify the required parameter 'group_id' is set 666 if ('group_id' not in params) or (params['group_id'] is None): 667 raise ValueError("Missing the required parameter `group_id` when calling `list_group_users`") 668 669 670 collection_formats = {} 671 672 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 673 path_params = {} 674 if 'account_id' in params: 675 path_params['accountId'] = params['account_id'] 676 if 'group_id' in params: 677 path_params['groupId'] = params['group_id'] 678 679 query_params = {} 680 if 'count' in params: 681 query_params['count'] = params['count'] 682 if 'start_position' in params: 683 query_params['start_position'] = params['start_position'] 684 685 header_params = {} 686 687 form_params = [] 688 local_var_files = {} 689 690 body_params = None 691 # HTTP header `Accept` 692 header_params['Accept'] = self.api_client.\ 693 select_header_accept(['application/json']) 694 695 # Authentication setting 696 auth_settings = [] 697 698 return self.api_client.call_api(resource_path, 'GET', 699 path_params, 700 query_params, 701 header_params, 702 body=body_params, 703 post_params=form_params, 704 files=local_var_files, 705 response_type='UsersResponse', 706 auth_settings=auth_settings, 707 callback=params.get('callback'), 708 _return_http_data_only=params.get('_return_http_data_only'), 709 _preload_content=params.get('_preload_content', True), 710 _request_timeout=params.get('_request_timeout'), 711 collection_formats=collection_formats) 712 713 def list_groups(self, account_id, **kwargs): 714 """ 715 Gets information about groups associated with the account. 716 Retrieves information about groups associated with the account. 717 This method makes a synchronous HTTP request by default. To make an 718 asynchronous HTTP request, please define a `callback` function 719 to be invoked when receiving the response. 720 >>> def callback_function(response): 721 >>> pprint(response) 722 >>> 723 >>> thread = api.list_groups(account_id, callback=callback_function) 724 725 :param callback function: The callback function 726 for asynchronous request. (optional) 727 :param str account_id: The external account number (int) or account ID Guid. (required) 728 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 729 :param str group_type: 730 :param str include_usercount: 731 :param str search_text: 732 :param str start_position: Starting value for the list. 733 :return: GroupInformation 734 If the method is called asynchronously, 735 returns the request thread. 736 """ 737 kwargs['_return_http_data_only'] = True 738 if kwargs.get('callback'): 739 return self.list_groups_with_http_info(account_id, **kwargs) 740 else: 741 (data) = self.list_groups_with_http_info(account_id, **kwargs) 742 return data 743 744 def list_groups_with_http_info(self, account_id, **kwargs): 745 """ 746 Gets information about groups associated with the account. 747 Retrieves information about groups associated with the account. 748 This method makes a synchronous HTTP request by default. To make an 749 asynchronous HTTP request, please define a `callback` function 750 to be invoked when receiving the response. 751 >>> def callback_function(response): 752 >>> pprint(response) 753 >>> 754 >>> thread = api.list_groups_with_http_info(account_id, callback=callback_function) 755 756 :param callback function: The callback function 757 for asynchronous request. (optional) 758 :param str account_id: The external account number (int) or account ID Guid. (required) 759 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 760 :param str group_type: 761 :param str include_usercount: 762 :param str search_text: 763 :param str start_position: Starting value for the list. 764 :return: GroupInformation 765 If the method is called asynchronously, 766 returns the request thread. 767 """ 768 769 all_params = ['account_id', 'count', 'group_type', 'include_usercount', 'search_text', 'start_position'] 770 all_params.append('callback') 771 all_params.append('_return_http_data_only') 772 all_params.append('_preload_content') 773 all_params.append('_request_timeout') 774 775 params = locals() 776 for key, val in iteritems(params['kwargs']): 777 if key not in all_params: 778 raise TypeError( 779 "Got an unexpected keyword argument '%s'" 780 " to method list_groups" % key 781 ) 782 params[key] = val 783 del params['kwargs'] 784 # verify the required parameter 'account_id' is set 785 if ('account_id' not in params) or (params['account_id'] is None): 786 raise ValueError("Missing the required parameter `account_id` when calling `list_groups`") 787 788 789 collection_formats = {} 790 791 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 792 path_params = {} 793 if 'account_id' in params: 794 path_params['accountId'] = params['account_id'] 795 796 query_params = {} 797 if 'count' in params: 798 query_params['count'] = params['count'] 799 if 'group_type' in params: 800 query_params['group_type'] = params['group_type'] 801 if 'include_usercount' in params: 802 query_params['include_usercount'] = params['include_usercount'] 803 if 'search_text' in params: 804 query_params['search_text'] = params['search_text'] 805 if 'start_position' in params: 806 query_params['start_position'] = params['start_position'] 807 808 header_params = {} 809 810 form_params = [] 811 local_var_files = {} 812 813 body_params = None 814 # HTTP header `Accept` 815 header_params['Accept'] = self.api_client.\ 816 select_header_accept(['application/json']) 817 818 # Authentication setting 819 auth_settings = [] 820 821 return self.api_client.call_api(resource_path, 'GET', 822 path_params, 823 query_params, 824 header_params, 825 body=body_params, 826 post_params=form_params, 827 files=local_var_files, 828 response_type='GroupInformation', 829 auth_settings=auth_settings, 830 callback=params.get('callback'), 831 _return_http_data_only=params.get('_return_http_data_only'), 832 _preload_content=params.get('_preload_content', True), 833 _request_timeout=params.get('_request_timeout'), 834 collection_formats=collection_formats) 835 836 def update_brands(self, account_id, group_id, **kwargs): 837 """ 838 Adds group brand ID information to a group. 839 Adds group brand ID information to a group. 840 This method makes a synchronous HTTP request by default. To make an 841 asynchronous HTTP request, please define a `callback` function 842 to be invoked when receiving the response. 843 >>> def callback_function(response): 844 >>> pprint(response) 845 >>> 846 >>> thread = api.update_brands(account_id, group_id, callback=callback_function) 847 848 :param callback function: The callback function 849 for asynchronous request. (optional) 850 :param str account_id: The external account number (int) or account ID Guid. (required) 851 :param str group_id: The ID of the group being accessed. (required) 852 :param BrandsRequest brands_request: 853 :return: GroupBrands 854 If the method is called asynchronously, 855 returns the request thread. 856 """ 857 kwargs['_return_http_data_only'] = True 858 if kwargs.get('callback'): 859 return self.update_brands_with_http_info(account_id, group_id, **kwargs) 860 else: 861 (data) = self.update_brands_with_http_info(account_id, group_id, **kwargs) 862 return data 863 864 def update_brands_with_http_info(self, account_id, group_id, **kwargs): 865 """ 866 Adds group brand ID information to a group. 867 Adds group brand ID information to a group. 868 This method makes a synchronous HTTP request by default. To make an 869 asynchronous HTTP request, please define a `callback` function 870 to be invoked when receiving the response. 871 >>> def callback_function(response): 872 >>> pprint(response) 873 >>> 874 >>> thread = api.update_brands_with_http_info(account_id, group_id, callback=callback_function) 875 876 :param callback function: The callback function 877 for asynchronous request. (optional) 878 :param str account_id: The external account number (int) or account ID Guid. (required) 879 :param str group_id: The ID of the group being accessed. (required) 880 :param BrandsRequest brands_request: 881 :return: GroupBrands 882 If the method is called asynchronously, 883 returns the request thread. 884 """ 885 886 all_params = ['account_id', 'group_id', 'brands_request'] 887 all_params.append('callback') 888 all_params.append('_return_http_data_only') 889 all_params.append('_preload_content') 890 all_params.append('_request_timeout') 891 892 params = locals() 893 for key, val in iteritems(params['kwargs']): 894 if key not in all_params: 895 raise TypeError( 896 "Got an unexpected keyword argument '%s'" 897 " to method update_brands" % key 898 ) 899 params[key] = val 900 del params['kwargs'] 901 # verify the required parameter 'account_id' is set 902 if ('account_id' not in params) or (params['account_id'] is None): 903 raise ValueError("Missing the required parameter `account_id` when calling `update_brands`") 904 # verify the required parameter 'group_id' is set 905 if ('group_id' not in params) or (params['group_id'] is None): 906 raise ValueError("Missing the required parameter `group_id` when calling `update_brands`") 907 908 909 collection_formats = {} 910 911 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 912 path_params = {} 913 if 'account_id' in params: 914 path_params['accountId'] = params['account_id'] 915 if 'group_id' in params: 916 path_params['groupId'] = params['group_id'] 917 918 query_params = {} 919 920 header_params = {} 921 922 form_params = [] 923 local_var_files = {} 924 925 body_params = None 926 if 'brands_request' in params: 927 body_params = params['brands_request'] 928 # HTTP header `Accept` 929 header_params['Accept'] = self.api_client.\ 930 select_header_accept(['application/json']) 931 932 # Authentication setting 933 auth_settings = [] 934 935 return self.api_client.call_api(resource_path, 'PUT', 936 path_params, 937 query_params, 938 header_params, 939 body=body_params, 940 post_params=form_params, 941 files=local_var_files, 942 response_type='GroupBrands', 943 auth_settings=auth_settings, 944 callback=params.get('callback'), 945 _return_http_data_only=params.get('_return_http_data_only'), 946 _preload_content=params.get('_preload_content', True), 947 _request_timeout=params.get('_request_timeout'), 948 collection_formats=collection_formats) 949 950 def update_group_users(self, account_id, group_id, **kwargs): 951 """ 952 Adds one or more users to an existing group. 953 Adds one or more users to an existing group. 954 This method makes a synchronous HTTP request by default. To make an 955 asynchronous HTTP request, please define a `callback` function 956 to be invoked when receiving the response. 957 >>> def callback_function(response): 958 >>> pprint(response) 959 >>> 960 >>> thread = api.update_group_users(account_id, group_id, callback=callback_function) 961 962 :param callback function: The callback function 963 for asynchronous request. (optional) 964 :param str account_id: The external account number (int) or account ID Guid. (required) 965 :param str group_id: The ID of the group being accessed. (required) 966 :param UserInfoList user_info_list: 967 :return: UsersResponse 968 If the method is called asynchronously, 969 returns the request thread. 970 """ 971 kwargs['_return_http_data_only'] = True 972 if kwargs.get('callback'): 973 return self.update_group_users_with_http_info(account_id, group_id, **kwargs) 974 else: 975 (data) = self.update_group_users_with_http_info(account_id, group_id, **kwargs) 976 return data 977 978 def update_group_users_with_http_info(self, account_id, group_id, **kwargs): 979 """ 980 Adds one or more users to an existing group. 981 Adds one or more users to an existing group. 982 This method makes a synchronous HTTP request by default. To make an 983 asynchronous HTTP request, please define a `callback` function 984 to be invoked when receiving the response. 985 >>> def callback_function(response): 986 >>> pprint(response) 987 >>> 988 >>> thread = api.update_group_users_with_http_info(account_id, group_id, callback=callback_function) 989 990 :param callback function: The callback function 991 for asynchronous request. (optional) 992 :param str account_id: The external account number (int) or account ID Guid. (required) 993 :param str group_id: The ID of the group being accessed. (required) 994 :param UserInfoList user_info_list: 995 :return: UsersResponse 996 If the method is called asynchronously, 997 returns the request thread. 998 """ 999 1000 all_params = ['account_id', 'group_id', 'user_info_list'] 1001 all_params.append('callback') 1002 all_params.append('_return_http_data_only') 1003 all_params.append('_preload_content') 1004 all_params.append('_request_timeout') 1005 1006 params = locals() 1007 for key, val in iteritems(params['kwargs']): 1008 if key not in all_params: 1009 raise TypeError( 1010 "Got an unexpected keyword argument '%s'" 1011 " to method update_group_users" % key 1012 ) 1013 params[key] = val 1014 del params['kwargs'] 1015 # verify the required parameter 'account_id' is set 1016 if ('account_id' not in params) or (params['account_id'] is None): 1017 raise ValueError("Missing the required parameter `account_id` when calling `update_group_users`") 1018 # verify the required parameter 'group_id' is set 1019 if ('group_id' not in params) or (params['group_id'] is None): 1020 raise ValueError("Missing the required parameter `group_id` when calling `update_group_users`") 1021 1022 1023 collection_formats = {} 1024 1025 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 1026 path_params = {} 1027 if 'account_id' in params: 1028 path_params['accountId'] = params['account_id'] 1029 if 'group_id' in params: 1030 path_params['groupId'] = params['group_id'] 1031 1032 query_params = {} 1033 1034 header_params = {} 1035 1036 form_params = [] 1037 local_var_files = {} 1038 1039 body_params = None 1040 if 'user_info_list' in params: 1041 body_params = params['user_info_list'] 1042 # HTTP header `Accept` 1043 header_params['Accept'] = self.api_client.\ 1044 select_header_accept(['application/json']) 1045 1046 # Authentication setting 1047 auth_settings = [] 1048 1049 return self.api_client.call_api(resource_path, 'PUT', 1050 path_params, 1051 query_params, 1052 header_params, 1053 body=body_params, 1054 post_params=form_params, 1055 files=local_var_files, 1056 response_type='UsersResponse', 1057 auth_settings=auth_settings, 1058 callback=params.get('callback'), 1059 _return_http_data_only=params.get('_return_http_data_only'), 1060 _preload_content=params.get('_preload_content', True), 1061 _request_timeout=params.get('_request_timeout'), 1062 collection_formats=collection_formats) 1063 1064 def update_groups(self, account_id, **kwargs): 1065 """ 1066 Updates the group information for a group. 1067 Updates the group name and modifies, or sets, the permission profile for the group. 1068 This method makes a synchronous HTTP request by default. To make an 1069 asynchronous HTTP request, please define a `callback` function 1070 to be invoked when receiving the response. 1071 >>> def callback_function(response): 1072 >>> pprint(response) 1073 >>> 1074 >>> thread = api.update_groups(account_id, callback=callback_function) 1075 1076 :param callback function: The callback function 1077 for asynchronous request. (optional) 1078 :param str account_id: The external account number (int) or account ID Guid. (required) 1079 :param GroupInformation group_information: 1080 :return: GroupInformation 1081 If the method is called asynchronously, 1082 returns the request thread. 1083 """ 1084 kwargs['_return_http_data_only'] = True 1085 if kwargs.get('callback'): 1086 return self.update_groups_with_http_info(account_id, **kwargs) 1087 else: 1088 (data) = self.update_groups_with_http_info(account_id, **kwargs) 1089 return data 1090 1091 def update_groups_with_http_info(self, account_id, **kwargs): 1092 """ 1093 Updates the group information for a group. 1094 Updates the group name and modifies, or sets, the permission profile for the group. 1095 This method makes a synchronous HTTP request by default. To make an 1096 asynchronous HTTP request, please define a `callback` function 1097 to be invoked when receiving the response. 1098 >>> def callback_function(response): 1099 >>> pprint(response) 1100 >>> 1101 >>> thread = api.update_groups_with_http_info(account_id, callback=callback_function) 1102 1103 :param callback function: The callback function 1104 for asynchronous request. (optional) 1105 :param str account_id: The external account number (int) or account ID Guid. (required) 1106 :param GroupInformation group_information: 1107 :return: GroupInformation 1108 If the method is called asynchronously, 1109 returns the request thread. 1110 """ 1111 1112 all_params = ['account_id', 'group_information'] 1113 all_params.append('callback') 1114 all_params.append('_return_http_data_only') 1115 all_params.append('_preload_content') 1116 all_params.append('_request_timeout') 1117 1118 params = locals() 1119 for key, val in iteritems(params['kwargs']): 1120 if key not in all_params: 1121 raise TypeError( 1122 "Got an unexpected keyword argument '%s'" 1123 " to method update_groups" % key 1124 ) 1125 params[key] = val 1126 del params['kwargs'] 1127 # verify the required parameter 'account_id' is set 1128 if ('account_id' not in params) or (params['account_id'] is None): 1129 raise ValueError("Missing the required parameter `account_id` when calling `update_groups`") 1130 1131 1132 collection_formats = {} 1133 1134 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 1135 path_params = {} 1136 if 'account_id' in params: 1137 path_params['accountId'] = params['account_id'] 1138 1139 query_params = {} 1140 1141 header_params = {} 1142 1143 form_params = [] 1144 local_var_files = {} 1145 1146 body_params = None 1147 if 'group_information' in params: 1148 body_params = params['group_information'] 1149 # HTTP header `Accept` 1150 header_params['Accept'] = self.api_client.\ 1151 select_header_accept(['application/json']) 1152 1153 # Authentication setting 1154 auth_settings = [] 1155 1156 return self.api_client.call_api(resource_path, 'PUT', 1157 path_params, 1158 query_params, 1159 header_params, 1160 body=body_params, 1161 post_params=form_params, 1162 files=local_var_files, 1163 response_type='GroupInformation', 1164 auth_settings=auth_settings, 1165 callback=params.get('callback'), 1166 _return_http_data_only=params.get('_return_http_data_only'), 1167 _preload_content=params.get('_preload_content', True), 1168 _request_timeout=params.get('_request_timeout'), 1169 collection_formats=collection_formats)
28class GroupsApi(object): 29 """ 30 NOTE: This class is auto generated by the swagger code generator program. 31 Do not edit the class manually. 32 Ref: https://github.com/swagger-api/swagger-codegen 33 """ 34 35 def __init__(self, api_client=None): 36 config = Configuration() 37 if api_client: 38 self.api_client = api_client 39 else: 40 if not config.api_client: 41 config.api_client = ApiClient() 42 self.api_client = config.api_client 43 44 def create_groups(self, account_id, **kwargs): 45 """ 46 Creates one or more groups for the account. 47 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.create_groups(account_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: The external account number (int) or account ID Guid. (required) 59 :param GroupInformation group_information: 60 :return: GroupInformation 61 If the method is called asynchronously, 62 returns the request thread. 63 """ 64 kwargs['_return_http_data_only'] = True 65 if kwargs.get('callback'): 66 return self.create_groups_with_http_info(account_id, **kwargs) 67 else: 68 (data) = self.create_groups_with_http_info(account_id, **kwargs) 69 return data 70 71 def create_groups_with_http_info(self, account_id, **kwargs): 72 """ 73 Creates one or more groups for the account. 74 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 75 This method makes a synchronous HTTP request by default. To make an 76 asynchronous HTTP request, please define a `callback` function 77 to be invoked when receiving the response. 78 >>> def callback_function(response): 79 >>> pprint(response) 80 >>> 81 >>> thread = api.create_groups_with_http_info(account_id, callback=callback_function) 82 83 :param callback function: The callback function 84 for asynchronous request. (optional) 85 :param str account_id: The external account number (int) or account ID Guid. (required) 86 :param GroupInformation group_information: 87 :return: GroupInformation 88 If the method is called asynchronously, 89 returns the request thread. 90 """ 91 92 all_params = ['account_id', 'group_information'] 93 all_params.append('callback') 94 all_params.append('_return_http_data_only') 95 all_params.append('_preload_content') 96 all_params.append('_request_timeout') 97 98 params = locals() 99 for key, val in iteritems(params['kwargs']): 100 if key not in all_params: 101 raise TypeError( 102 "Got an unexpected keyword argument '%s'" 103 " to method create_groups" % key 104 ) 105 params[key] = val 106 del params['kwargs'] 107 # verify the required parameter 'account_id' is set 108 if ('account_id' not in params) or (params['account_id'] is None): 109 raise ValueError("Missing the required parameter `account_id` when calling `create_groups`") 110 111 112 collection_formats = {} 113 114 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 115 path_params = {} 116 if 'account_id' in params: 117 path_params['accountId'] = params['account_id'] 118 119 query_params = {} 120 121 header_params = {} 122 123 form_params = [] 124 local_var_files = {} 125 126 body_params = None 127 if 'group_information' in params: 128 body_params = params['group_information'] 129 # HTTP header `Accept` 130 header_params['Accept'] = self.api_client.\ 131 select_header_accept(['application/json']) 132 133 # Authentication setting 134 auth_settings = [] 135 136 return self.api_client.call_api(resource_path, 'POST', 137 path_params, 138 query_params, 139 header_params, 140 body=body_params, 141 post_params=form_params, 142 files=local_var_files, 143 response_type='GroupInformation', 144 auth_settings=auth_settings, 145 callback=params.get('callback'), 146 _return_http_data_only=params.get('_return_http_data_only'), 147 _preload_content=params.get('_preload_content', True), 148 _request_timeout=params.get('_request_timeout'), 149 collection_formats=collection_formats) 150 151 def delete_brands(self, account_id, group_id, **kwargs): 152 """ 153 Deletes brand information from the requested group. 154 Deletes brand information from the requested group. 155 This method makes a synchronous HTTP request by default. To make an 156 asynchronous HTTP request, please define a `callback` function 157 to be invoked when receiving the response. 158 >>> def callback_function(response): 159 >>> pprint(response) 160 >>> 161 >>> thread = api.delete_brands(account_id, group_id, callback=callback_function) 162 163 :param callback function: The callback function 164 for asynchronous request. (optional) 165 :param str account_id: The external account number (int) or account ID Guid. (required) 166 :param str group_id: The ID of the group being accessed. (required) 167 :param BrandsRequest brands_request: 168 :return: GroupBrands 169 If the method is called asynchronously, 170 returns the request thread. 171 """ 172 kwargs['_return_http_data_only'] = True 173 if kwargs.get('callback'): 174 return self.delete_brands_with_http_info(account_id, group_id, **kwargs) 175 else: 176 (data) = self.delete_brands_with_http_info(account_id, group_id, **kwargs) 177 return data 178 179 def delete_brands_with_http_info(self, account_id, group_id, **kwargs): 180 """ 181 Deletes brand information from the requested group. 182 Deletes brand information from the requested group. 183 This method makes a synchronous HTTP request by default. To make an 184 asynchronous HTTP request, please define a `callback` function 185 to be invoked when receiving the response. 186 >>> def callback_function(response): 187 >>> pprint(response) 188 >>> 189 >>> thread = api.delete_brands_with_http_info(account_id, group_id, callback=callback_function) 190 191 :param callback function: The callback function 192 for asynchronous request. (optional) 193 :param str account_id: The external account number (int) or account ID Guid. (required) 194 :param str group_id: The ID of the group being accessed. (required) 195 :param BrandsRequest brands_request: 196 :return: GroupBrands 197 If the method is called asynchronously, 198 returns the request thread. 199 """ 200 201 all_params = ['account_id', 'group_id', 'brands_request'] 202 all_params.append('callback') 203 all_params.append('_return_http_data_only') 204 all_params.append('_preload_content') 205 all_params.append('_request_timeout') 206 207 params = locals() 208 for key, val in iteritems(params['kwargs']): 209 if key not in all_params: 210 raise TypeError( 211 "Got an unexpected keyword argument '%s'" 212 " to method delete_brands" % key 213 ) 214 params[key] = val 215 del params['kwargs'] 216 # verify the required parameter 'account_id' is set 217 if ('account_id' not in params) or (params['account_id'] is None): 218 raise ValueError("Missing the required parameter `account_id` when calling `delete_brands`") 219 # verify the required parameter 'group_id' is set 220 if ('group_id' not in params) or (params['group_id'] is None): 221 raise ValueError("Missing the required parameter `group_id` when calling `delete_brands`") 222 223 224 collection_formats = {} 225 226 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 227 path_params = {} 228 if 'account_id' in params: 229 path_params['accountId'] = params['account_id'] 230 if 'group_id' in params: 231 path_params['groupId'] = params['group_id'] 232 233 query_params = {} 234 235 header_params = {} 236 237 form_params = [] 238 local_var_files = {} 239 240 body_params = None 241 if 'brands_request' in params: 242 body_params = params['brands_request'] 243 # HTTP header `Accept` 244 header_params['Accept'] = self.api_client.\ 245 select_header_accept(['application/json']) 246 247 # Authentication setting 248 auth_settings = [] 249 250 return self.api_client.call_api(resource_path, 'DELETE', 251 path_params, 252 query_params, 253 header_params, 254 body=body_params, 255 post_params=form_params, 256 files=local_var_files, 257 response_type='GroupBrands', 258 auth_settings=auth_settings, 259 callback=params.get('callback'), 260 _return_http_data_only=params.get('_return_http_data_only'), 261 _preload_content=params.get('_preload_content', True), 262 _request_timeout=params.get('_request_timeout'), 263 collection_formats=collection_formats) 264 265 def delete_group_users(self, account_id, group_id, **kwargs): 266 """ 267 Deletes one or more users from a gro 268 Deletes one or more users from a group. 269 This method makes a synchronous HTTP request by default. To make an 270 asynchronous HTTP request, please define a `callback` function 271 to be invoked when receiving the response. 272 >>> def callback_function(response): 273 >>> pprint(response) 274 >>> 275 >>> thread = api.delete_group_users(account_id, group_id, callback=callback_function) 276 277 :param callback function: The callback function 278 for asynchronous request. (optional) 279 :param str account_id: The external account number (int) or account ID Guid. (required) 280 :param str group_id: The ID of the group being accessed. (required) 281 :param UserInfoList user_info_list: 282 :return: UsersResponse 283 If the method is called asynchronously, 284 returns the request thread. 285 """ 286 kwargs['_return_http_data_only'] = True 287 if kwargs.get('callback'): 288 return self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 289 else: 290 (data) = self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 291 return data 292 293 def delete_group_users_with_http_info(self, account_id, group_id, **kwargs): 294 """ 295 Deletes one or more users from a gro 296 Deletes one or more users from a group. 297 This method makes a synchronous HTTP request by default. To make an 298 asynchronous HTTP request, please define a `callback` function 299 to be invoked when receiving the response. 300 >>> def callback_function(response): 301 >>> pprint(response) 302 >>> 303 >>> thread = api.delete_group_users_with_http_info(account_id, group_id, callback=callback_function) 304 305 :param callback function: The callback function 306 for asynchronous request. (optional) 307 :param str account_id: The external account number (int) or account ID Guid. (required) 308 :param str group_id: The ID of the group being accessed. (required) 309 :param UserInfoList user_info_list: 310 :return: UsersResponse 311 If the method is called asynchronously, 312 returns the request thread. 313 """ 314 315 all_params = ['account_id', 'group_id', 'user_info_list'] 316 all_params.append('callback') 317 all_params.append('_return_http_data_only') 318 all_params.append('_preload_content') 319 all_params.append('_request_timeout') 320 321 params = locals() 322 for key, val in iteritems(params['kwargs']): 323 if key not in all_params: 324 raise TypeError( 325 "Got an unexpected keyword argument '%s'" 326 " to method delete_group_users" % key 327 ) 328 params[key] = val 329 del params['kwargs'] 330 # verify the required parameter 'account_id' is set 331 if ('account_id' not in params) or (params['account_id'] is None): 332 raise ValueError("Missing the required parameter `account_id` when calling `delete_group_users`") 333 # verify the required parameter 'group_id' is set 334 if ('group_id' not in params) or (params['group_id'] is None): 335 raise ValueError("Missing the required parameter `group_id` when calling `delete_group_users`") 336 337 338 collection_formats = {} 339 340 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 341 path_params = {} 342 if 'account_id' in params: 343 path_params['accountId'] = params['account_id'] 344 if 'group_id' in params: 345 path_params['groupId'] = params['group_id'] 346 347 query_params = {} 348 349 header_params = {} 350 351 form_params = [] 352 local_var_files = {} 353 354 body_params = None 355 if 'user_info_list' in params: 356 body_params = params['user_info_list'] 357 # HTTP header `Accept` 358 header_params['Accept'] = self.api_client.\ 359 select_header_accept(['application/json']) 360 361 # Authentication setting 362 auth_settings = [] 363 364 return self.api_client.call_api(resource_path, 'DELETE', 365 path_params, 366 query_params, 367 header_params, 368 body=body_params, 369 post_params=form_params, 370 files=local_var_files, 371 response_type='UsersResponse', 372 auth_settings=auth_settings, 373 callback=params.get('callback'), 374 _return_http_data_only=params.get('_return_http_data_only'), 375 _preload_content=params.get('_preload_content', True), 376 _request_timeout=params.get('_request_timeout'), 377 collection_formats=collection_formats) 378 379 def delete_groups(self, account_id, **kwargs): 380 """ 381 Deletes an existing user group. 382 Deletes an existing user group. 383 This method makes a synchronous HTTP request by default. To make an 384 asynchronous HTTP request, please define a `callback` function 385 to be invoked when receiving the response. 386 >>> def callback_function(response): 387 >>> pprint(response) 388 >>> 389 >>> thread = api.delete_groups(account_id, callback=callback_function) 390 391 :param callback function: The callback function 392 for asynchronous request. (optional) 393 :param str account_id: The external account number (int) or account ID Guid. (required) 394 :param GroupInformation group_information: 395 :return: GroupInformation 396 If the method is called asynchronously, 397 returns the request thread. 398 """ 399 kwargs['_return_http_data_only'] = True 400 if kwargs.get('callback'): 401 return self.delete_groups_with_http_info(account_id, **kwargs) 402 else: 403 (data) = self.delete_groups_with_http_info(account_id, **kwargs) 404 return data 405 406 def delete_groups_with_http_info(self, account_id, **kwargs): 407 """ 408 Deletes an existing user group. 409 Deletes an existing user group. 410 This method makes a synchronous HTTP request by default. To make an 411 asynchronous HTTP request, please define a `callback` function 412 to be invoked when receiving the response. 413 >>> def callback_function(response): 414 >>> pprint(response) 415 >>> 416 >>> thread = api.delete_groups_with_http_info(account_id, callback=callback_function) 417 418 :param callback function: The callback function 419 for asynchronous request. (optional) 420 :param str account_id: The external account number (int) or account ID Guid. (required) 421 :param GroupInformation group_information: 422 :return: GroupInformation 423 If the method is called asynchronously, 424 returns the request thread. 425 """ 426 427 all_params = ['account_id', 'group_information'] 428 all_params.append('callback') 429 all_params.append('_return_http_data_only') 430 all_params.append('_preload_content') 431 all_params.append('_request_timeout') 432 433 params = locals() 434 for key, val in iteritems(params['kwargs']): 435 if key not in all_params: 436 raise TypeError( 437 "Got an unexpected keyword argument '%s'" 438 " to method delete_groups" % key 439 ) 440 params[key] = val 441 del params['kwargs'] 442 # verify the required parameter 'account_id' is set 443 if ('account_id' not in params) or (params['account_id'] is None): 444 raise ValueError("Missing the required parameter `account_id` when calling `delete_groups`") 445 446 447 collection_formats = {} 448 449 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 450 path_params = {} 451 if 'account_id' in params: 452 path_params['accountId'] = params['account_id'] 453 454 query_params = {} 455 456 header_params = {} 457 458 form_params = [] 459 local_var_files = {} 460 461 body_params = None 462 if 'group_information' in params: 463 body_params = params['group_information'] 464 # HTTP header `Accept` 465 header_params['Accept'] = self.api_client.\ 466 select_header_accept(['application/json']) 467 468 # Authentication setting 469 auth_settings = [] 470 471 return self.api_client.call_api(resource_path, 'DELETE', 472 path_params, 473 query_params, 474 header_params, 475 body=body_params, 476 post_params=form_params, 477 files=local_var_files, 478 response_type='GroupInformation', 479 auth_settings=auth_settings, 480 callback=params.get('callback'), 481 _return_http_data_only=params.get('_return_http_data_only'), 482 _preload_content=params.get('_preload_content', True), 483 _request_timeout=params.get('_request_timeout'), 484 collection_formats=collection_formats) 485 486 def get_brands(self, account_id, group_id, **kwargs): 487 """ 488 Gets group brand ID Information. 489 Retrieves information about the brands associated with the requested group. 490 This method makes a synchronous HTTP request by default. To make an 491 asynchronous HTTP request, please define a `callback` function 492 to be invoked when receiving the response. 493 >>> def callback_function(response): 494 >>> pprint(response) 495 >>> 496 >>> thread = api.get_brands(account_id, group_id, callback=callback_function) 497 498 :param callback function: The callback function 499 for asynchronous request. (optional) 500 :param str account_id: The external account number (int) or account ID Guid. (required) 501 :param str group_id: The ID of the group being accessed. (required) 502 :return: GroupBrands 503 If the method is called asynchronously, 504 returns the request thread. 505 """ 506 kwargs['_return_http_data_only'] = True 507 if kwargs.get('callback'): 508 return self.get_brands_with_http_info(account_id, group_id, **kwargs) 509 else: 510 (data) = self.get_brands_with_http_info(account_id, group_id, **kwargs) 511 return data 512 513 def get_brands_with_http_info(self, account_id, group_id, **kwargs): 514 """ 515 Gets group brand ID Information. 516 Retrieves information about the brands associated with the requested group. 517 This method makes a synchronous HTTP request by default. To make an 518 asynchronous HTTP request, please define a `callback` function 519 to be invoked when receiving the response. 520 >>> def callback_function(response): 521 >>> pprint(response) 522 >>> 523 >>> thread = api.get_brands_with_http_info(account_id, group_id, callback=callback_function) 524 525 :param callback function: The callback function 526 for asynchronous request. (optional) 527 :param str account_id: The external account number (int) or account ID Guid. (required) 528 :param str group_id: The ID of the group being accessed. (required) 529 :return: GroupBrands 530 If the method is called asynchronously, 531 returns the request thread. 532 """ 533 534 all_params = ['account_id', 'group_id'] 535 all_params.append('callback') 536 all_params.append('_return_http_data_only') 537 all_params.append('_preload_content') 538 all_params.append('_request_timeout') 539 540 params = locals() 541 for key, val in iteritems(params['kwargs']): 542 if key not in all_params: 543 raise TypeError( 544 "Got an unexpected keyword argument '%s'" 545 " to method get_brands" % key 546 ) 547 params[key] = val 548 del params['kwargs'] 549 # verify the required parameter 'account_id' is set 550 if ('account_id' not in params) or (params['account_id'] is None): 551 raise ValueError("Missing the required parameter `account_id` when calling `get_brands`") 552 # verify the required parameter 'group_id' is set 553 if ('group_id' not in params) or (params['group_id'] is None): 554 raise ValueError("Missing the required parameter `group_id` when calling `get_brands`") 555 556 557 collection_formats = {} 558 559 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 560 path_params = {} 561 if 'account_id' in params: 562 path_params['accountId'] = params['account_id'] 563 if 'group_id' in params: 564 path_params['groupId'] = params['group_id'] 565 566 query_params = {} 567 568 header_params = {} 569 570 form_params = [] 571 local_var_files = {} 572 573 body_params = None 574 # HTTP header `Accept` 575 header_params['Accept'] = self.api_client.\ 576 select_header_accept(['application/json']) 577 578 # Authentication setting 579 auth_settings = [] 580 581 return self.api_client.call_api(resource_path, 'GET', 582 path_params, 583 query_params, 584 header_params, 585 body=body_params, 586 post_params=form_params, 587 files=local_var_files, 588 response_type='GroupBrands', 589 auth_settings=auth_settings, 590 callback=params.get('callback'), 591 _return_http_data_only=params.get('_return_http_data_only'), 592 _preload_content=params.get('_preload_content', True), 593 _request_timeout=params.get('_request_timeout'), 594 collection_formats=collection_formats) 595 596 def list_group_users(self, account_id, group_id, **kwargs): 597 """ 598 Gets a list of users in a group. 599 Retrieves a list of users in a group. 600 This method makes a synchronous HTTP request by default. To make an 601 asynchronous HTTP request, please define a `callback` function 602 to be invoked when receiving the response. 603 >>> def callback_function(response): 604 >>> pprint(response) 605 >>> 606 >>> thread = api.list_group_users(account_id, group_id, callback=callback_function) 607 608 :param callback function: The callback function 609 for asynchronous request. (optional) 610 :param str account_id: The external account number (int) or account ID Guid. (required) 611 :param str group_id: The ID of the group being accessed. (required) 612 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 613 :param str start_position: Starting value for the list. 614 :return: UsersResponse 615 If the method is called asynchronously, 616 returns the request thread. 617 """ 618 kwargs['_return_http_data_only'] = True 619 if kwargs.get('callback'): 620 return self.list_group_users_with_http_info(account_id, group_id, **kwargs) 621 else: 622 (data) = self.list_group_users_with_http_info(account_id, group_id, **kwargs) 623 return data 624 625 def list_group_users_with_http_info(self, account_id, group_id, **kwargs): 626 """ 627 Gets a list of users in a group. 628 Retrieves a list of users in a group. 629 This method makes a synchronous HTTP request by default. To make an 630 asynchronous HTTP request, please define a `callback` function 631 to be invoked when receiving the response. 632 >>> def callback_function(response): 633 >>> pprint(response) 634 >>> 635 >>> thread = api.list_group_users_with_http_info(account_id, group_id, callback=callback_function) 636 637 :param callback function: The callback function 638 for asynchronous request. (optional) 639 :param str account_id: The external account number (int) or account ID Guid. (required) 640 :param str group_id: The ID of the group being accessed. (required) 641 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 642 :param str start_position: Starting value for the list. 643 :return: UsersResponse 644 If the method is called asynchronously, 645 returns the request thread. 646 """ 647 648 all_params = ['account_id', 'group_id', 'count', 'start_position'] 649 all_params.append('callback') 650 all_params.append('_return_http_data_only') 651 all_params.append('_preload_content') 652 all_params.append('_request_timeout') 653 654 params = locals() 655 for key, val in iteritems(params['kwargs']): 656 if key not in all_params: 657 raise TypeError( 658 "Got an unexpected keyword argument '%s'" 659 " to method list_group_users" % key 660 ) 661 params[key] = val 662 del params['kwargs'] 663 # verify the required parameter 'account_id' is set 664 if ('account_id' not in params) or (params['account_id'] is None): 665 raise ValueError("Missing the required parameter `account_id` when calling `list_group_users`") 666 # verify the required parameter 'group_id' is set 667 if ('group_id' not in params) or (params['group_id'] is None): 668 raise ValueError("Missing the required parameter `group_id` when calling `list_group_users`") 669 670 671 collection_formats = {} 672 673 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 674 path_params = {} 675 if 'account_id' in params: 676 path_params['accountId'] = params['account_id'] 677 if 'group_id' in params: 678 path_params['groupId'] = params['group_id'] 679 680 query_params = {} 681 if 'count' in params: 682 query_params['count'] = params['count'] 683 if 'start_position' in params: 684 query_params['start_position'] = params['start_position'] 685 686 header_params = {} 687 688 form_params = [] 689 local_var_files = {} 690 691 body_params = None 692 # HTTP header `Accept` 693 header_params['Accept'] = self.api_client.\ 694 select_header_accept(['application/json']) 695 696 # Authentication setting 697 auth_settings = [] 698 699 return self.api_client.call_api(resource_path, 'GET', 700 path_params, 701 query_params, 702 header_params, 703 body=body_params, 704 post_params=form_params, 705 files=local_var_files, 706 response_type='UsersResponse', 707 auth_settings=auth_settings, 708 callback=params.get('callback'), 709 _return_http_data_only=params.get('_return_http_data_only'), 710 _preload_content=params.get('_preload_content', True), 711 _request_timeout=params.get('_request_timeout'), 712 collection_formats=collection_formats) 713 714 def list_groups(self, account_id, **kwargs): 715 """ 716 Gets information about groups associated with the account. 717 Retrieves information about groups associated with the account. 718 This method makes a synchronous HTTP request by default. To make an 719 asynchronous HTTP request, please define a `callback` function 720 to be invoked when receiving the response. 721 >>> def callback_function(response): 722 >>> pprint(response) 723 >>> 724 >>> thread = api.list_groups(account_id, callback=callback_function) 725 726 :param callback function: The callback function 727 for asynchronous request. (optional) 728 :param str account_id: The external account number (int) or account ID Guid. (required) 729 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 730 :param str group_type: 731 :param str include_usercount: 732 :param str search_text: 733 :param str start_position: Starting value for the list. 734 :return: GroupInformation 735 If the method is called asynchronously, 736 returns the request thread. 737 """ 738 kwargs['_return_http_data_only'] = True 739 if kwargs.get('callback'): 740 return self.list_groups_with_http_info(account_id, **kwargs) 741 else: 742 (data) = self.list_groups_with_http_info(account_id, **kwargs) 743 return data 744 745 def list_groups_with_http_info(self, account_id, **kwargs): 746 """ 747 Gets information about groups associated with the account. 748 Retrieves information about groups associated with the account. 749 This method makes a synchronous HTTP request by default. To make an 750 asynchronous HTTP request, please define a `callback` function 751 to be invoked when receiving the response. 752 >>> def callback_function(response): 753 >>> pprint(response) 754 >>> 755 >>> thread = api.list_groups_with_http_info(account_id, callback=callback_function) 756 757 :param callback function: The callback function 758 for asynchronous request. (optional) 759 :param str account_id: The external account number (int) or account ID Guid. (required) 760 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 761 :param str group_type: 762 :param str include_usercount: 763 :param str search_text: 764 :param str start_position: Starting value for the list. 765 :return: GroupInformation 766 If the method is called asynchronously, 767 returns the request thread. 768 """ 769 770 all_params = ['account_id', 'count', 'group_type', 'include_usercount', 'search_text', 'start_position'] 771 all_params.append('callback') 772 all_params.append('_return_http_data_only') 773 all_params.append('_preload_content') 774 all_params.append('_request_timeout') 775 776 params = locals() 777 for key, val in iteritems(params['kwargs']): 778 if key not in all_params: 779 raise TypeError( 780 "Got an unexpected keyword argument '%s'" 781 " to method list_groups" % key 782 ) 783 params[key] = val 784 del params['kwargs'] 785 # verify the required parameter 'account_id' is set 786 if ('account_id' not in params) or (params['account_id'] is None): 787 raise ValueError("Missing the required parameter `account_id` when calling `list_groups`") 788 789 790 collection_formats = {} 791 792 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 793 path_params = {} 794 if 'account_id' in params: 795 path_params['accountId'] = params['account_id'] 796 797 query_params = {} 798 if 'count' in params: 799 query_params['count'] = params['count'] 800 if 'group_type' in params: 801 query_params['group_type'] = params['group_type'] 802 if 'include_usercount' in params: 803 query_params['include_usercount'] = params['include_usercount'] 804 if 'search_text' in params: 805 query_params['search_text'] = params['search_text'] 806 if 'start_position' in params: 807 query_params['start_position'] = params['start_position'] 808 809 header_params = {} 810 811 form_params = [] 812 local_var_files = {} 813 814 body_params = None 815 # HTTP header `Accept` 816 header_params['Accept'] = self.api_client.\ 817 select_header_accept(['application/json']) 818 819 # Authentication setting 820 auth_settings = [] 821 822 return self.api_client.call_api(resource_path, 'GET', 823 path_params, 824 query_params, 825 header_params, 826 body=body_params, 827 post_params=form_params, 828 files=local_var_files, 829 response_type='GroupInformation', 830 auth_settings=auth_settings, 831 callback=params.get('callback'), 832 _return_http_data_only=params.get('_return_http_data_only'), 833 _preload_content=params.get('_preload_content', True), 834 _request_timeout=params.get('_request_timeout'), 835 collection_formats=collection_formats) 836 837 def update_brands(self, account_id, group_id, **kwargs): 838 """ 839 Adds group brand ID information to a group. 840 Adds group brand ID information to a group. 841 This method makes a synchronous HTTP request by default. To make an 842 asynchronous HTTP request, please define a `callback` function 843 to be invoked when receiving the response. 844 >>> def callback_function(response): 845 >>> pprint(response) 846 >>> 847 >>> thread = api.update_brands(account_id, group_id, callback=callback_function) 848 849 :param callback function: The callback function 850 for asynchronous request. (optional) 851 :param str account_id: The external account number (int) or account ID Guid. (required) 852 :param str group_id: The ID of the group being accessed. (required) 853 :param BrandsRequest brands_request: 854 :return: GroupBrands 855 If the method is called asynchronously, 856 returns the request thread. 857 """ 858 kwargs['_return_http_data_only'] = True 859 if kwargs.get('callback'): 860 return self.update_brands_with_http_info(account_id, group_id, **kwargs) 861 else: 862 (data) = self.update_brands_with_http_info(account_id, group_id, **kwargs) 863 return data 864 865 def update_brands_with_http_info(self, account_id, group_id, **kwargs): 866 """ 867 Adds group brand ID information to a group. 868 Adds group brand ID information to a group. 869 This method makes a synchronous HTTP request by default. To make an 870 asynchronous HTTP request, please define a `callback` function 871 to be invoked when receiving the response. 872 >>> def callback_function(response): 873 >>> pprint(response) 874 >>> 875 >>> thread = api.update_brands_with_http_info(account_id, group_id, callback=callback_function) 876 877 :param callback function: The callback function 878 for asynchronous request. (optional) 879 :param str account_id: The external account number (int) or account ID Guid. (required) 880 :param str group_id: The ID of the group being accessed. (required) 881 :param BrandsRequest brands_request: 882 :return: GroupBrands 883 If the method is called asynchronously, 884 returns the request thread. 885 """ 886 887 all_params = ['account_id', 'group_id', 'brands_request'] 888 all_params.append('callback') 889 all_params.append('_return_http_data_only') 890 all_params.append('_preload_content') 891 all_params.append('_request_timeout') 892 893 params = locals() 894 for key, val in iteritems(params['kwargs']): 895 if key not in all_params: 896 raise TypeError( 897 "Got an unexpected keyword argument '%s'" 898 " to method update_brands" % key 899 ) 900 params[key] = val 901 del params['kwargs'] 902 # verify the required parameter 'account_id' is set 903 if ('account_id' not in params) or (params['account_id'] is None): 904 raise ValueError("Missing the required parameter `account_id` when calling `update_brands`") 905 # verify the required parameter 'group_id' is set 906 if ('group_id' not in params) or (params['group_id'] is None): 907 raise ValueError("Missing the required parameter `group_id` when calling `update_brands`") 908 909 910 collection_formats = {} 911 912 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 913 path_params = {} 914 if 'account_id' in params: 915 path_params['accountId'] = params['account_id'] 916 if 'group_id' in params: 917 path_params['groupId'] = params['group_id'] 918 919 query_params = {} 920 921 header_params = {} 922 923 form_params = [] 924 local_var_files = {} 925 926 body_params = None 927 if 'brands_request' in params: 928 body_params = params['brands_request'] 929 # HTTP header `Accept` 930 header_params['Accept'] = self.api_client.\ 931 select_header_accept(['application/json']) 932 933 # Authentication setting 934 auth_settings = [] 935 936 return self.api_client.call_api(resource_path, 'PUT', 937 path_params, 938 query_params, 939 header_params, 940 body=body_params, 941 post_params=form_params, 942 files=local_var_files, 943 response_type='GroupBrands', 944 auth_settings=auth_settings, 945 callback=params.get('callback'), 946 _return_http_data_only=params.get('_return_http_data_only'), 947 _preload_content=params.get('_preload_content', True), 948 _request_timeout=params.get('_request_timeout'), 949 collection_formats=collection_formats) 950 951 def update_group_users(self, account_id, group_id, **kwargs): 952 """ 953 Adds one or more users to an existing group. 954 Adds one or more users to an existing group. 955 This method makes a synchronous HTTP request by default. To make an 956 asynchronous HTTP request, please define a `callback` function 957 to be invoked when receiving the response. 958 >>> def callback_function(response): 959 >>> pprint(response) 960 >>> 961 >>> thread = api.update_group_users(account_id, group_id, callback=callback_function) 962 963 :param callback function: The callback function 964 for asynchronous request. (optional) 965 :param str account_id: The external account number (int) or account ID Guid. (required) 966 :param str group_id: The ID of the group being accessed. (required) 967 :param UserInfoList user_info_list: 968 :return: UsersResponse 969 If the method is called asynchronously, 970 returns the request thread. 971 """ 972 kwargs['_return_http_data_only'] = True 973 if kwargs.get('callback'): 974 return self.update_group_users_with_http_info(account_id, group_id, **kwargs) 975 else: 976 (data) = self.update_group_users_with_http_info(account_id, group_id, **kwargs) 977 return data 978 979 def update_group_users_with_http_info(self, account_id, group_id, **kwargs): 980 """ 981 Adds one or more users to an existing group. 982 Adds one or more users to an existing group. 983 This method makes a synchronous HTTP request by default. To make an 984 asynchronous HTTP request, please define a `callback` function 985 to be invoked when receiving the response. 986 >>> def callback_function(response): 987 >>> pprint(response) 988 >>> 989 >>> thread = api.update_group_users_with_http_info(account_id, group_id, callback=callback_function) 990 991 :param callback function: The callback function 992 for asynchronous request. (optional) 993 :param str account_id: The external account number (int) or account ID Guid. (required) 994 :param str group_id: The ID of the group being accessed. (required) 995 :param UserInfoList user_info_list: 996 :return: UsersResponse 997 If the method is called asynchronously, 998 returns the request thread. 999 """ 1000 1001 all_params = ['account_id', 'group_id', 'user_info_list'] 1002 all_params.append('callback') 1003 all_params.append('_return_http_data_only') 1004 all_params.append('_preload_content') 1005 all_params.append('_request_timeout') 1006 1007 params = locals() 1008 for key, val in iteritems(params['kwargs']): 1009 if key not in all_params: 1010 raise TypeError( 1011 "Got an unexpected keyword argument '%s'" 1012 " to method update_group_users" % key 1013 ) 1014 params[key] = val 1015 del params['kwargs'] 1016 # verify the required parameter 'account_id' is set 1017 if ('account_id' not in params) or (params['account_id'] is None): 1018 raise ValueError("Missing the required parameter `account_id` when calling `update_group_users`") 1019 # verify the required parameter 'group_id' is set 1020 if ('group_id' not in params) or (params['group_id'] is None): 1021 raise ValueError("Missing the required parameter `group_id` when calling `update_group_users`") 1022 1023 1024 collection_formats = {} 1025 1026 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 1027 path_params = {} 1028 if 'account_id' in params: 1029 path_params['accountId'] = params['account_id'] 1030 if 'group_id' in params: 1031 path_params['groupId'] = params['group_id'] 1032 1033 query_params = {} 1034 1035 header_params = {} 1036 1037 form_params = [] 1038 local_var_files = {} 1039 1040 body_params = None 1041 if 'user_info_list' in params: 1042 body_params = params['user_info_list'] 1043 # HTTP header `Accept` 1044 header_params['Accept'] = self.api_client.\ 1045 select_header_accept(['application/json']) 1046 1047 # Authentication setting 1048 auth_settings = [] 1049 1050 return self.api_client.call_api(resource_path, 'PUT', 1051 path_params, 1052 query_params, 1053 header_params, 1054 body=body_params, 1055 post_params=form_params, 1056 files=local_var_files, 1057 response_type='UsersResponse', 1058 auth_settings=auth_settings, 1059 callback=params.get('callback'), 1060 _return_http_data_only=params.get('_return_http_data_only'), 1061 _preload_content=params.get('_preload_content', True), 1062 _request_timeout=params.get('_request_timeout'), 1063 collection_formats=collection_formats) 1064 1065 def update_groups(self, account_id, **kwargs): 1066 """ 1067 Updates the group information for a group. 1068 Updates the group name and modifies, or sets, the permission profile for the group. 1069 This method makes a synchronous HTTP request by default. To make an 1070 asynchronous HTTP request, please define a `callback` function 1071 to be invoked when receiving the response. 1072 >>> def callback_function(response): 1073 >>> pprint(response) 1074 >>> 1075 >>> thread = api.update_groups(account_id, callback=callback_function) 1076 1077 :param callback function: The callback function 1078 for asynchronous request. (optional) 1079 :param str account_id: The external account number (int) or account ID Guid. (required) 1080 :param GroupInformation group_information: 1081 :return: GroupInformation 1082 If the method is called asynchronously, 1083 returns the request thread. 1084 """ 1085 kwargs['_return_http_data_only'] = True 1086 if kwargs.get('callback'): 1087 return self.update_groups_with_http_info(account_id, **kwargs) 1088 else: 1089 (data) = self.update_groups_with_http_info(account_id, **kwargs) 1090 return data 1091 1092 def update_groups_with_http_info(self, account_id, **kwargs): 1093 """ 1094 Updates the group information for a group. 1095 Updates the group name and modifies, or sets, the permission profile for the group. 1096 This method makes a synchronous HTTP request by default. To make an 1097 asynchronous HTTP request, please define a `callback` function 1098 to be invoked when receiving the response. 1099 >>> def callback_function(response): 1100 >>> pprint(response) 1101 >>> 1102 >>> thread = api.update_groups_with_http_info(account_id, callback=callback_function) 1103 1104 :param callback function: The callback function 1105 for asynchronous request. (optional) 1106 :param str account_id: The external account number (int) or account ID Guid. (required) 1107 :param GroupInformation group_information: 1108 :return: GroupInformation 1109 If the method is called asynchronously, 1110 returns the request thread. 1111 """ 1112 1113 all_params = ['account_id', 'group_information'] 1114 all_params.append('callback') 1115 all_params.append('_return_http_data_only') 1116 all_params.append('_preload_content') 1117 all_params.append('_request_timeout') 1118 1119 params = locals() 1120 for key, val in iteritems(params['kwargs']): 1121 if key not in all_params: 1122 raise TypeError( 1123 "Got an unexpected keyword argument '%s'" 1124 " to method update_groups" % key 1125 ) 1126 params[key] = val 1127 del params['kwargs'] 1128 # verify the required parameter 'account_id' is set 1129 if ('account_id' not in params) or (params['account_id'] is None): 1130 raise ValueError("Missing the required parameter `account_id` when calling `update_groups`") 1131 1132 1133 collection_formats = {} 1134 1135 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 1136 path_params = {} 1137 if 'account_id' in params: 1138 path_params['accountId'] = params['account_id'] 1139 1140 query_params = {} 1141 1142 header_params = {} 1143 1144 form_params = [] 1145 local_var_files = {} 1146 1147 body_params = None 1148 if 'group_information' in params: 1149 body_params = params['group_information'] 1150 # HTTP header `Accept` 1151 header_params['Accept'] = self.api_client.\ 1152 select_header_accept(['application/json']) 1153 1154 # Authentication setting 1155 auth_settings = [] 1156 1157 return self.api_client.call_api(resource_path, 'PUT', 1158 path_params, 1159 query_params, 1160 header_params, 1161 body=body_params, 1162 post_params=form_params, 1163 files=local_var_files, 1164 response_type='GroupInformation', 1165 auth_settings=auth_settings, 1166 callback=params.get('callback'), 1167 _return_http_data_only=params.get('_return_http_data_only'), 1168 _preload_content=params.get('_preload_content', True), 1169 _request_timeout=params.get('_request_timeout'), 1170 collection_formats=collection_formats)
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen
44 def create_groups(self, account_id, **kwargs): 45 """ 46 Creates one or more groups for the account. 47 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.create_groups(account_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: The external account number (int) or account ID Guid. (required) 59 :param GroupInformation group_information: 60 :return: GroupInformation 61 If the method is called asynchronously, 62 returns the request thread. 63 """ 64 kwargs['_return_http_data_only'] = True 65 if kwargs.get('callback'): 66 return self.create_groups_with_http_info(account_id, **kwargs) 67 else: 68 (data) = self.create_groups_with_http_info(account_id, **kwargs) 69 return data
Creates one or more groups for the account.
Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the userSettings
property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_groups(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
71 def create_groups_with_http_info(self, account_id, **kwargs): 72 """ 73 Creates one or more groups for the account. 74 Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the `userSettings` property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates. 75 This method makes a synchronous HTTP request by default. To make an 76 asynchronous HTTP request, please define a `callback` function 77 to be invoked when receiving the response. 78 >>> def callback_function(response): 79 >>> pprint(response) 80 >>> 81 >>> thread = api.create_groups_with_http_info(account_id, callback=callback_function) 82 83 :param callback function: The callback function 84 for asynchronous request. (optional) 85 :param str account_id: The external account number (int) or account ID Guid. (required) 86 :param GroupInformation group_information: 87 :return: GroupInformation 88 If the method is called asynchronously, 89 returns the request thread. 90 """ 91 92 all_params = ['account_id', 'group_information'] 93 all_params.append('callback') 94 all_params.append('_return_http_data_only') 95 all_params.append('_preload_content') 96 all_params.append('_request_timeout') 97 98 params = locals() 99 for key, val in iteritems(params['kwargs']): 100 if key not in all_params: 101 raise TypeError( 102 "Got an unexpected keyword argument '%s'" 103 " to method create_groups" % key 104 ) 105 params[key] = val 106 del params['kwargs'] 107 # verify the required parameter 'account_id' is set 108 if ('account_id' not in params) or (params['account_id'] is None): 109 raise ValueError("Missing the required parameter `account_id` when calling `create_groups`") 110 111 112 collection_formats = {} 113 114 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 115 path_params = {} 116 if 'account_id' in params: 117 path_params['accountId'] = params['account_id'] 118 119 query_params = {} 120 121 header_params = {} 122 123 form_params = [] 124 local_var_files = {} 125 126 body_params = None 127 if 'group_information' in params: 128 body_params = params['group_information'] 129 # HTTP header `Accept` 130 header_params['Accept'] = self.api_client.\ 131 select_header_accept(['application/json']) 132 133 # Authentication setting 134 auth_settings = [] 135 136 return self.api_client.call_api(resource_path, 'POST', 137 path_params, 138 query_params, 139 header_params, 140 body=body_params, 141 post_params=form_params, 142 files=local_var_files, 143 response_type='GroupInformation', 144 auth_settings=auth_settings, 145 callback=params.get('callback'), 146 _return_http_data_only=params.get('_return_http_data_only'), 147 _preload_content=params.get('_preload_content', True), 148 _request_timeout=params.get('_request_timeout'), 149 collection_formats=collection_formats)
Creates one or more groups for the account.
Creates one or more groups for the account. Groups can be used to help manage users by associating users with a group. You can associate a group with a Permission Profile, which sets the user permissions for users in that group without having to set the userSettings
property for each user. You are not required to set Permission Profiles for a group, but it makes it easier to manage user permissions for a large number of users. You can also use groups with template sharing to limit user access to templates.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_groups_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
151 def delete_brands(self, account_id, group_id, **kwargs): 152 """ 153 Deletes brand information from the requested group. 154 Deletes brand information from the requested group. 155 This method makes a synchronous HTTP request by default. To make an 156 asynchronous HTTP request, please define a `callback` function 157 to be invoked when receiving the response. 158 >>> def callback_function(response): 159 >>> pprint(response) 160 >>> 161 >>> thread = api.delete_brands(account_id, group_id, callback=callback_function) 162 163 :param callback function: The callback function 164 for asynchronous request. (optional) 165 :param str account_id: The external account number (int) or account ID Guid. (required) 166 :param str group_id: The ID of the group being accessed. (required) 167 :param BrandsRequest brands_request: 168 :return: GroupBrands 169 If the method is called asynchronously, 170 returns the request thread. 171 """ 172 kwargs['_return_http_data_only'] = True 173 if kwargs.get('callback'): 174 return self.delete_brands_with_http_info(account_id, group_id, **kwargs) 175 else: 176 (data) = self.delete_brands_with_http_info(account_id, group_id, **kwargs) 177 return data
Deletes brand information from the requested group.
Deletes brand information from the requested group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_brands(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- BrandsRequest brands_request:
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
179 def delete_brands_with_http_info(self, account_id, group_id, **kwargs): 180 """ 181 Deletes brand information from the requested group. 182 Deletes brand information from the requested group. 183 This method makes a synchronous HTTP request by default. To make an 184 asynchronous HTTP request, please define a `callback` function 185 to be invoked when receiving the response. 186 >>> def callback_function(response): 187 >>> pprint(response) 188 >>> 189 >>> thread = api.delete_brands_with_http_info(account_id, group_id, callback=callback_function) 190 191 :param callback function: The callback function 192 for asynchronous request. (optional) 193 :param str account_id: The external account number (int) or account ID Guid. (required) 194 :param str group_id: The ID of the group being accessed. (required) 195 :param BrandsRequest brands_request: 196 :return: GroupBrands 197 If the method is called asynchronously, 198 returns the request thread. 199 """ 200 201 all_params = ['account_id', 'group_id', 'brands_request'] 202 all_params.append('callback') 203 all_params.append('_return_http_data_only') 204 all_params.append('_preload_content') 205 all_params.append('_request_timeout') 206 207 params = locals() 208 for key, val in iteritems(params['kwargs']): 209 if key not in all_params: 210 raise TypeError( 211 "Got an unexpected keyword argument '%s'" 212 " to method delete_brands" % key 213 ) 214 params[key] = val 215 del params['kwargs'] 216 # verify the required parameter 'account_id' is set 217 if ('account_id' not in params) or (params['account_id'] is None): 218 raise ValueError("Missing the required parameter `account_id` when calling `delete_brands`") 219 # verify the required parameter 'group_id' is set 220 if ('group_id' not in params) or (params['group_id'] is None): 221 raise ValueError("Missing the required parameter `group_id` when calling `delete_brands`") 222 223 224 collection_formats = {} 225 226 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 227 path_params = {} 228 if 'account_id' in params: 229 path_params['accountId'] = params['account_id'] 230 if 'group_id' in params: 231 path_params['groupId'] = params['group_id'] 232 233 query_params = {} 234 235 header_params = {} 236 237 form_params = [] 238 local_var_files = {} 239 240 body_params = None 241 if 'brands_request' in params: 242 body_params = params['brands_request'] 243 # HTTP header `Accept` 244 header_params['Accept'] = self.api_client.\ 245 select_header_accept(['application/json']) 246 247 # Authentication setting 248 auth_settings = [] 249 250 return self.api_client.call_api(resource_path, 'DELETE', 251 path_params, 252 query_params, 253 header_params, 254 body=body_params, 255 post_params=form_params, 256 files=local_var_files, 257 response_type='GroupBrands', 258 auth_settings=auth_settings, 259 callback=params.get('callback'), 260 _return_http_data_only=params.get('_return_http_data_only'), 261 _preload_content=params.get('_preload_content', True), 262 _request_timeout=params.get('_request_timeout'), 263 collection_formats=collection_formats)
Deletes brand information from the requested group.
Deletes brand information from the requested group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_brands_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- BrandsRequest brands_request:
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
265 def delete_group_users(self, account_id, group_id, **kwargs): 266 """ 267 Deletes one or more users from a gro 268 Deletes one or more users from a group. 269 This method makes a synchronous HTTP request by default. To make an 270 asynchronous HTTP request, please define a `callback` function 271 to be invoked when receiving the response. 272 >>> def callback_function(response): 273 >>> pprint(response) 274 >>> 275 >>> thread = api.delete_group_users(account_id, group_id, callback=callback_function) 276 277 :param callback function: The callback function 278 for asynchronous request. (optional) 279 :param str account_id: The external account number (int) or account ID Guid. (required) 280 :param str group_id: The ID of the group being accessed. (required) 281 :param UserInfoList user_info_list: 282 :return: UsersResponse 283 If the method is called asynchronously, 284 returns the request thread. 285 """ 286 kwargs['_return_http_data_only'] = True 287 if kwargs.get('callback'): 288 return self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 289 else: 290 (data) = self.delete_group_users_with_http_info(account_id, group_id, **kwargs) 291 return data
Deletes one or more users from a gro
Deletes one or more users from a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_group_users(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- UserInfoList user_info_list:
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
293 def delete_group_users_with_http_info(self, account_id, group_id, **kwargs): 294 """ 295 Deletes one or more users from a gro 296 Deletes one or more users from a group. 297 This method makes a synchronous HTTP request by default. To make an 298 asynchronous HTTP request, please define a `callback` function 299 to be invoked when receiving the response. 300 >>> def callback_function(response): 301 >>> pprint(response) 302 >>> 303 >>> thread = api.delete_group_users_with_http_info(account_id, group_id, callback=callback_function) 304 305 :param callback function: The callback function 306 for asynchronous request. (optional) 307 :param str account_id: The external account number (int) or account ID Guid. (required) 308 :param str group_id: The ID of the group being accessed. (required) 309 :param UserInfoList user_info_list: 310 :return: UsersResponse 311 If the method is called asynchronously, 312 returns the request thread. 313 """ 314 315 all_params = ['account_id', 'group_id', 'user_info_list'] 316 all_params.append('callback') 317 all_params.append('_return_http_data_only') 318 all_params.append('_preload_content') 319 all_params.append('_request_timeout') 320 321 params = locals() 322 for key, val in iteritems(params['kwargs']): 323 if key not in all_params: 324 raise TypeError( 325 "Got an unexpected keyword argument '%s'" 326 " to method delete_group_users" % key 327 ) 328 params[key] = val 329 del params['kwargs'] 330 # verify the required parameter 'account_id' is set 331 if ('account_id' not in params) or (params['account_id'] is None): 332 raise ValueError("Missing the required parameter `account_id` when calling `delete_group_users`") 333 # verify the required parameter 'group_id' is set 334 if ('group_id' not in params) or (params['group_id'] is None): 335 raise ValueError("Missing the required parameter `group_id` when calling `delete_group_users`") 336 337 338 collection_formats = {} 339 340 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 341 path_params = {} 342 if 'account_id' in params: 343 path_params['accountId'] = params['account_id'] 344 if 'group_id' in params: 345 path_params['groupId'] = params['group_id'] 346 347 query_params = {} 348 349 header_params = {} 350 351 form_params = [] 352 local_var_files = {} 353 354 body_params = None 355 if 'user_info_list' in params: 356 body_params = params['user_info_list'] 357 # HTTP header `Accept` 358 header_params['Accept'] = self.api_client.\ 359 select_header_accept(['application/json']) 360 361 # Authentication setting 362 auth_settings = [] 363 364 return self.api_client.call_api(resource_path, 'DELETE', 365 path_params, 366 query_params, 367 header_params, 368 body=body_params, 369 post_params=form_params, 370 files=local_var_files, 371 response_type='UsersResponse', 372 auth_settings=auth_settings, 373 callback=params.get('callback'), 374 _return_http_data_only=params.get('_return_http_data_only'), 375 _preload_content=params.get('_preload_content', True), 376 _request_timeout=params.get('_request_timeout'), 377 collection_formats=collection_formats)
Deletes one or more users from a gro
Deletes one or more users from a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_group_users_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- UserInfoList user_info_list:
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
379 def delete_groups(self, account_id, **kwargs): 380 """ 381 Deletes an existing user group. 382 Deletes an existing user group. 383 This method makes a synchronous HTTP request by default. To make an 384 asynchronous HTTP request, please define a `callback` function 385 to be invoked when receiving the response. 386 >>> def callback_function(response): 387 >>> pprint(response) 388 >>> 389 >>> thread = api.delete_groups(account_id, callback=callback_function) 390 391 :param callback function: The callback function 392 for asynchronous request. (optional) 393 :param str account_id: The external account number (int) or account ID Guid. (required) 394 :param GroupInformation group_information: 395 :return: GroupInformation 396 If the method is called asynchronously, 397 returns the request thread. 398 """ 399 kwargs['_return_http_data_only'] = True 400 if kwargs.get('callback'): 401 return self.delete_groups_with_http_info(account_id, **kwargs) 402 else: 403 (data) = self.delete_groups_with_http_info(account_id, **kwargs) 404 return data
Deletes an existing user group.
Deletes an existing user group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_groups(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
406 def delete_groups_with_http_info(self, account_id, **kwargs): 407 """ 408 Deletes an existing user group. 409 Deletes an existing user group. 410 This method makes a synchronous HTTP request by default. To make an 411 asynchronous HTTP request, please define a `callback` function 412 to be invoked when receiving the response. 413 >>> def callback_function(response): 414 >>> pprint(response) 415 >>> 416 >>> thread = api.delete_groups_with_http_info(account_id, callback=callback_function) 417 418 :param callback function: The callback function 419 for asynchronous request. (optional) 420 :param str account_id: The external account number (int) or account ID Guid. (required) 421 :param GroupInformation group_information: 422 :return: GroupInformation 423 If the method is called asynchronously, 424 returns the request thread. 425 """ 426 427 all_params = ['account_id', 'group_information'] 428 all_params.append('callback') 429 all_params.append('_return_http_data_only') 430 all_params.append('_preload_content') 431 all_params.append('_request_timeout') 432 433 params = locals() 434 for key, val in iteritems(params['kwargs']): 435 if key not in all_params: 436 raise TypeError( 437 "Got an unexpected keyword argument '%s'" 438 " to method delete_groups" % key 439 ) 440 params[key] = val 441 del params['kwargs'] 442 # verify the required parameter 'account_id' is set 443 if ('account_id' not in params) or (params['account_id'] is None): 444 raise ValueError("Missing the required parameter `account_id` when calling `delete_groups`") 445 446 447 collection_formats = {} 448 449 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 450 path_params = {} 451 if 'account_id' in params: 452 path_params['accountId'] = params['account_id'] 453 454 query_params = {} 455 456 header_params = {} 457 458 form_params = [] 459 local_var_files = {} 460 461 body_params = None 462 if 'group_information' in params: 463 body_params = params['group_information'] 464 # HTTP header `Accept` 465 header_params['Accept'] = self.api_client.\ 466 select_header_accept(['application/json']) 467 468 # Authentication setting 469 auth_settings = [] 470 471 return self.api_client.call_api(resource_path, 'DELETE', 472 path_params, 473 query_params, 474 header_params, 475 body=body_params, 476 post_params=form_params, 477 files=local_var_files, 478 response_type='GroupInformation', 479 auth_settings=auth_settings, 480 callback=params.get('callback'), 481 _return_http_data_only=params.get('_return_http_data_only'), 482 _preload_content=params.get('_preload_content', True), 483 _request_timeout=params.get('_request_timeout'), 484 collection_formats=collection_formats)
Deletes an existing user group.
Deletes an existing user group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_groups_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
486 def get_brands(self, account_id, group_id, **kwargs): 487 """ 488 Gets group brand ID Information. 489 Retrieves information about the brands associated with the requested group. 490 This method makes a synchronous HTTP request by default. To make an 491 asynchronous HTTP request, please define a `callback` function 492 to be invoked when receiving the response. 493 >>> def callback_function(response): 494 >>> pprint(response) 495 >>> 496 >>> thread = api.get_brands(account_id, group_id, callback=callback_function) 497 498 :param callback function: The callback function 499 for asynchronous request. (optional) 500 :param str account_id: The external account number (int) or account ID Guid. (required) 501 :param str group_id: The ID of the group being accessed. (required) 502 :return: GroupBrands 503 If the method is called asynchronously, 504 returns the request thread. 505 """ 506 kwargs['_return_http_data_only'] = True 507 if kwargs.get('callback'): 508 return self.get_brands_with_http_info(account_id, group_id, **kwargs) 509 else: 510 (data) = self.get_brands_with_http_info(account_id, group_id, **kwargs) 511 return data
Gets group brand ID Information.
Retrieves information about the brands associated with the requested group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_brands(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
513 def get_brands_with_http_info(self, account_id, group_id, **kwargs): 514 """ 515 Gets group brand ID Information. 516 Retrieves information about the brands associated with the requested group. 517 This method makes a synchronous HTTP request by default. To make an 518 asynchronous HTTP request, please define a `callback` function 519 to be invoked when receiving the response. 520 >>> def callback_function(response): 521 >>> pprint(response) 522 >>> 523 >>> thread = api.get_brands_with_http_info(account_id, group_id, callback=callback_function) 524 525 :param callback function: The callback function 526 for asynchronous request. (optional) 527 :param str account_id: The external account number (int) or account ID Guid. (required) 528 :param str group_id: The ID of the group being accessed. (required) 529 :return: GroupBrands 530 If the method is called asynchronously, 531 returns the request thread. 532 """ 533 534 all_params = ['account_id', 'group_id'] 535 all_params.append('callback') 536 all_params.append('_return_http_data_only') 537 all_params.append('_preload_content') 538 all_params.append('_request_timeout') 539 540 params = locals() 541 for key, val in iteritems(params['kwargs']): 542 if key not in all_params: 543 raise TypeError( 544 "Got an unexpected keyword argument '%s'" 545 " to method get_brands" % key 546 ) 547 params[key] = val 548 del params['kwargs'] 549 # verify the required parameter 'account_id' is set 550 if ('account_id' not in params) or (params['account_id'] is None): 551 raise ValueError("Missing the required parameter `account_id` when calling `get_brands`") 552 # verify the required parameter 'group_id' is set 553 if ('group_id' not in params) or (params['group_id'] is None): 554 raise ValueError("Missing the required parameter `group_id` when calling `get_brands`") 555 556 557 collection_formats = {} 558 559 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 560 path_params = {} 561 if 'account_id' in params: 562 path_params['accountId'] = params['account_id'] 563 if 'group_id' in params: 564 path_params['groupId'] = params['group_id'] 565 566 query_params = {} 567 568 header_params = {} 569 570 form_params = [] 571 local_var_files = {} 572 573 body_params = None 574 # HTTP header `Accept` 575 header_params['Accept'] = self.api_client.\ 576 select_header_accept(['application/json']) 577 578 # Authentication setting 579 auth_settings = [] 580 581 return self.api_client.call_api(resource_path, 'GET', 582 path_params, 583 query_params, 584 header_params, 585 body=body_params, 586 post_params=form_params, 587 files=local_var_files, 588 response_type='GroupBrands', 589 auth_settings=auth_settings, 590 callback=params.get('callback'), 591 _return_http_data_only=params.get('_return_http_data_only'), 592 _preload_content=params.get('_preload_content', True), 593 _request_timeout=params.get('_request_timeout'), 594 collection_formats=collection_formats)
Gets group brand ID Information.
Retrieves information about the brands associated with the requested group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_brands_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
596 def list_group_users(self, account_id, group_id, **kwargs): 597 """ 598 Gets a list of users in a group. 599 Retrieves a list of users in a group. 600 This method makes a synchronous HTTP request by default. To make an 601 asynchronous HTTP request, please define a `callback` function 602 to be invoked when receiving the response. 603 >>> def callback_function(response): 604 >>> pprint(response) 605 >>> 606 >>> thread = api.list_group_users(account_id, group_id, callback=callback_function) 607 608 :param callback function: The callback function 609 for asynchronous request. (optional) 610 :param str account_id: The external account number (int) or account ID Guid. (required) 611 :param str group_id: The ID of the group being accessed. (required) 612 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 613 :param str start_position: Starting value for the list. 614 :return: UsersResponse 615 If the method is called asynchronously, 616 returns the request thread. 617 """ 618 kwargs['_return_http_data_only'] = True 619 if kwargs.get('callback'): 620 return self.list_group_users_with_http_info(account_id, group_id, **kwargs) 621 else: 622 (data) = self.list_group_users_with_http_info(account_id, group_id, **kwargs) 623 return data
Gets a list of users in a group.
Retrieves a list of users in a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_group_users(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- str count: Number of records to return. The number must be greater than 1 and less than or equal to 100.
- str start_position: Starting value for the list.
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
625 def list_group_users_with_http_info(self, account_id, group_id, **kwargs): 626 """ 627 Gets a list of users in a group. 628 Retrieves a list of users in a group. 629 This method makes a synchronous HTTP request by default. To make an 630 asynchronous HTTP request, please define a `callback` function 631 to be invoked when receiving the response. 632 >>> def callback_function(response): 633 >>> pprint(response) 634 >>> 635 >>> thread = api.list_group_users_with_http_info(account_id, group_id, callback=callback_function) 636 637 :param callback function: The callback function 638 for asynchronous request. (optional) 639 :param str account_id: The external account number (int) or account ID Guid. (required) 640 :param str group_id: The ID of the group being accessed. (required) 641 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 642 :param str start_position: Starting value for the list. 643 :return: UsersResponse 644 If the method is called asynchronously, 645 returns the request thread. 646 """ 647 648 all_params = ['account_id', 'group_id', 'count', 'start_position'] 649 all_params.append('callback') 650 all_params.append('_return_http_data_only') 651 all_params.append('_preload_content') 652 all_params.append('_request_timeout') 653 654 params = locals() 655 for key, val in iteritems(params['kwargs']): 656 if key not in all_params: 657 raise TypeError( 658 "Got an unexpected keyword argument '%s'" 659 " to method list_group_users" % key 660 ) 661 params[key] = val 662 del params['kwargs'] 663 # verify the required parameter 'account_id' is set 664 if ('account_id' not in params) or (params['account_id'] is None): 665 raise ValueError("Missing the required parameter `account_id` when calling `list_group_users`") 666 # verify the required parameter 'group_id' is set 667 if ('group_id' not in params) or (params['group_id'] is None): 668 raise ValueError("Missing the required parameter `group_id` when calling `list_group_users`") 669 670 671 collection_formats = {} 672 673 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 674 path_params = {} 675 if 'account_id' in params: 676 path_params['accountId'] = params['account_id'] 677 if 'group_id' in params: 678 path_params['groupId'] = params['group_id'] 679 680 query_params = {} 681 if 'count' in params: 682 query_params['count'] = params['count'] 683 if 'start_position' in params: 684 query_params['start_position'] = params['start_position'] 685 686 header_params = {} 687 688 form_params = [] 689 local_var_files = {} 690 691 body_params = None 692 # HTTP header `Accept` 693 header_params['Accept'] = self.api_client.\ 694 select_header_accept(['application/json']) 695 696 # Authentication setting 697 auth_settings = [] 698 699 return self.api_client.call_api(resource_path, 'GET', 700 path_params, 701 query_params, 702 header_params, 703 body=body_params, 704 post_params=form_params, 705 files=local_var_files, 706 response_type='UsersResponse', 707 auth_settings=auth_settings, 708 callback=params.get('callback'), 709 _return_http_data_only=params.get('_return_http_data_only'), 710 _preload_content=params.get('_preload_content', True), 711 _request_timeout=params.get('_request_timeout'), 712 collection_formats=collection_formats)
Gets a list of users in a group.
Retrieves a list of users in a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_group_users_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- str count: Number of records to return. The number must be greater than 1 and less than or equal to 100.
- str start_position: Starting value for the list.
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
714 def list_groups(self, account_id, **kwargs): 715 """ 716 Gets information about groups associated with the account. 717 Retrieves information about groups associated with the account. 718 This method makes a synchronous HTTP request by default. To make an 719 asynchronous HTTP request, please define a `callback` function 720 to be invoked when receiving the response. 721 >>> def callback_function(response): 722 >>> pprint(response) 723 >>> 724 >>> thread = api.list_groups(account_id, callback=callback_function) 725 726 :param callback function: The callback function 727 for asynchronous request. (optional) 728 :param str account_id: The external account number (int) or account ID Guid. (required) 729 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 730 :param str group_type: 731 :param str include_usercount: 732 :param str search_text: 733 :param str start_position: Starting value for the list. 734 :return: GroupInformation 735 If the method is called asynchronously, 736 returns the request thread. 737 """ 738 kwargs['_return_http_data_only'] = True 739 if kwargs.get('callback'): 740 return self.list_groups_with_http_info(account_id, **kwargs) 741 else: 742 (data) = self.list_groups_with_http_info(account_id, **kwargs) 743 return data
Gets information about groups associated with the account.
Retrieves information about groups associated with the account.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_groups(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str count: Number of records to return. The number must be greater than 1 and less than or equal to 100.
- str group_type:
- str include_usercount:
- str search_text:
- str start_position: Starting value for the list.
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
745 def list_groups_with_http_info(self, account_id, **kwargs): 746 """ 747 Gets information about groups associated with the account. 748 Retrieves information about groups associated with the account. 749 This method makes a synchronous HTTP request by default. To make an 750 asynchronous HTTP request, please define a `callback` function 751 to be invoked when receiving the response. 752 >>> def callback_function(response): 753 >>> pprint(response) 754 >>> 755 >>> thread = api.list_groups_with_http_info(account_id, callback=callback_function) 756 757 :param callback function: The callback function 758 for asynchronous request. (optional) 759 :param str account_id: The external account number (int) or account ID Guid. (required) 760 :param str count: Number of records to return. The number must be greater than 1 and less than or equal to 100. 761 :param str group_type: 762 :param str include_usercount: 763 :param str search_text: 764 :param str start_position: Starting value for the list. 765 :return: GroupInformation 766 If the method is called asynchronously, 767 returns the request thread. 768 """ 769 770 all_params = ['account_id', 'count', 'group_type', 'include_usercount', 'search_text', 'start_position'] 771 all_params.append('callback') 772 all_params.append('_return_http_data_only') 773 all_params.append('_preload_content') 774 all_params.append('_request_timeout') 775 776 params = locals() 777 for key, val in iteritems(params['kwargs']): 778 if key not in all_params: 779 raise TypeError( 780 "Got an unexpected keyword argument '%s'" 781 " to method list_groups" % key 782 ) 783 params[key] = val 784 del params['kwargs'] 785 # verify the required parameter 'account_id' is set 786 if ('account_id' not in params) or (params['account_id'] is None): 787 raise ValueError("Missing the required parameter `account_id` when calling `list_groups`") 788 789 790 collection_formats = {} 791 792 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 793 path_params = {} 794 if 'account_id' in params: 795 path_params['accountId'] = params['account_id'] 796 797 query_params = {} 798 if 'count' in params: 799 query_params['count'] = params['count'] 800 if 'group_type' in params: 801 query_params['group_type'] = params['group_type'] 802 if 'include_usercount' in params: 803 query_params['include_usercount'] = params['include_usercount'] 804 if 'search_text' in params: 805 query_params['search_text'] = params['search_text'] 806 if 'start_position' in params: 807 query_params['start_position'] = params['start_position'] 808 809 header_params = {} 810 811 form_params = [] 812 local_var_files = {} 813 814 body_params = None 815 # HTTP header `Accept` 816 header_params['Accept'] = self.api_client.\ 817 select_header_accept(['application/json']) 818 819 # Authentication setting 820 auth_settings = [] 821 822 return self.api_client.call_api(resource_path, 'GET', 823 path_params, 824 query_params, 825 header_params, 826 body=body_params, 827 post_params=form_params, 828 files=local_var_files, 829 response_type='GroupInformation', 830 auth_settings=auth_settings, 831 callback=params.get('callback'), 832 _return_http_data_only=params.get('_return_http_data_only'), 833 _preload_content=params.get('_preload_content', True), 834 _request_timeout=params.get('_request_timeout'), 835 collection_formats=collection_formats)
Gets information about groups associated with the account.
Retrieves information about groups associated with the account.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_groups_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str count: Number of records to return. The number must be greater than 1 and less than or equal to 100.
- str group_type:
- str include_usercount:
- str search_text:
- str start_position: Starting value for the list.
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
837 def update_brands(self, account_id, group_id, **kwargs): 838 """ 839 Adds group brand ID information to a group. 840 Adds group brand ID information to a group. 841 This method makes a synchronous HTTP request by default. To make an 842 asynchronous HTTP request, please define a `callback` function 843 to be invoked when receiving the response. 844 >>> def callback_function(response): 845 >>> pprint(response) 846 >>> 847 >>> thread = api.update_brands(account_id, group_id, callback=callback_function) 848 849 :param callback function: The callback function 850 for asynchronous request. (optional) 851 :param str account_id: The external account number (int) or account ID Guid. (required) 852 :param str group_id: The ID of the group being accessed. (required) 853 :param BrandsRequest brands_request: 854 :return: GroupBrands 855 If the method is called asynchronously, 856 returns the request thread. 857 """ 858 kwargs['_return_http_data_only'] = True 859 if kwargs.get('callback'): 860 return self.update_brands_with_http_info(account_id, group_id, **kwargs) 861 else: 862 (data) = self.update_brands_with_http_info(account_id, group_id, **kwargs) 863 return data
Adds group brand ID information to a group.
Adds group brand ID information to a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_brands(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- BrandsRequest brands_request:
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
865 def update_brands_with_http_info(self, account_id, group_id, **kwargs): 866 """ 867 Adds group brand ID information to a group. 868 Adds group brand ID information to a group. 869 This method makes a synchronous HTTP request by default. To make an 870 asynchronous HTTP request, please define a `callback` function 871 to be invoked when receiving the response. 872 >>> def callback_function(response): 873 >>> pprint(response) 874 >>> 875 >>> thread = api.update_brands_with_http_info(account_id, group_id, callback=callback_function) 876 877 :param callback function: The callback function 878 for asynchronous request. (optional) 879 :param str account_id: The external account number (int) or account ID Guid. (required) 880 :param str group_id: The ID of the group being accessed. (required) 881 :param BrandsRequest brands_request: 882 :return: GroupBrands 883 If the method is called asynchronously, 884 returns the request thread. 885 """ 886 887 all_params = ['account_id', 'group_id', 'brands_request'] 888 all_params.append('callback') 889 all_params.append('_return_http_data_only') 890 all_params.append('_preload_content') 891 all_params.append('_request_timeout') 892 893 params = locals() 894 for key, val in iteritems(params['kwargs']): 895 if key not in all_params: 896 raise TypeError( 897 "Got an unexpected keyword argument '%s'" 898 " to method update_brands" % key 899 ) 900 params[key] = val 901 del params['kwargs'] 902 # verify the required parameter 'account_id' is set 903 if ('account_id' not in params) or (params['account_id'] is None): 904 raise ValueError("Missing the required parameter `account_id` when calling `update_brands`") 905 # verify the required parameter 'group_id' is set 906 if ('group_id' not in params) or (params['group_id'] is None): 907 raise ValueError("Missing the required parameter `group_id` when calling `update_brands`") 908 909 910 collection_formats = {} 911 912 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/brands'.replace('{format}', 'json') 913 path_params = {} 914 if 'account_id' in params: 915 path_params['accountId'] = params['account_id'] 916 if 'group_id' in params: 917 path_params['groupId'] = params['group_id'] 918 919 query_params = {} 920 921 header_params = {} 922 923 form_params = [] 924 local_var_files = {} 925 926 body_params = None 927 if 'brands_request' in params: 928 body_params = params['brands_request'] 929 # HTTP header `Accept` 930 header_params['Accept'] = self.api_client.\ 931 select_header_accept(['application/json']) 932 933 # Authentication setting 934 auth_settings = [] 935 936 return self.api_client.call_api(resource_path, 'PUT', 937 path_params, 938 query_params, 939 header_params, 940 body=body_params, 941 post_params=form_params, 942 files=local_var_files, 943 response_type='GroupBrands', 944 auth_settings=auth_settings, 945 callback=params.get('callback'), 946 _return_http_data_only=params.get('_return_http_data_only'), 947 _preload_content=params.get('_preload_content', True), 948 _request_timeout=params.get('_request_timeout'), 949 collection_formats=collection_formats)
Adds group brand ID information to a group.
Adds group brand ID information to a group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_brands_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- BrandsRequest brands_request:
Returns
GroupBrands If the method is called asynchronously, returns the request thread.
951 def update_group_users(self, account_id, group_id, **kwargs): 952 """ 953 Adds one or more users to an existing group. 954 Adds one or more users to an existing group. 955 This method makes a synchronous HTTP request by default. To make an 956 asynchronous HTTP request, please define a `callback` function 957 to be invoked when receiving the response. 958 >>> def callback_function(response): 959 >>> pprint(response) 960 >>> 961 >>> thread = api.update_group_users(account_id, group_id, callback=callback_function) 962 963 :param callback function: The callback function 964 for asynchronous request. (optional) 965 :param str account_id: The external account number (int) or account ID Guid. (required) 966 :param str group_id: The ID of the group being accessed. (required) 967 :param UserInfoList user_info_list: 968 :return: UsersResponse 969 If the method is called asynchronously, 970 returns the request thread. 971 """ 972 kwargs['_return_http_data_only'] = True 973 if kwargs.get('callback'): 974 return self.update_group_users_with_http_info(account_id, group_id, **kwargs) 975 else: 976 (data) = self.update_group_users_with_http_info(account_id, group_id, **kwargs) 977 return data
Adds one or more users to an existing group.
Adds one or more users to an existing group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_group_users(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- UserInfoList user_info_list:
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
979 def update_group_users_with_http_info(self, account_id, group_id, **kwargs): 980 """ 981 Adds one or more users to an existing group. 982 Adds one or more users to an existing group. 983 This method makes a synchronous HTTP request by default. To make an 984 asynchronous HTTP request, please define a `callback` function 985 to be invoked when receiving the response. 986 >>> def callback_function(response): 987 >>> pprint(response) 988 >>> 989 >>> thread = api.update_group_users_with_http_info(account_id, group_id, callback=callback_function) 990 991 :param callback function: The callback function 992 for asynchronous request. (optional) 993 :param str account_id: The external account number (int) or account ID Guid. (required) 994 :param str group_id: The ID of the group being accessed. (required) 995 :param UserInfoList user_info_list: 996 :return: UsersResponse 997 If the method is called asynchronously, 998 returns the request thread. 999 """ 1000 1001 all_params = ['account_id', 'group_id', 'user_info_list'] 1002 all_params.append('callback') 1003 all_params.append('_return_http_data_only') 1004 all_params.append('_preload_content') 1005 all_params.append('_request_timeout') 1006 1007 params = locals() 1008 for key, val in iteritems(params['kwargs']): 1009 if key not in all_params: 1010 raise TypeError( 1011 "Got an unexpected keyword argument '%s'" 1012 " to method update_group_users" % key 1013 ) 1014 params[key] = val 1015 del params['kwargs'] 1016 # verify the required parameter 'account_id' is set 1017 if ('account_id' not in params) or (params['account_id'] is None): 1018 raise ValueError("Missing the required parameter `account_id` when calling `update_group_users`") 1019 # verify the required parameter 'group_id' is set 1020 if ('group_id' not in params) or (params['group_id'] is None): 1021 raise ValueError("Missing the required parameter `group_id` when calling `update_group_users`") 1022 1023 1024 collection_formats = {} 1025 1026 resource_path = '/v2.1/accounts/{accountId}/groups/{groupId}/users'.replace('{format}', 'json') 1027 path_params = {} 1028 if 'account_id' in params: 1029 path_params['accountId'] = params['account_id'] 1030 if 'group_id' in params: 1031 path_params['groupId'] = params['group_id'] 1032 1033 query_params = {} 1034 1035 header_params = {} 1036 1037 form_params = [] 1038 local_var_files = {} 1039 1040 body_params = None 1041 if 'user_info_list' in params: 1042 body_params = params['user_info_list'] 1043 # HTTP header `Accept` 1044 header_params['Accept'] = self.api_client.\ 1045 select_header_accept(['application/json']) 1046 1047 # Authentication setting 1048 auth_settings = [] 1049 1050 return self.api_client.call_api(resource_path, 'PUT', 1051 path_params, 1052 query_params, 1053 header_params, 1054 body=body_params, 1055 post_params=form_params, 1056 files=local_var_files, 1057 response_type='UsersResponse', 1058 auth_settings=auth_settings, 1059 callback=params.get('callback'), 1060 _return_http_data_only=params.get('_return_http_data_only'), 1061 _preload_content=params.get('_preload_content', True), 1062 _request_timeout=params.get('_request_timeout'), 1063 collection_formats=collection_formats)
Adds one or more users to an existing group.
Adds one or more users to an existing group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_group_users_with_http_info(account_id, group_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- str group_id: The ID of the group being accessed. (required)
- UserInfoList user_info_list:
Returns
UsersResponse If the method is called asynchronously, returns the request thread.
1065 def update_groups(self, account_id, **kwargs): 1066 """ 1067 Updates the group information for a group. 1068 Updates the group name and modifies, or sets, the permission profile for the group. 1069 This method makes a synchronous HTTP request by default. To make an 1070 asynchronous HTTP request, please define a `callback` function 1071 to be invoked when receiving the response. 1072 >>> def callback_function(response): 1073 >>> pprint(response) 1074 >>> 1075 >>> thread = api.update_groups(account_id, callback=callback_function) 1076 1077 :param callback function: The callback function 1078 for asynchronous request. (optional) 1079 :param str account_id: The external account number (int) or account ID Guid. (required) 1080 :param GroupInformation group_information: 1081 :return: GroupInformation 1082 If the method is called asynchronously, 1083 returns the request thread. 1084 """ 1085 kwargs['_return_http_data_only'] = True 1086 if kwargs.get('callback'): 1087 return self.update_groups_with_http_info(account_id, **kwargs) 1088 else: 1089 (data) = self.update_groups_with_http_info(account_id, **kwargs) 1090 return data
Updates the group information for a group.
Updates the group name and modifies, or sets, the permission profile for the group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_groups(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.
1092 def update_groups_with_http_info(self, account_id, **kwargs): 1093 """ 1094 Updates the group information for a group. 1095 Updates the group name and modifies, or sets, the permission profile for the group. 1096 This method makes a synchronous HTTP request by default. To make an 1097 asynchronous HTTP request, please define a `callback` function 1098 to be invoked when receiving the response. 1099 >>> def callback_function(response): 1100 >>> pprint(response) 1101 >>> 1102 >>> thread = api.update_groups_with_http_info(account_id, callback=callback_function) 1103 1104 :param callback function: The callback function 1105 for asynchronous request. (optional) 1106 :param str account_id: The external account number (int) or account ID Guid. (required) 1107 :param GroupInformation group_information: 1108 :return: GroupInformation 1109 If the method is called asynchronously, 1110 returns the request thread. 1111 """ 1112 1113 all_params = ['account_id', 'group_information'] 1114 all_params.append('callback') 1115 all_params.append('_return_http_data_only') 1116 all_params.append('_preload_content') 1117 all_params.append('_request_timeout') 1118 1119 params = locals() 1120 for key, val in iteritems(params['kwargs']): 1121 if key not in all_params: 1122 raise TypeError( 1123 "Got an unexpected keyword argument '%s'" 1124 " to method update_groups" % key 1125 ) 1126 params[key] = val 1127 del params['kwargs'] 1128 # verify the required parameter 'account_id' is set 1129 if ('account_id' not in params) or (params['account_id'] is None): 1130 raise ValueError("Missing the required parameter `account_id` when calling `update_groups`") 1131 1132 1133 collection_formats = {} 1134 1135 resource_path = '/v2.1/accounts/{accountId}/groups'.replace('{format}', 'json') 1136 path_params = {} 1137 if 'account_id' in params: 1138 path_params['accountId'] = params['account_id'] 1139 1140 query_params = {} 1141 1142 header_params = {} 1143 1144 form_params = [] 1145 local_var_files = {} 1146 1147 body_params = None 1148 if 'group_information' in params: 1149 body_params = params['group_information'] 1150 # HTTP header `Accept` 1151 header_params['Accept'] = self.api_client.\ 1152 select_header_accept(['application/json']) 1153 1154 # Authentication setting 1155 auth_settings = [] 1156 1157 return self.api_client.call_api(resource_path, 'PUT', 1158 path_params, 1159 query_params, 1160 header_params, 1161 body=body_params, 1162 post_params=form_params, 1163 files=local_var_files, 1164 response_type='GroupInformation', 1165 auth_settings=auth_settings, 1166 callback=params.get('callback'), 1167 _return_http_data_only=params.get('_return_http_data_only'), 1168 _preload_content=params.get('_preload_content', True), 1169 _request_timeout=params.get('_request_timeout'), 1170 collection_formats=collection_formats)
Updates the group information for a group.
Updates the group name and modifies, or sets, the permission profile for the group.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback
function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_groups_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: The external account number (int) or account ID Guid. (required)
- GroupInformation group_information:
Returns
GroupInformation If the method is called asynchronously, returns the request thread.