14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- # IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7811f8fb-20200813-160653
17
+ # IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-b734cb71-20200916-090210
18
18
19
19
"""
20
20
Manage the lifecycle of your users using User Management APIs.
@@ -116,8 +116,10 @@ def get_user_settings(self,
116
116
headers .update (kwargs .get ('headers' ))
117
117
headers ['Accept' ] = 'application/json'
118
118
119
- url = '/v2/accounts/{0}/users/{1}/settings' .format (
120
- * self .encode_path_vars (account_id , iam_id ))
119
+ path_param_keys = ['account_id' , 'iam_id' ]
120
+ path_param_values = self .encode_path_vars (account_id , iam_id )
121
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
122
+ url = '/v2/accounts/{account_id}/users/{iam_id}/settings' .format (** path_param_dict )
121
123
request = self .prepare_request (method = 'GET' ,
122
124
url = url ,
123
125
headers = headers )
@@ -185,8 +187,10 @@ def update_user_settings(self,
185
187
headers .update (kwargs .get ('headers' ))
186
188
headers ['Accept' ] = 'application/json'
187
189
188
- url = '/v2/accounts/{0}/users/{1}/settings' .format (
189
- * self .encode_path_vars (account_id , iam_id ))
190
+ path_param_keys = ['account_id' , 'iam_id' ]
191
+ path_param_values = self .encode_path_vars (account_id , iam_id )
192
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
193
+ url = '/v2/accounts/{account_id}/users/{iam_id}/settings' .format (** path_param_dict )
190
194
request = self .prepare_request (method = 'PATCH' ,
191
195
url = url ,
192
196
headers = headers ,
@@ -243,8 +247,10 @@ def list_users(self,
243
247
headers .update (kwargs .get ('headers' ))
244
248
headers ['Accept' ] = 'application/json'
245
249
246
- url = '/v2/accounts/{0}/users' .format (
247
- * self .encode_path_vars (account_id ))
250
+ path_param_keys = ['account_id' ]
251
+ path_param_values = self .encode_path_vars (account_id )
252
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
253
+ url = '/v2/accounts/{account_id}/users' .format (** path_param_dict )
248
254
request = self .prepare_request (method = 'GET' ,
249
255
url = url ,
250
256
headers = headers ,
@@ -313,8 +319,10 @@ def invite_users(self,
313
319
headers .update (kwargs .get ('headers' ))
314
320
headers ['Accept' ] = 'application/json'
315
321
316
- url = '/v2/accounts/{0}/users' .format (
317
- * self .encode_path_vars (account_id ))
322
+ path_param_keys = ['account_id' ]
323
+ path_param_values = self .encode_path_vars (account_id )
324
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
325
+ url = '/v2/accounts/{account_id}/users' .format (** path_param_dict )
318
326
request = self .prepare_request (method = 'POST' ,
319
327
url = url ,
320
328
headers = headers ,
@@ -358,8 +366,10 @@ def get_user_profile(self,
358
366
headers .update (kwargs .get ('headers' ))
359
367
headers ['Accept' ] = 'application/json'
360
368
361
- url = '/v2/accounts/{0}/users/{1}' .format (
362
- * self .encode_path_vars (account_id , iam_id ))
369
+ path_param_keys = ['account_id' , 'iam_id' ]
370
+ path_param_values = self .encode_path_vars (account_id , iam_id )
371
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
372
+ url = '/v2/accounts/{account_id}/users/{iam_id}' .format (** path_param_dict )
363
373
request = self .prepare_request (method = 'GET' ,
364
374
url = url ,
365
375
headers = headers )
@@ -436,8 +446,10 @@ def update_user_profiles(self,
436
446
if 'headers' in kwargs :
437
447
headers .update (kwargs .get ('headers' ))
438
448
439
- url = '/v2/accounts/{0}/users/{1}' .format (
440
- * self .encode_path_vars (account_id , iam_id ))
449
+ path_param_keys = ['account_id' , 'iam_id' ]
450
+ path_param_values = self .encode_path_vars (account_id , iam_id )
451
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
452
+ url = '/v2/accounts/{account_id}/users/{iam_id}' .format (** path_param_dict )
441
453
request = self .prepare_request (method = 'PATCH' ,
442
454
url = url ,
443
455
headers = headers ,
@@ -481,8 +493,10 @@ def remove_users(self,
481
493
if 'headers' in kwargs :
482
494
headers .update (kwargs .get ('headers' ))
483
495
484
- url = '/v2/accounts/{0}/users/{1}' .format (
485
- * self .encode_path_vars (account_id , iam_id ))
496
+ path_param_keys = ['account_id' , 'iam_id' ]
497
+ path_param_values = self .encode_path_vars (account_id , iam_id )
498
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
499
+ url = '/v2/accounts/{account_id}/users/{iam_id}' .format (** path_param_dict )
486
500
request = self .prepare_request (method = 'DELETE' ,
487
501
url = url ,
488
502
headers = headers )
@@ -958,27 +972,36 @@ class InviteUserIamPolicy():
958
972
"""
959
973
Invite a user to an IAM policy.
960
974
975
+ :attr str type: The policy type. This can be either "access" or "authorization".
961
976
:attr List[Role] roles: (optional) A list of IAM roles.
962
977
:attr List[Resource] resources: (optional) A list of resources.
963
978
"""
964
979
965
980
def __init__ (self ,
981
+ type : str ,
966
982
* ,
967
983
roles : List ['Role' ] = None ,
968
984
resources : List ['Resource' ] = None ) -> None :
969
985
"""
970
986
Initialize a InviteUserIamPolicy object.
971
987
988
+ :param str type: The policy type. This can be either "access" or
989
+ "authorization".
972
990
:param List[Role] roles: (optional) A list of IAM roles.
973
991
:param List[Resource] resources: (optional) A list of resources.
974
992
"""
993
+ self .type = type
975
994
self .roles = roles
976
995
self .resources = resources
977
996
978
997
@classmethod
979
998
def from_dict (cls , _dict : Dict ) -> 'InviteUserIamPolicy' :
980
999
"""Initialize a InviteUserIamPolicy object from a json dictionary."""
981
1000
args = {}
1001
+ if 'type' in _dict :
1002
+ args ['type' ] = _dict .get ('type' )
1003
+ else :
1004
+ raise ValueError ('Required property \' type\' not present in InviteUserIamPolicy JSON' )
982
1005
if 'roles' in _dict :
983
1006
args ['roles' ] = [Role .from_dict (x ) for x in _dict .get ('roles' )]
984
1007
if 'resources' in _dict :
@@ -993,6 +1016,8 @@ def _from_dict(cls, _dict):
993
1016
def to_dict (self ) -> Dict :
994
1017
"""Return a json dictionary representing this model."""
995
1018
_dict = {}
1019
+ if hasattr (self , 'type' ) and self .type is not None :
1020
+ _dict ['type' ] = self .type
996
1021
if hasattr (self , 'roles' ) and self .roles is not None :
997
1022
_dict ['roles' ] = [x .to_dict () for x in self .roles ]
998
1023
if hasattr (self , 'resources' ) and self .resources is not None :
0 commit comments