ibm-platform-services 0.55.3__py3-none-any.whl → 0.57.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@
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: 3.86.2-8b8592a4-20240313-204553
17
+ # IBM OpenAPI SDK Code Generator Version: 3.93.0-c40121e6-20240729-182103
18
18
 
19
19
  """
20
20
  The IAM Identity Service API allows for the management of Account Settings and Identities
@@ -514,10 +514,7 @@ class IamIdentityV1(BaseService):
514
514
  Lock the API key.
515
515
 
516
516
  Locks an API key by ID. Users can manage user API keys for themself, or service ID
517
- API keys for service IDs that are bound to an entity they have access to. In case
518
- of service IDs and their API keys, a user must be either an account owner, a IBM
519
- Cloud org manager or IBM Cloud space developer in order to manage service IDs of
520
- the entity.
517
+ API keys for service IDs they have access to.
521
518
 
522
519
  :param str id: Unique ID of the API key.
523
520
  :param dict headers: A `dict` containing the request headers
@@ -3663,6 +3660,67 @@ class IamIdentityV1(BaseService):
3663
3660
  response = self.send(request, **kwargs)
3664
3661
  return response
3665
3662
 
3663
+ #########################
3664
+ # effectiveAccountSettings
3665
+ #########################
3666
+
3667
+ def get_effective_account_settings(
3668
+ self,
3669
+ account_id: str,
3670
+ *,
3671
+ include_history: Optional[bool] = None,
3672
+ resolve_user_mfa: Optional[bool] = None,
3673
+ **kwargs,
3674
+ ) -> DetailedResponse:
3675
+ """
3676
+ Get effective account settings configuration.
3677
+
3678
+ Returns effective account settings for given account ID.
3679
+
3680
+ :param str account_id: Unique ID of the account.
3681
+ :param bool include_history: (optional) Defines if the entity history is
3682
+ included in the response.
3683
+ :param bool resolve_user_mfa: (optional) Enrich MFA exemptions with user
3684
+ information.
3685
+ :param dict headers: A `dict` containing the request headers
3686
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3687
+ :rtype: DetailedResponse with `dict` result representing a `EffectiveAccountSettingsResponse` object
3688
+ """
3689
+
3690
+ if not account_id:
3691
+ raise ValueError('account_id must be provided')
3692
+ headers = {}
3693
+ sdk_headers = get_sdk_headers(
3694
+ service_name=self.DEFAULT_SERVICE_NAME,
3695
+ service_version='V1',
3696
+ operation_id='get_effective_account_settings',
3697
+ )
3698
+ headers.update(sdk_headers)
3699
+
3700
+ params = {
3701
+ 'include_history': include_history,
3702
+ 'resolve_user_mfa': resolve_user_mfa,
3703
+ }
3704
+
3705
+ if 'headers' in kwargs:
3706
+ headers.update(kwargs.get('headers'))
3707
+ del kwargs['headers']
3708
+ headers['Accept'] = 'application/json'
3709
+
3710
+ path_param_keys = ['account_id']
3711
+ path_param_values = self.encode_path_vars(account_id)
3712
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3713
+ url = '/v1/accounts/{account_id}/effective_settings/identity'.format(**path_param_dict)
3714
+ request = self.prepare_request(
3715
+ method='GET',
3716
+ url=url,
3717
+ headers=headers,
3718
+ params=params,
3719
+ )
3720
+
3721
+ response = self.send(request, **kwargs)
3722
+ return response
3723
+
3666
3724
  #########################
3667
3725
  # trustedProfileAssignments
3668
3726
  #########################
@@ -4051,6 +4109,7 @@ class IamIdentityV1(BaseService):
4051
4109
  description: Optional[str] = None,
4052
4110
  profile: Optional['TemplateProfileComponentRequest'] = None,
4053
4111
  policy_template_references: Optional[List['PolicyTemplateReference']] = None,
4112
+ action_controls: Optional['ActionControls'] = None,
4054
4113
  **kwargs,
4055
4114
  ) -> DetailedResponse:
4056
4115
  """
@@ -4071,6 +4130,7 @@ class IamIdentityV1(BaseService):
4071
4130
  :param List[PolicyTemplateReference] policy_template_references: (optional)
4072
4131
  Existing policy templates that you can reference to assign access in the
4073
4132
  trusted profile component.
4133
+ :param ActionControls action_controls: (optional)
4074
4134
  :param dict headers: A `dict` containing the request headers
4075
4135
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
4076
4136
  :rtype: DetailedResponse with `dict` result representing a `TrustedProfileTemplateResponse` object
@@ -4080,6 +4140,8 @@ class IamIdentityV1(BaseService):
4080
4140
  profile = convert_model(profile)
4081
4141
  if policy_template_references is not None:
4082
4142
  policy_template_references = [convert_model(x) for x in policy_template_references]
4143
+ if action_controls is not None:
4144
+ action_controls = convert_model(action_controls)
4083
4145
  headers = {}
4084
4146
  sdk_headers = get_sdk_headers(
4085
4147
  service_name=self.DEFAULT_SERVICE_NAME,
@@ -4094,6 +4156,7 @@ class IamIdentityV1(BaseService):
4094
4156
  'description': description,
4095
4157
  'profile': profile,
4096
4158
  'policy_template_references': policy_template_references,
4159
+ 'action_controls': action_controls,
4097
4160
  }
4098
4161
  data = {k: v for (k, v) in data.items() if v is not None}
4099
4162
  data = json.dumps(data)
@@ -4288,6 +4351,7 @@ class IamIdentityV1(BaseService):
4288
4351
  description: Optional[str] = None,
4289
4352
  profile: Optional['TemplateProfileComponentRequest'] = None,
4290
4353
  policy_template_references: Optional[List['PolicyTemplateReference']] = None,
4354
+ action_controls: Optional['ActionControls'] = None,
4291
4355
  **kwargs,
4292
4356
  ) -> DetailedResponse:
4293
4357
  """
@@ -4309,6 +4373,7 @@ class IamIdentityV1(BaseService):
4309
4373
  :param List[PolicyTemplateReference] policy_template_references: (optional)
4310
4374
  Existing policy templates that you can reference to assign access in the
4311
4375
  trusted profile component.
4376
+ :param ActionControls action_controls: (optional)
4312
4377
  :param dict headers: A `dict` containing the request headers
4313
4378
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
4314
4379
  :rtype: DetailedResponse with `dict` result representing a `TrustedProfileTemplateResponse` object
@@ -4320,6 +4385,8 @@ class IamIdentityV1(BaseService):
4320
4385
  profile = convert_model(profile)
4321
4386
  if policy_template_references is not None:
4322
4387
  policy_template_references = [convert_model(x) for x in policy_template_references]
4388
+ if action_controls is not None:
4389
+ action_controls = convert_model(action_controls)
4323
4390
  headers = {}
4324
4391
  sdk_headers = get_sdk_headers(
4325
4392
  service_name=self.DEFAULT_SERVICE_NAME,
@@ -4334,6 +4401,7 @@ class IamIdentityV1(BaseService):
4334
4401
  'description': description,
4335
4402
  'profile': profile,
4336
4403
  'policy_template_references': policy_template_references,
4404
+ 'action_controls': action_controls,
4337
4405
  }
4338
4406
  data = {k: v for (k, v) in data.items() if v is not None}
4339
4407
  data = json.dumps(data)
@@ -4426,6 +4494,7 @@ class IamIdentityV1(BaseService):
4426
4494
  description: Optional[str] = None,
4427
4495
  profile: Optional['TemplateProfileComponentRequest'] = None,
4428
4496
  policy_template_references: Optional[List['PolicyTemplateReference']] = None,
4497
+ action_controls: Optional['ActionControls'] = None,
4429
4498
  **kwargs,
4430
4499
  ) -> DetailedResponse:
4431
4500
  """
@@ -4452,6 +4521,7 @@ class IamIdentityV1(BaseService):
4452
4521
  :param List[PolicyTemplateReference] policy_template_references: (optional)
4453
4522
  Existing policy templates that you can reference to assign access in the
4454
4523
  trusted profile component.
4524
+ :param ActionControls action_controls: (optional)
4455
4525
  :param dict headers: A `dict` containing the request headers
4456
4526
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
4457
4527
  :rtype: DetailedResponse with `dict` result representing a `TrustedProfileTemplateResponse` object
@@ -4467,6 +4537,8 @@ class IamIdentityV1(BaseService):
4467
4537
  profile = convert_model(profile)
4468
4538
  if policy_template_references is not None:
4469
4539
  policy_template_references = [convert_model(x) for x in policy_template_references]
4540
+ if action_controls is not None:
4541
+ action_controls = convert_model(action_controls)
4470
4542
  headers = {
4471
4543
  'If-Match': if_match,
4472
4544
  }
@@ -4483,6 +4555,7 @@ class IamIdentityV1(BaseService):
4483
4555
  'description': description,
4484
4556
  'profile': profile,
4485
4557
  'policy_template_references': policy_template_references,
4558
+ 'action_controls': action_controls,
4486
4559
  }
4487
4560
  data = {k: v for (k, v) in data.items() if v is not None}
4488
4561
  data = json.dumps(data)
@@ -4972,10 +5045,11 @@ class AccountBasedMfaEnrollment:
4972
5045
  return not self == other
4973
5046
 
4974
5047
 
4975
- class AccountSettingsComponent:
5048
+ class AccountSettingsAccountSection:
4976
5049
  """
4977
- AccountSettingsComponent.
5050
+ AccountSettingsAccountSection.
4978
5051
 
5052
+ :param str account_id: (optional) Unique ID of the account.
4979
5053
  :param str restrict_create_service_id: (optional) Defines whether or not
4980
5054
  creating a service ID is access controlled. Valid values:
4981
5055
  * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
@@ -4989,7 +5063,8 @@ class AccountSettingsComponent:
4989
5063
  * NOT_SET - to 'unset' a previous set value.
4990
5064
  :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets
4991
5065
  from which IAM tokens can be created for the account.
4992
- :param str mfa: (optional) Defines the MFA trait for the account. Valid values:
5066
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5067
+ values:
4993
5068
  * NONE - No MFA trait set
4994
5069
  * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
4995
5070
  * TOTP - For all non-federated IBMId users
@@ -4997,8 +5072,10 @@ class AccountSettingsComponent:
4997
5072
  * LEVEL1 - Email-based MFA for all users
4998
5073
  * LEVEL2 - TOTP-based MFA for all users
4999
5074
  * LEVEL3 - U2F MFA for all users.
5000
- :param List[AccountSettingsUserMFA] user_mfa: (optional) List of users that are
5001
- exempted from the MFA requirement of the account.
5075
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of users
5076
+ that are exempted from the MFA requirement of the account.
5077
+ :param List[EnityHistoryRecord] history: (optional) History of the Account
5078
+ Settings.
5002
5079
  :param str session_expiration_in_seconds: (optional) Defines the session
5003
5080
  expiration in seconds for the account. Valid values:
5004
5081
  * Any whole number between between '900' and '86400'
@@ -5025,11 +5102,13 @@ class AccountSettingsComponent:
5025
5102
  def __init__(
5026
5103
  self,
5027
5104
  *,
5105
+ account_id: Optional[str] = None,
5028
5106
  restrict_create_service_id: Optional[str] = None,
5029
5107
  restrict_create_platform_apikey: Optional[str] = None,
5030
5108
  allowed_ip_addresses: Optional[str] = None,
5031
5109
  mfa: Optional[str] = None,
5032
- user_mfa: Optional[List['AccountSettingsUserMFA']] = None,
5110
+ user_mfa: Optional[List['EffectiveAccountSettingsUserMFA']] = None,
5111
+ history: Optional[List['EnityHistoryRecord']] = None,
5033
5112
  session_expiration_in_seconds: Optional[str] = None,
5034
5113
  session_invalidation_in_seconds: Optional[str] = None,
5035
5114
  max_sessions_per_identity: Optional[str] = None,
@@ -5037,8 +5116,9 @@ class AccountSettingsComponent:
5037
5116
  system_refresh_token_expiration_in_seconds: Optional[str] = None,
5038
5117
  ) -> None:
5039
5118
  """
5040
- Initialize a AccountSettingsComponent object.
5119
+ Initialize a AccountSettingsAccountSection object.
5041
5120
 
5121
+ :param str account_id: (optional) Unique ID of the account.
5042
5122
  :param str restrict_create_service_id: (optional) Defines whether or not
5043
5123
  creating a service ID is access controlled. Valid values:
5044
5124
  * RESTRICTED - only users assigned the 'Service ID creator' role on the
@@ -5052,7 +5132,7 @@ class AccountSettingsComponent:
5052
5132
  * NOT_SET - to 'unset' a previous set value.
5053
5133
  :param str allowed_ip_addresses: (optional) Defines the IP addresses and
5054
5134
  subnets from which IAM tokens can be created for the account.
5055
- :param str mfa: (optional) Defines the MFA trait for the account. Valid
5135
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5056
5136
  values:
5057
5137
  * NONE - No MFA trait set
5058
5138
  * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
@@ -5061,8 +5141,10 @@ class AccountSettingsComponent:
5061
5141
  * LEVEL1 - Email-based MFA for all users
5062
5142
  * LEVEL2 - TOTP-based MFA for all users
5063
5143
  * LEVEL3 - U2F MFA for all users.
5064
- :param List[AccountSettingsUserMFA] user_mfa: (optional) List of users that
5065
- are exempted from the MFA requirement of the account.
5144
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of
5145
+ users that are exempted from the MFA requirement of the account.
5146
+ :param List[EnityHistoryRecord] history: (optional) History of the Account
5147
+ Settings.
5066
5148
  :param str session_expiration_in_seconds: (optional) Defines the session
5067
5149
  expiration in seconds for the account. Valid values:
5068
5150
  * Any whole number between between '900' and '86400'
@@ -5085,11 +5167,13 @@ class AccountSettingsComponent:
5085
5167
  * Any whole number between '900' and '259200'
5086
5168
  * NOT_SET - To unset account setting and use service default.
5087
5169
  """
5170
+ self.account_id = account_id
5088
5171
  self.restrict_create_service_id = restrict_create_service_id
5089
5172
  self.restrict_create_platform_apikey = restrict_create_platform_apikey
5090
5173
  self.allowed_ip_addresses = allowed_ip_addresses
5091
5174
  self.mfa = mfa
5092
5175
  self.user_mfa = user_mfa
5176
+ self.history = history
5093
5177
  self.session_expiration_in_seconds = session_expiration_in_seconds
5094
5178
  self.session_invalidation_in_seconds = session_invalidation_in_seconds
5095
5179
  self.max_sessions_per_identity = max_sessions_per_identity
@@ -5097,9 +5181,11 @@ class AccountSettingsComponent:
5097
5181
  self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds
5098
5182
 
5099
5183
  @classmethod
5100
- def from_dict(cls, _dict: Dict) -> 'AccountSettingsComponent':
5101
- """Initialize a AccountSettingsComponent object from a json dictionary."""
5184
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsAccountSection':
5185
+ """Initialize a AccountSettingsAccountSection object from a json dictionary."""
5102
5186
  args = {}
5187
+ if (account_id := _dict.get('account_id')) is not None:
5188
+ args['account_id'] = account_id
5103
5189
  if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None:
5104
5190
  args['restrict_create_service_id'] = restrict_create_service_id
5105
5191
  if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None:
@@ -5109,7 +5195,9 @@ class AccountSettingsComponent:
5109
5195
  if (mfa := _dict.get('mfa')) is not None:
5110
5196
  args['mfa'] = mfa
5111
5197
  if (user_mfa := _dict.get('user_mfa')) is not None:
5112
- args['user_mfa'] = [AccountSettingsUserMFA.from_dict(v) for v in user_mfa]
5198
+ args['user_mfa'] = [EffectiveAccountSettingsUserMFA.from_dict(v) for v in user_mfa]
5199
+ if (history := _dict.get('history')) is not None:
5200
+ args['history'] = [EnityHistoryRecord.from_dict(v) for v in history]
5113
5201
  if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None:
5114
5202
  args['session_expiration_in_seconds'] = session_expiration_in_seconds
5115
5203
  if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None:
@@ -5128,12 +5216,14 @@ class AccountSettingsComponent:
5128
5216
 
5129
5217
  @classmethod
5130
5218
  def _from_dict(cls, _dict):
5131
- """Initialize a AccountSettingsComponent object from a json dictionary."""
5219
+ """Initialize a AccountSettingsAccountSection object from a json dictionary."""
5132
5220
  return cls.from_dict(_dict)
5133
5221
 
5134
5222
  def to_dict(self) -> Dict:
5135
5223
  """Return a json dictionary representing this model."""
5136
5224
  _dict = {}
5225
+ if hasattr(self, 'account_id') and self.account_id is not None:
5226
+ _dict['account_id'] = self.account_id
5137
5227
  if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None:
5138
5228
  _dict['restrict_create_service_id'] = self.restrict_create_service_id
5139
5229
  if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None:
@@ -5150,6 +5240,14 @@ class AccountSettingsComponent:
5150
5240
  else:
5151
5241
  user_mfa_list.append(v.to_dict())
5152
5242
  _dict['user_mfa'] = user_mfa_list
5243
+ if hasattr(self, 'history') and self.history is not None:
5244
+ history_list = []
5245
+ for v in self.history:
5246
+ if isinstance(v, dict):
5247
+ history_list.append(v)
5248
+ else:
5249
+ history_list.append(v.to_dict())
5250
+ _dict['history'] = history_list
5153
5251
  if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None:
5154
5252
  _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds
5155
5253
  if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None:
@@ -5173,16 +5271,16 @@ class AccountSettingsComponent:
5173
5271
  return self.to_dict()
5174
5272
 
5175
5273
  def __str__(self) -> str:
5176
- """Return a `str` version of this AccountSettingsComponent object."""
5274
+ """Return a `str` version of this AccountSettingsAccountSection object."""
5177
5275
  return json.dumps(self.to_dict(), indent=2)
5178
5276
 
5179
- def __eq__(self, other: 'AccountSettingsComponent') -> bool:
5277
+ def __eq__(self, other: 'AccountSettingsAccountSection') -> bool:
5180
5278
  """Return `true` when self and other are equal, false otherwise."""
5181
5279
  if not isinstance(other, self.__class__):
5182
5280
  return False
5183
5281
  return self.__dict__ == other.__dict__
5184
5282
 
5185
- def __ne__(self, other: 'AccountSettingsComponent') -> bool:
5283
+ def __ne__(self, other: 'AccountSettingsAccountSection') -> bool:
5186
5284
  """Return `true` when self and other are not equal, false otherwise."""
5187
5285
  return not self == other
5188
5286
 
@@ -5214,7 +5312,7 @@ class AccountSettingsComponent:
5214
5312
 
5215
5313
  class MfaEnum(str, Enum):
5216
5314
  """
5217
- Defines the MFA trait for the account. Valid values:
5315
+ Defines the MFA requirement for the user. Valid values:
5218
5316
  * NONE - No MFA trait set
5219
5317
  * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5220
5318
  * TOTP - For all non-federated IBMId users
@@ -5233,28 +5331,28 @@ class AccountSettingsComponent:
5233
5331
  LEVEL3 = 'LEVEL3'
5234
5332
 
5235
5333
 
5236
- class AccountSettingsResponse:
5334
+ class AccountSettingsAssignedTemplatesSection:
5237
5335
  """
5238
- Response body format for Account Settings REST requests.
5336
+ AccountSettingsAssignedTemplatesSection.
5239
5337
 
5240
- :param ResponseContext context: (optional) Context with key properties for
5241
- problem determination.
5242
- :param str account_id: Unique ID of the account.
5243
- :param str restrict_create_service_id: Defines whether or not creating a service
5244
- ID is access controlled. Valid values:
5338
+ :param str template_id: (optional) Template Id.
5339
+ :param int template_version: (optional) Template version.
5340
+ :param str template_name: (optional) Template name.
5341
+ :param str restrict_create_service_id: (optional) Defines whether or not
5342
+ creating a service ID is access controlled. Valid values:
5245
5343
  * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
5246
5344
  Identity Service can create service IDs, including the account owner
5247
5345
  * NOT_RESTRICTED - all members of an account can create service IDs
5248
5346
  * NOT_SET - to 'unset' a previous set value.
5249
- :param str restrict_create_platform_apikey: Defines whether or not creating
5250
- platform API keys is access controlled. Valid values:
5347
+ :param str restrict_create_platform_apikey: (optional) Defines whether or not
5348
+ creating platform API keys is access controlled. Valid values:
5251
5349
  * RESTRICTED - to apply access control
5252
5350
  * NOT_RESTRICTED - to remove access control
5253
5351
  * NOT_SET - to 'unset' a previous set value.
5254
- :param str allowed_ip_addresses: Defines the IP addresses and subnets from which
5255
- IAM tokens can be created for the account.
5256
- :param str entity_tag: Version of the account settings.
5257
- :param str mfa: Defines the MFA trait for the account. Valid values:
5352
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets
5353
+ from which IAM tokens can be created for the account.
5354
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5355
+ values:
5258
5356
  * NONE - No MFA trait set
5259
5357
  * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5260
5358
  * TOTP - For all non-federated IBMId users
@@ -5262,69 +5360,69 @@ class AccountSettingsResponse:
5262
5360
  * LEVEL1 - Email-based MFA for all users
5263
5361
  * LEVEL2 - TOTP-based MFA for all users
5264
5362
  * LEVEL3 - U2F MFA for all users.
5265
- :param List[AccountSettingsUserMFA] user_mfa: List of users that are exempted
5266
- from the MFA requirement of the account.
5267
- :param List[EnityHistoryRecord] history: (optional) History of the Account
5268
- Settings.
5269
- :param str session_expiration_in_seconds: Defines the session expiration in
5270
- seconds for the account. Valid values:
5363
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of users
5364
+ that are exempted from the MFA requirement of the account.
5365
+ :param str session_expiration_in_seconds: (optional) Defines the session
5366
+ expiration in seconds for the account. Valid values:
5271
5367
  * Any whole number between between '900' and '86400'
5272
5368
  * NOT_SET - To unset account setting and use service default.
5273
- :param str session_invalidation_in_seconds: Defines the period of time in
5274
- seconds in which a session will be invalidated due to inactivity. Valid values:
5369
+ :param str session_invalidation_in_seconds: (optional) Defines the period of
5370
+ time in seconds in which a session will be invalidated due to inactivity. Valid
5371
+ values:
5275
5372
  * Any whole number between '900' and '7200'
5276
5373
  * NOT_SET - To unset account setting and use service default.
5277
- :param str max_sessions_per_identity: Defines the max allowed sessions per
5278
- identity required by the account. Valid values:
5374
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5375
+ sessions per identity required by the account. Valid values:
5279
5376
  * Any whole number greater than 0
5280
5377
  * NOT_SET - To unset account setting and use service default.
5281
- :param str system_access_token_expiration_in_seconds: Defines the access token
5282
- expiration in seconds. Valid values:
5378
+ :param str system_access_token_expiration_in_seconds: (optional) Defines the
5379
+ access token expiration in seconds. Valid values:
5283
5380
  * Any whole number between '900' and '3600'
5284
5381
  * NOT_SET - To unset account setting and use service default.
5285
- :param str system_refresh_token_expiration_in_seconds: Defines the refresh token
5286
- expiration in seconds. Valid values:
5382
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines the
5383
+ refresh token expiration in seconds. Valid values:
5287
5384
  * Any whole number between '900' and '259200'
5288
5385
  * NOT_SET - To unset account setting and use service default.
5289
5386
  """
5290
5387
 
5291
5388
  def __init__(
5292
5389
  self,
5293
- account_id: str,
5294
- restrict_create_service_id: str,
5295
- restrict_create_platform_apikey: str,
5296
- allowed_ip_addresses: str,
5297
- entity_tag: str,
5298
- mfa: str,
5299
- user_mfa: List['AccountSettingsUserMFA'],
5300
- session_expiration_in_seconds: str,
5301
- session_invalidation_in_seconds: str,
5302
- max_sessions_per_identity: str,
5303
- system_access_token_expiration_in_seconds: str,
5304
- system_refresh_token_expiration_in_seconds: str,
5305
5390
  *,
5306
- context: Optional['ResponseContext'] = None,
5307
- history: Optional[List['EnityHistoryRecord']] = None,
5391
+ template_id: Optional[str] = None,
5392
+ template_version: Optional[int] = None,
5393
+ template_name: Optional[str] = None,
5394
+ restrict_create_service_id: Optional[str] = None,
5395
+ restrict_create_platform_apikey: Optional[str] = None,
5396
+ allowed_ip_addresses: Optional[str] = None,
5397
+ mfa: Optional[str] = None,
5398
+ user_mfa: Optional[List['EffectiveAccountSettingsUserMFA']] = None,
5399
+ session_expiration_in_seconds: Optional[str] = None,
5400
+ session_invalidation_in_seconds: Optional[str] = None,
5401
+ max_sessions_per_identity: Optional[str] = None,
5402
+ system_access_token_expiration_in_seconds: Optional[str] = None,
5403
+ system_refresh_token_expiration_in_seconds: Optional[str] = None,
5308
5404
  ) -> None:
5309
5405
  """
5310
- Initialize a AccountSettingsResponse object.
5406
+ Initialize a AccountSettingsAssignedTemplatesSection object.
5311
5407
 
5312
- :param str account_id: Unique ID of the account.
5313
- :param str restrict_create_service_id: Defines whether or not creating a
5314
- service ID is access controlled. Valid values:
5408
+ :param str template_id: (optional) Template Id.
5409
+ :param int template_version: (optional) Template version.
5410
+ :param str template_name: (optional) Template name.
5411
+ :param str restrict_create_service_id: (optional) Defines whether or not
5412
+ creating a service ID is access controlled. Valid values:
5315
5413
  * RESTRICTED - only users assigned the 'Service ID creator' role on the
5316
5414
  IAM Identity Service can create service IDs, including the account owner
5317
5415
  * NOT_RESTRICTED - all members of an account can create service IDs
5318
5416
  * NOT_SET - to 'unset' a previous set value.
5319
- :param str restrict_create_platform_apikey: Defines whether or not creating
5320
- platform API keys is access controlled. Valid values:
5417
+ :param str restrict_create_platform_apikey: (optional) Defines whether or
5418
+ not creating platform API keys is access controlled. Valid values:
5321
5419
  * RESTRICTED - to apply access control
5322
5420
  * NOT_RESTRICTED - to remove access control
5323
5421
  * NOT_SET - to 'unset' a previous set value.
5324
- :param str allowed_ip_addresses: Defines the IP addresses and subnets from
5325
- which IAM tokens can be created for the account.
5326
- :param str entity_tag: Version of the account settings.
5327
- :param str mfa: Defines the MFA trait for the account. Valid values:
5422
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and
5423
+ subnets from which IAM tokens can be created for the account.
5424
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5425
+ values:
5328
5426
  * NONE - No MFA trait set
5329
5427
  * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5330
5428
  * TOTP - For all non-federated IBMId users
@@ -5332,43 +5430,38 @@ class AccountSettingsResponse:
5332
5430
  * LEVEL1 - Email-based MFA for all users
5333
5431
  * LEVEL2 - TOTP-based MFA for all users
5334
5432
  * LEVEL3 - U2F MFA for all users.
5335
- :param List[AccountSettingsUserMFA] user_mfa: List of users that are
5336
- exempted from the MFA requirement of the account.
5337
- :param str session_expiration_in_seconds: Defines the session expiration in
5338
- seconds for the account. Valid values:
5433
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of
5434
+ users that are exempted from the MFA requirement of the account.
5435
+ :param str session_expiration_in_seconds: (optional) Defines the session
5436
+ expiration in seconds for the account. Valid values:
5339
5437
  * Any whole number between between '900' and '86400'
5340
5438
  * NOT_SET - To unset account setting and use service default.
5341
- :param str session_invalidation_in_seconds: Defines the period of time in
5342
- seconds in which a session will be invalidated due to inactivity. Valid
5343
- values:
5439
+ :param str session_invalidation_in_seconds: (optional) Defines the period
5440
+ of time in seconds in which a session will be invalidated due to
5441
+ inactivity. Valid values:
5344
5442
  * Any whole number between '900' and '7200'
5345
5443
  * NOT_SET - To unset account setting and use service default.
5346
- :param str max_sessions_per_identity: Defines the max allowed sessions per
5347
- identity required by the account. Valid values:
5444
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5445
+ sessions per identity required by the account. Valid values:
5348
5446
  * Any whole number greater than 0
5349
5447
  * NOT_SET - To unset account setting and use service default.
5350
- :param str system_access_token_expiration_in_seconds: Defines the access
5351
- token expiration in seconds. Valid values:
5448
+ :param str system_access_token_expiration_in_seconds: (optional) Defines
5449
+ the access token expiration in seconds. Valid values:
5352
5450
  * Any whole number between '900' and '3600'
5353
5451
  * NOT_SET - To unset account setting and use service default.
5354
- :param str system_refresh_token_expiration_in_seconds: Defines the refresh
5355
- token expiration in seconds. Valid values:
5452
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines
5453
+ the refresh token expiration in seconds. Valid values:
5356
5454
  * Any whole number between '900' and '259200'
5357
5455
  * NOT_SET - To unset account setting and use service default.
5358
- :param ResponseContext context: (optional) Context with key properties for
5359
- problem determination.
5360
- :param List[EnityHistoryRecord] history: (optional) History of the Account
5361
- Settings.
5362
5456
  """
5363
- self.context = context
5364
- self.account_id = account_id
5457
+ self.template_id = template_id
5458
+ self.template_version = template_version
5459
+ self.template_name = template_name
5365
5460
  self.restrict_create_service_id = restrict_create_service_id
5366
5461
  self.restrict_create_platform_apikey = restrict_create_platform_apikey
5367
5462
  self.allowed_ip_addresses = allowed_ip_addresses
5368
- self.entity_tag = entity_tag
5369
5463
  self.mfa = mfa
5370
5464
  self.user_mfa = user_mfa
5371
- self.history = history
5372
5465
  self.session_expiration_in_seconds = session_expiration_in_seconds
5373
5466
  self.session_invalidation_in_seconds = session_invalidation_in_seconds
5374
5467
  self.max_sessions_per_identity = max_sessions_per_identity
@@ -5376,62 +5469,876 @@ class AccountSettingsResponse:
5376
5469
  self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds
5377
5470
 
5378
5471
  @classmethod
5379
- def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse':
5380
- """Initialize a AccountSettingsResponse object from a json dictionary."""
5472
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsAssignedTemplatesSection':
5473
+ """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary."""
5381
5474
  args = {}
5382
- if (context := _dict.get('context')) is not None:
5383
- args['context'] = ResponseContext.from_dict(context)
5384
- if (account_id := _dict.get('account_id')) is not None:
5385
- args['account_id'] = account_id
5386
- else:
5387
- raise ValueError('Required property \'account_id\' not present in AccountSettingsResponse JSON')
5475
+ if (template_id := _dict.get('template_id')) is not None:
5476
+ args['template_id'] = template_id
5477
+ if (template_version := _dict.get('template_version')) is not None:
5478
+ args['template_version'] = template_version
5479
+ if (template_name := _dict.get('template_name')) is not None:
5480
+ args['template_name'] = template_name
5388
5481
  if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None:
5389
5482
  args['restrict_create_service_id'] = restrict_create_service_id
5390
- else:
5391
- raise ValueError(
5392
- 'Required property \'restrict_create_service_id\' not present in AccountSettingsResponse JSON'
5393
- )
5394
5483
  if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None:
5395
5484
  args['restrict_create_platform_apikey'] = restrict_create_platform_apikey
5396
- else:
5397
- raise ValueError(
5398
- 'Required property \'restrict_create_platform_apikey\' not present in AccountSettingsResponse JSON'
5399
- )
5400
5485
  if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None:
5401
5486
  args['allowed_ip_addresses'] = allowed_ip_addresses
5402
- else:
5403
- raise ValueError('Required property \'allowed_ip_addresses\' not present in AccountSettingsResponse JSON')
5404
- if (entity_tag := _dict.get('entity_tag')) is not None:
5405
- args['entity_tag'] = entity_tag
5406
- else:
5407
- raise ValueError('Required property \'entity_tag\' not present in AccountSettingsResponse JSON')
5408
5487
  if (mfa := _dict.get('mfa')) is not None:
5409
5488
  args['mfa'] = mfa
5410
- else:
5411
- raise ValueError('Required property \'mfa\' not present in AccountSettingsResponse JSON')
5412
5489
  if (user_mfa := _dict.get('user_mfa')) is not None:
5413
- args['user_mfa'] = [AccountSettingsUserMFA.from_dict(v) for v in user_mfa]
5414
- else:
5415
- raise ValueError('Required property \'user_mfa\' not present in AccountSettingsResponse JSON')
5416
- if (history := _dict.get('history')) is not None:
5417
- args['history'] = [EnityHistoryRecord.from_dict(v) for v in history]
5490
+ args['user_mfa'] = [EffectiveAccountSettingsUserMFA.from_dict(v) for v in user_mfa]
5418
5491
  if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None:
5419
5492
  args['session_expiration_in_seconds'] = session_expiration_in_seconds
5420
- else:
5421
- raise ValueError(
5422
- 'Required property \'session_expiration_in_seconds\' not present in AccountSettingsResponse JSON'
5423
- )
5424
5493
  if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None:
5425
5494
  args['session_invalidation_in_seconds'] = session_invalidation_in_seconds
5426
- else:
5427
- raise ValueError(
5428
- 'Required property \'session_invalidation_in_seconds\' not present in AccountSettingsResponse JSON'
5429
- )
5430
5495
  if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None:
5431
5496
  args['max_sessions_per_identity'] = max_sessions_per_identity
5432
- else:
5433
- raise ValueError(
5434
- 'Required property \'max_sessions_per_identity\' not present in AccountSettingsResponse JSON'
5497
+ if (
5498
+ system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds')
5499
+ ) is not None:
5500
+ args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds
5501
+ if (
5502
+ system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds')
5503
+ ) is not None:
5504
+ args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds
5505
+ return cls(**args)
5506
+
5507
+ @classmethod
5508
+ def _from_dict(cls, _dict):
5509
+ """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary."""
5510
+ return cls.from_dict(_dict)
5511
+
5512
+ def to_dict(self) -> Dict:
5513
+ """Return a json dictionary representing this model."""
5514
+ _dict = {}
5515
+ if hasattr(self, 'template_id') and self.template_id is not None:
5516
+ _dict['template_id'] = self.template_id
5517
+ if hasattr(self, 'template_version') and self.template_version is not None:
5518
+ _dict['template_version'] = self.template_version
5519
+ if hasattr(self, 'template_name') and self.template_name is not None:
5520
+ _dict['template_name'] = self.template_name
5521
+ if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None:
5522
+ _dict['restrict_create_service_id'] = self.restrict_create_service_id
5523
+ if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None:
5524
+ _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey
5525
+ if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None:
5526
+ _dict['allowed_ip_addresses'] = self.allowed_ip_addresses
5527
+ if hasattr(self, 'mfa') and self.mfa is not None:
5528
+ _dict['mfa'] = self.mfa
5529
+ if hasattr(self, 'user_mfa') and self.user_mfa is not None:
5530
+ user_mfa_list = []
5531
+ for v in self.user_mfa:
5532
+ if isinstance(v, dict):
5533
+ user_mfa_list.append(v)
5534
+ else:
5535
+ user_mfa_list.append(v.to_dict())
5536
+ _dict['user_mfa'] = user_mfa_list
5537
+ if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None:
5538
+ _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds
5539
+ if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None:
5540
+ _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds
5541
+ if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None:
5542
+ _dict['max_sessions_per_identity'] = self.max_sessions_per_identity
5543
+ if (
5544
+ hasattr(self, 'system_access_token_expiration_in_seconds')
5545
+ and self.system_access_token_expiration_in_seconds is not None
5546
+ ):
5547
+ _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds
5548
+ if (
5549
+ hasattr(self, 'system_refresh_token_expiration_in_seconds')
5550
+ and self.system_refresh_token_expiration_in_seconds is not None
5551
+ ):
5552
+ _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds
5553
+ return _dict
5554
+
5555
+ def _to_dict(self):
5556
+ """Return a json dictionary representing this model."""
5557
+ return self.to_dict()
5558
+
5559
+ def __str__(self) -> str:
5560
+ """Return a `str` version of this AccountSettingsAssignedTemplatesSection object."""
5561
+ return json.dumps(self.to_dict(), indent=2)
5562
+
5563
+ def __eq__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool:
5564
+ """Return `true` when self and other are equal, false otherwise."""
5565
+ if not isinstance(other, self.__class__):
5566
+ return False
5567
+ return self.__dict__ == other.__dict__
5568
+
5569
+ def __ne__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool:
5570
+ """Return `true` when self and other are not equal, false otherwise."""
5571
+ return not self == other
5572
+
5573
+ class RestrictCreateServiceIdEnum(str, Enum):
5574
+ """
5575
+ Defines whether or not creating a service ID is access controlled. Valid values:
5576
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
5577
+ Identity Service can create service IDs, including the account owner
5578
+ * NOT_RESTRICTED - all members of an account can create service IDs
5579
+ * NOT_SET - to 'unset' a previous set value.
5580
+ """
5581
+
5582
+ RESTRICTED = 'RESTRICTED'
5583
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
5584
+ NOT_SET = 'NOT_SET'
5585
+
5586
+ class RestrictCreatePlatformApikeyEnum(str, Enum):
5587
+ """
5588
+ Defines whether or not creating platform API keys is access controlled. Valid
5589
+ values:
5590
+ * RESTRICTED - to apply access control
5591
+ * NOT_RESTRICTED - to remove access control
5592
+ * NOT_SET - to 'unset' a previous set value.
5593
+ """
5594
+
5595
+ RESTRICTED = 'RESTRICTED'
5596
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
5597
+ NOT_SET = 'NOT_SET'
5598
+
5599
+ class MfaEnum(str, Enum):
5600
+ """
5601
+ Defines the MFA requirement for the user. Valid values:
5602
+ * NONE - No MFA trait set
5603
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5604
+ * TOTP - For all non-federated IBMId users
5605
+ * TOTP4ALL - For all users
5606
+ * LEVEL1 - Email-based MFA for all users
5607
+ * LEVEL2 - TOTP-based MFA for all users
5608
+ * LEVEL3 - U2F MFA for all users.
5609
+ """
5610
+
5611
+ NONE = 'NONE'
5612
+ NONE_NO_ROPC = 'NONE_NO_ROPC'
5613
+ TOTP = 'TOTP'
5614
+ TOTP4ALL = 'TOTP4ALL'
5615
+ LEVEL1 = 'LEVEL1'
5616
+ LEVEL2 = 'LEVEL2'
5617
+ LEVEL3 = 'LEVEL3'
5618
+
5619
+
5620
+ class AccountSettingsComponent:
5621
+ """
5622
+ AccountSettingsComponent.
5623
+
5624
+ :param str restrict_create_service_id: (optional) Defines whether or not
5625
+ creating a service ID is access controlled. Valid values:
5626
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
5627
+ Identity Service can create service IDs, including the account owner
5628
+ * NOT_RESTRICTED - all members of an account can create service IDs
5629
+ * NOT_SET - to 'unset' a previous set value.
5630
+ :param str restrict_create_platform_apikey: (optional) Defines whether or not
5631
+ creating platform API keys is access controlled. Valid values:
5632
+ * RESTRICTED - to apply access control
5633
+ * NOT_RESTRICTED - to remove access control
5634
+ * NOT_SET - to 'unset' a previous set value.
5635
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets
5636
+ from which IAM tokens can be created for the account.
5637
+ :param str mfa: (optional) Defines the MFA trait for the account. Valid values:
5638
+ * NONE - No MFA trait set
5639
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5640
+ * TOTP - For all non-federated IBMId users
5641
+ * TOTP4ALL - For all users
5642
+ * LEVEL1 - Email-based MFA for all users
5643
+ * LEVEL2 - TOTP-based MFA for all users
5644
+ * LEVEL3 - U2F MFA for all users.
5645
+ :param List[AccountSettingsUserMFA] user_mfa: (optional) List of users that are
5646
+ exempted from the MFA requirement of the account.
5647
+ :param str session_expiration_in_seconds: (optional) Defines the session
5648
+ expiration in seconds for the account. Valid values:
5649
+ * Any whole number between between '900' and '86400'
5650
+ * NOT_SET - To unset account setting and use service default.
5651
+ :param str session_invalidation_in_seconds: (optional) Defines the period of
5652
+ time in seconds in which a session will be invalidated due to inactivity. Valid
5653
+ values:
5654
+ * Any whole number between '900' and '7200'
5655
+ * NOT_SET - To unset account setting and use service default.
5656
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5657
+ sessions per identity required by the account. Valid values:
5658
+ * Any whole number greater than 0
5659
+ * NOT_SET - To unset account setting and use service default.
5660
+ :param str system_access_token_expiration_in_seconds: (optional) Defines the
5661
+ access token expiration in seconds. Valid values:
5662
+ * Any whole number between '900' and '3600'
5663
+ * NOT_SET - To unset account setting and use service default.
5664
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines the
5665
+ refresh token expiration in seconds. Valid values:
5666
+ * Any whole number between '900' and '259200'
5667
+ * NOT_SET - To unset account setting and use service default.
5668
+ """
5669
+
5670
+ def __init__(
5671
+ self,
5672
+ *,
5673
+ restrict_create_service_id: Optional[str] = None,
5674
+ restrict_create_platform_apikey: Optional[str] = None,
5675
+ allowed_ip_addresses: Optional[str] = None,
5676
+ mfa: Optional[str] = None,
5677
+ user_mfa: Optional[List['AccountSettingsUserMFA']] = None,
5678
+ session_expiration_in_seconds: Optional[str] = None,
5679
+ session_invalidation_in_seconds: Optional[str] = None,
5680
+ max_sessions_per_identity: Optional[str] = None,
5681
+ system_access_token_expiration_in_seconds: Optional[str] = None,
5682
+ system_refresh_token_expiration_in_seconds: Optional[str] = None,
5683
+ ) -> None:
5684
+ """
5685
+ Initialize a AccountSettingsComponent object.
5686
+
5687
+ :param str restrict_create_service_id: (optional) Defines whether or not
5688
+ creating a service ID is access controlled. Valid values:
5689
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the
5690
+ IAM Identity Service can create service IDs, including the account owner
5691
+ * NOT_RESTRICTED - all members of an account can create service IDs
5692
+ * NOT_SET - to 'unset' a previous set value.
5693
+ :param str restrict_create_platform_apikey: (optional) Defines whether or
5694
+ not creating platform API keys is access controlled. Valid values:
5695
+ * RESTRICTED - to apply access control
5696
+ * NOT_RESTRICTED - to remove access control
5697
+ * NOT_SET - to 'unset' a previous set value.
5698
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and
5699
+ subnets from which IAM tokens can be created for the account.
5700
+ :param str mfa: (optional) Defines the MFA trait for the account. Valid
5701
+ values:
5702
+ * NONE - No MFA trait set
5703
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5704
+ * TOTP - For all non-federated IBMId users
5705
+ * TOTP4ALL - For all users
5706
+ * LEVEL1 - Email-based MFA for all users
5707
+ * LEVEL2 - TOTP-based MFA for all users
5708
+ * LEVEL3 - U2F MFA for all users.
5709
+ :param List[AccountSettingsUserMFA] user_mfa: (optional) List of users that
5710
+ are exempted from the MFA requirement of the account.
5711
+ :param str session_expiration_in_seconds: (optional) Defines the session
5712
+ expiration in seconds for the account. Valid values:
5713
+ * Any whole number between between '900' and '86400'
5714
+ * NOT_SET - To unset account setting and use service default.
5715
+ :param str session_invalidation_in_seconds: (optional) Defines the period
5716
+ of time in seconds in which a session will be invalidated due to
5717
+ inactivity. Valid values:
5718
+ * Any whole number between '900' and '7200'
5719
+ * NOT_SET - To unset account setting and use service default.
5720
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5721
+ sessions per identity required by the account. Valid values:
5722
+ * Any whole number greater than 0
5723
+ * NOT_SET - To unset account setting and use service default.
5724
+ :param str system_access_token_expiration_in_seconds: (optional) Defines
5725
+ the access token expiration in seconds. Valid values:
5726
+ * Any whole number between '900' and '3600'
5727
+ * NOT_SET - To unset account setting and use service default.
5728
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines
5729
+ the refresh token expiration in seconds. Valid values:
5730
+ * Any whole number between '900' and '259200'
5731
+ * NOT_SET - To unset account setting and use service default.
5732
+ """
5733
+ self.restrict_create_service_id = restrict_create_service_id
5734
+ self.restrict_create_platform_apikey = restrict_create_platform_apikey
5735
+ self.allowed_ip_addresses = allowed_ip_addresses
5736
+ self.mfa = mfa
5737
+ self.user_mfa = user_mfa
5738
+ self.session_expiration_in_seconds = session_expiration_in_seconds
5739
+ self.session_invalidation_in_seconds = session_invalidation_in_seconds
5740
+ self.max_sessions_per_identity = max_sessions_per_identity
5741
+ self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds
5742
+ self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds
5743
+
5744
+ @classmethod
5745
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsComponent':
5746
+ """Initialize a AccountSettingsComponent object from a json dictionary."""
5747
+ args = {}
5748
+ if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None:
5749
+ args['restrict_create_service_id'] = restrict_create_service_id
5750
+ if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None:
5751
+ args['restrict_create_platform_apikey'] = restrict_create_platform_apikey
5752
+ if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None:
5753
+ args['allowed_ip_addresses'] = allowed_ip_addresses
5754
+ if (mfa := _dict.get('mfa')) is not None:
5755
+ args['mfa'] = mfa
5756
+ if (user_mfa := _dict.get('user_mfa')) is not None:
5757
+ args['user_mfa'] = [AccountSettingsUserMFA.from_dict(v) for v in user_mfa]
5758
+ if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None:
5759
+ args['session_expiration_in_seconds'] = session_expiration_in_seconds
5760
+ if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None:
5761
+ args['session_invalidation_in_seconds'] = session_invalidation_in_seconds
5762
+ if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None:
5763
+ args['max_sessions_per_identity'] = max_sessions_per_identity
5764
+ if (
5765
+ system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds')
5766
+ ) is not None:
5767
+ args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds
5768
+ if (
5769
+ system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds')
5770
+ ) is not None:
5771
+ args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds
5772
+ return cls(**args)
5773
+
5774
+ @classmethod
5775
+ def _from_dict(cls, _dict):
5776
+ """Initialize a AccountSettingsComponent object from a json dictionary."""
5777
+ return cls.from_dict(_dict)
5778
+
5779
+ def to_dict(self) -> Dict:
5780
+ """Return a json dictionary representing this model."""
5781
+ _dict = {}
5782
+ if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None:
5783
+ _dict['restrict_create_service_id'] = self.restrict_create_service_id
5784
+ if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None:
5785
+ _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey
5786
+ if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None:
5787
+ _dict['allowed_ip_addresses'] = self.allowed_ip_addresses
5788
+ if hasattr(self, 'mfa') and self.mfa is not None:
5789
+ _dict['mfa'] = self.mfa
5790
+ if hasattr(self, 'user_mfa') and self.user_mfa is not None:
5791
+ user_mfa_list = []
5792
+ for v in self.user_mfa:
5793
+ if isinstance(v, dict):
5794
+ user_mfa_list.append(v)
5795
+ else:
5796
+ user_mfa_list.append(v.to_dict())
5797
+ _dict['user_mfa'] = user_mfa_list
5798
+ if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None:
5799
+ _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds
5800
+ if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None:
5801
+ _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds
5802
+ if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None:
5803
+ _dict['max_sessions_per_identity'] = self.max_sessions_per_identity
5804
+ if (
5805
+ hasattr(self, 'system_access_token_expiration_in_seconds')
5806
+ and self.system_access_token_expiration_in_seconds is not None
5807
+ ):
5808
+ _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds
5809
+ if (
5810
+ hasattr(self, 'system_refresh_token_expiration_in_seconds')
5811
+ and self.system_refresh_token_expiration_in_seconds is not None
5812
+ ):
5813
+ _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds
5814
+ return _dict
5815
+
5816
+ def _to_dict(self):
5817
+ """Return a json dictionary representing this model."""
5818
+ return self.to_dict()
5819
+
5820
+ def __str__(self) -> str:
5821
+ """Return a `str` version of this AccountSettingsComponent object."""
5822
+ return json.dumps(self.to_dict(), indent=2)
5823
+
5824
+ def __eq__(self, other: 'AccountSettingsComponent') -> bool:
5825
+ """Return `true` when self and other are equal, false otherwise."""
5826
+ if not isinstance(other, self.__class__):
5827
+ return False
5828
+ return self.__dict__ == other.__dict__
5829
+
5830
+ def __ne__(self, other: 'AccountSettingsComponent') -> bool:
5831
+ """Return `true` when self and other are not equal, false otherwise."""
5832
+ return not self == other
5833
+
5834
+ class RestrictCreateServiceIdEnum(str, Enum):
5835
+ """
5836
+ Defines whether or not creating a service ID is access controlled. Valid values:
5837
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
5838
+ Identity Service can create service IDs, including the account owner
5839
+ * NOT_RESTRICTED - all members of an account can create service IDs
5840
+ * NOT_SET - to 'unset' a previous set value.
5841
+ """
5842
+
5843
+ RESTRICTED = 'RESTRICTED'
5844
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
5845
+ NOT_SET = 'NOT_SET'
5846
+
5847
+ class RestrictCreatePlatformApikeyEnum(str, Enum):
5848
+ """
5849
+ Defines whether or not creating platform API keys is access controlled. Valid
5850
+ values:
5851
+ * RESTRICTED - to apply access control
5852
+ * NOT_RESTRICTED - to remove access control
5853
+ * NOT_SET - to 'unset' a previous set value.
5854
+ """
5855
+
5856
+ RESTRICTED = 'RESTRICTED'
5857
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
5858
+ NOT_SET = 'NOT_SET'
5859
+
5860
+ class MfaEnum(str, Enum):
5861
+ """
5862
+ Defines the MFA trait for the account. Valid values:
5863
+ * NONE - No MFA trait set
5864
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5865
+ * TOTP - For all non-federated IBMId users
5866
+ * TOTP4ALL - For all users
5867
+ * LEVEL1 - Email-based MFA for all users
5868
+ * LEVEL2 - TOTP-based MFA for all users
5869
+ * LEVEL3 - U2F MFA for all users.
5870
+ """
5871
+
5872
+ NONE = 'NONE'
5873
+ NONE_NO_ROPC = 'NONE_NO_ROPC'
5874
+ TOTP = 'TOTP'
5875
+ TOTP4ALL = 'TOTP4ALL'
5876
+ LEVEL1 = 'LEVEL1'
5877
+ LEVEL2 = 'LEVEL2'
5878
+ LEVEL3 = 'LEVEL3'
5879
+
5880
+
5881
+ class AccountSettingsEffectiveSection:
5882
+ """
5883
+ AccountSettingsEffectiveSection.
5884
+
5885
+ :param str restrict_create_service_id: (optional) Defines whether or not
5886
+ creating a service ID is access controlled. Valid values:
5887
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
5888
+ Identity Service can create service IDs, including the account owner
5889
+ * NOT_RESTRICTED - all members of an account can create service IDs
5890
+ * NOT_SET - to 'unset' a previous set value.
5891
+ :param str restrict_create_platform_apikey: (optional) Defines whether or not
5892
+ creating platform API keys is access controlled. Valid values:
5893
+ * RESTRICTED - to apply access control
5894
+ * NOT_RESTRICTED - to remove access control
5895
+ * NOT_SET - to 'unset' a previous set value.
5896
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets
5897
+ from which IAM tokens can be created for the account.
5898
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5899
+ values:
5900
+ * NONE - No MFA trait set
5901
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5902
+ * TOTP - For all non-federated IBMId users
5903
+ * TOTP4ALL - For all users
5904
+ * LEVEL1 - Email-based MFA for all users
5905
+ * LEVEL2 - TOTP-based MFA for all users
5906
+ * LEVEL3 - U2F MFA for all users.
5907
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of users
5908
+ that are exempted from the MFA requirement of the account.
5909
+ :param str session_expiration_in_seconds: (optional) Defines the session
5910
+ expiration in seconds for the account. Valid values:
5911
+ * Any whole number between between '900' and '86400'
5912
+ * NOT_SET - To unset account setting and use service default.
5913
+ :param str session_invalidation_in_seconds: (optional) Defines the period of
5914
+ time in seconds in which a session will be invalidated due to inactivity. Valid
5915
+ values:
5916
+ * Any whole number between '900' and '7200'
5917
+ * NOT_SET - To unset account setting and use service default.
5918
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5919
+ sessions per identity required by the account. Valid values:
5920
+ * Any whole number greater than 0
5921
+ * NOT_SET - To unset account setting and use service default.
5922
+ :param str system_access_token_expiration_in_seconds: (optional) Defines the
5923
+ access token expiration in seconds. Valid values:
5924
+ * Any whole number between '900' and '3600'
5925
+ * NOT_SET - To unset account setting and use service default.
5926
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines the
5927
+ refresh token expiration in seconds. Valid values:
5928
+ * Any whole number between '900' and '259200'
5929
+ * NOT_SET - To unset account setting and use service default.
5930
+ """
5931
+
5932
+ def __init__(
5933
+ self,
5934
+ *,
5935
+ restrict_create_service_id: Optional[str] = None,
5936
+ restrict_create_platform_apikey: Optional[str] = None,
5937
+ allowed_ip_addresses: Optional[str] = None,
5938
+ mfa: Optional[str] = None,
5939
+ user_mfa: Optional[List['EffectiveAccountSettingsUserMFA']] = None,
5940
+ session_expiration_in_seconds: Optional[str] = None,
5941
+ session_invalidation_in_seconds: Optional[str] = None,
5942
+ max_sessions_per_identity: Optional[str] = None,
5943
+ system_access_token_expiration_in_seconds: Optional[str] = None,
5944
+ system_refresh_token_expiration_in_seconds: Optional[str] = None,
5945
+ ) -> None:
5946
+ """
5947
+ Initialize a AccountSettingsEffectiveSection object.
5948
+
5949
+ :param str restrict_create_service_id: (optional) Defines whether or not
5950
+ creating a service ID is access controlled. Valid values:
5951
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the
5952
+ IAM Identity Service can create service IDs, including the account owner
5953
+ * NOT_RESTRICTED - all members of an account can create service IDs
5954
+ * NOT_SET - to 'unset' a previous set value.
5955
+ :param str restrict_create_platform_apikey: (optional) Defines whether or
5956
+ not creating platform API keys is access controlled. Valid values:
5957
+ * RESTRICTED - to apply access control
5958
+ * NOT_RESTRICTED - to remove access control
5959
+ * NOT_SET - to 'unset' a previous set value.
5960
+ :param str allowed_ip_addresses: (optional) Defines the IP addresses and
5961
+ subnets from which IAM tokens can be created for the account.
5962
+ :param str mfa: (optional) Defines the MFA requirement for the user. Valid
5963
+ values:
5964
+ * NONE - No MFA trait set
5965
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5966
+ * TOTP - For all non-federated IBMId users
5967
+ * TOTP4ALL - For all users
5968
+ * LEVEL1 - Email-based MFA for all users
5969
+ * LEVEL2 - TOTP-based MFA for all users
5970
+ * LEVEL3 - U2F MFA for all users.
5971
+ :param List[EffectiveAccountSettingsUserMFA] user_mfa: (optional) List of
5972
+ users that are exempted from the MFA requirement of the account.
5973
+ :param str session_expiration_in_seconds: (optional) Defines the session
5974
+ expiration in seconds for the account. Valid values:
5975
+ * Any whole number between between '900' and '86400'
5976
+ * NOT_SET - To unset account setting and use service default.
5977
+ :param str session_invalidation_in_seconds: (optional) Defines the period
5978
+ of time in seconds in which a session will be invalidated due to
5979
+ inactivity. Valid values:
5980
+ * Any whole number between '900' and '7200'
5981
+ * NOT_SET - To unset account setting and use service default.
5982
+ :param str max_sessions_per_identity: (optional) Defines the max allowed
5983
+ sessions per identity required by the account. Valid values:
5984
+ * Any whole number greater than 0
5985
+ * NOT_SET - To unset account setting and use service default.
5986
+ :param str system_access_token_expiration_in_seconds: (optional) Defines
5987
+ the access token expiration in seconds. Valid values:
5988
+ * Any whole number between '900' and '3600'
5989
+ * NOT_SET - To unset account setting and use service default.
5990
+ :param str system_refresh_token_expiration_in_seconds: (optional) Defines
5991
+ the refresh token expiration in seconds. Valid values:
5992
+ * Any whole number between '900' and '259200'
5993
+ * NOT_SET - To unset account setting and use service default.
5994
+ """
5995
+ self.restrict_create_service_id = restrict_create_service_id
5996
+ self.restrict_create_platform_apikey = restrict_create_platform_apikey
5997
+ self.allowed_ip_addresses = allowed_ip_addresses
5998
+ self.mfa = mfa
5999
+ self.user_mfa = user_mfa
6000
+ self.session_expiration_in_seconds = session_expiration_in_seconds
6001
+ self.session_invalidation_in_seconds = session_invalidation_in_seconds
6002
+ self.max_sessions_per_identity = max_sessions_per_identity
6003
+ self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds
6004
+ self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds
6005
+
6006
+ @classmethod
6007
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsEffectiveSection':
6008
+ """Initialize a AccountSettingsEffectiveSection object from a json dictionary."""
6009
+ args = {}
6010
+ if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None:
6011
+ args['restrict_create_service_id'] = restrict_create_service_id
6012
+ if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None:
6013
+ args['restrict_create_platform_apikey'] = restrict_create_platform_apikey
6014
+ if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None:
6015
+ args['allowed_ip_addresses'] = allowed_ip_addresses
6016
+ if (mfa := _dict.get('mfa')) is not None:
6017
+ args['mfa'] = mfa
6018
+ if (user_mfa := _dict.get('user_mfa')) is not None:
6019
+ args['user_mfa'] = [EffectiveAccountSettingsUserMFA.from_dict(v) for v in user_mfa]
6020
+ if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None:
6021
+ args['session_expiration_in_seconds'] = session_expiration_in_seconds
6022
+ if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None:
6023
+ args['session_invalidation_in_seconds'] = session_invalidation_in_seconds
6024
+ if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None:
6025
+ args['max_sessions_per_identity'] = max_sessions_per_identity
6026
+ if (
6027
+ system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds')
6028
+ ) is not None:
6029
+ args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds
6030
+ if (
6031
+ system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds')
6032
+ ) is not None:
6033
+ args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds
6034
+ return cls(**args)
6035
+
6036
+ @classmethod
6037
+ def _from_dict(cls, _dict):
6038
+ """Initialize a AccountSettingsEffectiveSection object from a json dictionary."""
6039
+ return cls.from_dict(_dict)
6040
+
6041
+ def to_dict(self) -> Dict:
6042
+ """Return a json dictionary representing this model."""
6043
+ _dict = {}
6044
+ if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None:
6045
+ _dict['restrict_create_service_id'] = self.restrict_create_service_id
6046
+ if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None:
6047
+ _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey
6048
+ if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None:
6049
+ _dict['allowed_ip_addresses'] = self.allowed_ip_addresses
6050
+ if hasattr(self, 'mfa') and self.mfa is not None:
6051
+ _dict['mfa'] = self.mfa
6052
+ if hasattr(self, 'user_mfa') and self.user_mfa is not None:
6053
+ user_mfa_list = []
6054
+ for v in self.user_mfa:
6055
+ if isinstance(v, dict):
6056
+ user_mfa_list.append(v)
6057
+ else:
6058
+ user_mfa_list.append(v.to_dict())
6059
+ _dict['user_mfa'] = user_mfa_list
6060
+ if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None:
6061
+ _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds
6062
+ if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None:
6063
+ _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds
6064
+ if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None:
6065
+ _dict['max_sessions_per_identity'] = self.max_sessions_per_identity
6066
+ if (
6067
+ hasattr(self, 'system_access_token_expiration_in_seconds')
6068
+ and self.system_access_token_expiration_in_seconds is not None
6069
+ ):
6070
+ _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds
6071
+ if (
6072
+ hasattr(self, 'system_refresh_token_expiration_in_seconds')
6073
+ and self.system_refresh_token_expiration_in_seconds is not None
6074
+ ):
6075
+ _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds
6076
+ return _dict
6077
+
6078
+ def _to_dict(self):
6079
+ """Return a json dictionary representing this model."""
6080
+ return self.to_dict()
6081
+
6082
+ def __str__(self) -> str:
6083
+ """Return a `str` version of this AccountSettingsEffectiveSection object."""
6084
+ return json.dumps(self.to_dict(), indent=2)
6085
+
6086
+ def __eq__(self, other: 'AccountSettingsEffectiveSection') -> bool:
6087
+ """Return `true` when self and other are equal, false otherwise."""
6088
+ if not isinstance(other, self.__class__):
6089
+ return False
6090
+ return self.__dict__ == other.__dict__
6091
+
6092
+ def __ne__(self, other: 'AccountSettingsEffectiveSection') -> bool:
6093
+ """Return `true` when self and other are not equal, false otherwise."""
6094
+ return not self == other
6095
+
6096
+ class RestrictCreateServiceIdEnum(str, Enum):
6097
+ """
6098
+ Defines whether or not creating a service ID is access controlled. Valid values:
6099
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
6100
+ Identity Service can create service IDs, including the account owner
6101
+ * NOT_RESTRICTED - all members of an account can create service IDs
6102
+ * NOT_SET - to 'unset' a previous set value.
6103
+ """
6104
+
6105
+ RESTRICTED = 'RESTRICTED'
6106
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
6107
+ NOT_SET = 'NOT_SET'
6108
+
6109
+ class RestrictCreatePlatformApikeyEnum(str, Enum):
6110
+ """
6111
+ Defines whether or not creating platform API keys is access controlled. Valid
6112
+ values:
6113
+ * RESTRICTED - to apply access control
6114
+ * NOT_RESTRICTED - to remove access control
6115
+ * NOT_SET - to 'unset' a previous set value.
6116
+ """
6117
+
6118
+ RESTRICTED = 'RESTRICTED'
6119
+ NOT_RESTRICTED = 'NOT_RESTRICTED'
6120
+ NOT_SET = 'NOT_SET'
6121
+
6122
+ class MfaEnum(str, Enum):
6123
+ """
6124
+ Defines the MFA requirement for the user. Valid values:
6125
+ * NONE - No MFA trait set
6126
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6127
+ * TOTP - For all non-federated IBMId users
6128
+ * TOTP4ALL - For all users
6129
+ * LEVEL1 - Email-based MFA for all users
6130
+ * LEVEL2 - TOTP-based MFA for all users
6131
+ * LEVEL3 - U2F MFA for all users.
6132
+ """
6133
+
6134
+ NONE = 'NONE'
6135
+ NONE_NO_ROPC = 'NONE_NO_ROPC'
6136
+ TOTP = 'TOTP'
6137
+ TOTP4ALL = 'TOTP4ALL'
6138
+ LEVEL1 = 'LEVEL1'
6139
+ LEVEL2 = 'LEVEL2'
6140
+ LEVEL3 = 'LEVEL3'
6141
+
6142
+
6143
+ class AccountSettingsResponse:
6144
+ """
6145
+ Response body format for Account Settings REST requests.
6146
+
6147
+ :param ResponseContext context: (optional) Context with key properties for
6148
+ problem determination.
6149
+ :param str account_id: Unique ID of the account.
6150
+ :param str restrict_create_service_id: Defines whether or not creating a service
6151
+ ID is access controlled. Valid values:
6152
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM
6153
+ Identity Service can create service IDs, including the account owner
6154
+ * NOT_RESTRICTED - all members of an account can create service IDs
6155
+ * NOT_SET - to 'unset' a previous set value.
6156
+ :param str restrict_create_platform_apikey: Defines whether or not creating
6157
+ platform API keys is access controlled. Valid values:
6158
+ * RESTRICTED - to apply access control
6159
+ * NOT_RESTRICTED - to remove access control
6160
+ * NOT_SET - to 'unset' a previous set value.
6161
+ :param str allowed_ip_addresses: Defines the IP addresses and subnets from which
6162
+ IAM tokens can be created for the account.
6163
+ :param str entity_tag: Version of the account settings.
6164
+ :param str mfa: Defines the MFA trait for the account. Valid values:
6165
+ * NONE - No MFA trait set
6166
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6167
+ * TOTP - For all non-federated IBMId users
6168
+ * TOTP4ALL - For all users
6169
+ * LEVEL1 - Email-based MFA for all users
6170
+ * LEVEL2 - TOTP-based MFA for all users
6171
+ * LEVEL3 - U2F MFA for all users.
6172
+ :param List[AccountSettingsUserMFA] user_mfa: List of users that are exempted
6173
+ from the MFA requirement of the account.
6174
+ :param List[EnityHistoryRecord] history: (optional) History of the Account
6175
+ Settings.
6176
+ :param str session_expiration_in_seconds: Defines the session expiration in
6177
+ seconds for the account. Valid values:
6178
+ * Any whole number between between '900' and '86400'
6179
+ * NOT_SET - To unset account setting and use service default.
6180
+ :param str session_invalidation_in_seconds: Defines the period of time in
6181
+ seconds in which a session will be invalidated due to inactivity. Valid values:
6182
+ * Any whole number between '900' and '7200'
6183
+ * NOT_SET - To unset account setting and use service default.
6184
+ :param str max_sessions_per_identity: Defines the max allowed sessions per
6185
+ identity required by the account. Valid values:
6186
+ * Any whole number greater than 0
6187
+ * NOT_SET - To unset account setting and use service default.
6188
+ :param str system_access_token_expiration_in_seconds: Defines the access token
6189
+ expiration in seconds. Valid values:
6190
+ * Any whole number between '900' and '3600'
6191
+ * NOT_SET - To unset account setting and use service default.
6192
+ :param str system_refresh_token_expiration_in_seconds: Defines the refresh token
6193
+ expiration in seconds. Valid values:
6194
+ * Any whole number between '900' and '259200'
6195
+ * NOT_SET - To unset account setting and use service default.
6196
+ """
6197
+
6198
+ def __init__(
6199
+ self,
6200
+ account_id: str,
6201
+ restrict_create_service_id: str,
6202
+ restrict_create_platform_apikey: str,
6203
+ allowed_ip_addresses: str,
6204
+ entity_tag: str,
6205
+ mfa: str,
6206
+ user_mfa: List['AccountSettingsUserMFA'],
6207
+ session_expiration_in_seconds: str,
6208
+ session_invalidation_in_seconds: str,
6209
+ max_sessions_per_identity: str,
6210
+ system_access_token_expiration_in_seconds: str,
6211
+ system_refresh_token_expiration_in_seconds: str,
6212
+ *,
6213
+ context: Optional['ResponseContext'] = None,
6214
+ history: Optional[List['EnityHistoryRecord']] = None,
6215
+ ) -> None:
6216
+ """
6217
+ Initialize a AccountSettingsResponse object.
6218
+
6219
+ :param str account_id: Unique ID of the account.
6220
+ :param str restrict_create_service_id: Defines whether or not creating a
6221
+ service ID is access controlled. Valid values:
6222
+ * RESTRICTED - only users assigned the 'Service ID creator' role on the
6223
+ IAM Identity Service can create service IDs, including the account owner
6224
+ * NOT_RESTRICTED - all members of an account can create service IDs
6225
+ * NOT_SET - to 'unset' a previous set value.
6226
+ :param str restrict_create_platform_apikey: Defines whether or not creating
6227
+ platform API keys is access controlled. Valid values:
6228
+ * RESTRICTED - to apply access control
6229
+ * NOT_RESTRICTED - to remove access control
6230
+ * NOT_SET - to 'unset' a previous set value.
6231
+ :param str allowed_ip_addresses: Defines the IP addresses and subnets from
6232
+ which IAM tokens can be created for the account.
6233
+ :param str entity_tag: Version of the account settings.
6234
+ :param str mfa: Defines the MFA trait for the account. Valid values:
6235
+ * NONE - No MFA trait set
6236
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6237
+ * TOTP - For all non-federated IBMId users
6238
+ * TOTP4ALL - For all users
6239
+ * LEVEL1 - Email-based MFA for all users
6240
+ * LEVEL2 - TOTP-based MFA for all users
6241
+ * LEVEL3 - U2F MFA for all users.
6242
+ :param List[AccountSettingsUserMFA] user_mfa: List of users that are
6243
+ exempted from the MFA requirement of the account.
6244
+ :param str session_expiration_in_seconds: Defines the session expiration in
6245
+ seconds for the account. Valid values:
6246
+ * Any whole number between between '900' and '86400'
6247
+ * NOT_SET - To unset account setting and use service default.
6248
+ :param str session_invalidation_in_seconds: Defines the period of time in
6249
+ seconds in which a session will be invalidated due to inactivity. Valid
6250
+ values:
6251
+ * Any whole number between '900' and '7200'
6252
+ * NOT_SET - To unset account setting and use service default.
6253
+ :param str max_sessions_per_identity: Defines the max allowed sessions per
6254
+ identity required by the account. Valid values:
6255
+ * Any whole number greater than 0
6256
+ * NOT_SET - To unset account setting and use service default.
6257
+ :param str system_access_token_expiration_in_seconds: Defines the access
6258
+ token expiration in seconds. Valid values:
6259
+ * Any whole number between '900' and '3600'
6260
+ * NOT_SET - To unset account setting and use service default.
6261
+ :param str system_refresh_token_expiration_in_seconds: Defines the refresh
6262
+ token expiration in seconds. Valid values:
6263
+ * Any whole number between '900' and '259200'
6264
+ * NOT_SET - To unset account setting and use service default.
6265
+ :param ResponseContext context: (optional) Context with key properties for
6266
+ problem determination.
6267
+ :param List[EnityHistoryRecord] history: (optional) History of the Account
6268
+ Settings.
6269
+ """
6270
+ self.context = context
6271
+ self.account_id = account_id
6272
+ self.restrict_create_service_id = restrict_create_service_id
6273
+ self.restrict_create_platform_apikey = restrict_create_platform_apikey
6274
+ self.allowed_ip_addresses = allowed_ip_addresses
6275
+ self.entity_tag = entity_tag
6276
+ self.mfa = mfa
6277
+ self.user_mfa = user_mfa
6278
+ self.history = history
6279
+ self.session_expiration_in_seconds = session_expiration_in_seconds
6280
+ self.session_invalidation_in_seconds = session_invalidation_in_seconds
6281
+ self.max_sessions_per_identity = max_sessions_per_identity
6282
+ self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds
6283
+ self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds
6284
+
6285
+ @classmethod
6286
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse':
6287
+ """Initialize a AccountSettingsResponse object from a json dictionary."""
6288
+ args = {}
6289
+ if (context := _dict.get('context')) is not None:
6290
+ args['context'] = ResponseContext.from_dict(context)
6291
+ if (account_id := _dict.get('account_id')) is not None:
6292
+ args['account_id'] = account_id
6293
+ else:
6294
+ raise ValueError('Required property \'account_id\' not present in AccountSettingsResponse JSON')
6295
+ if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None:
6296
+ args['restrict_create_service_id'] = restrict_create_service_id
6297
+ else:
6298
+ raise ValueError(
6299
+ 'Required property \'restrict_create_service_id\' not present in AccountSettingsResponse JSON'
6300
+ )
6301
+ if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None:
6302
+ args['restrict_create_platform_apikey'] = restrict_create_platform_apikey
6303
+ else:
6304
+ raise ValueError(
6305
+ 'Required property \'restrict_create_platform_apikey\' not present in AccountSettingsResponse JSON'
6306
+ )
6307
+ if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None:
6308
+ args['allowed_ip_addresses'] = allowed_ip_addresses
6309
+ else:
6310
+ raise ValueError('Required property \'allowed_ip_addresses\' not present in AccountSettingsResponse JSON')
6311
+ if (entity_tag := _dict.get('entity_tag')) is not None:
6312
+ args['entity_tag'] = entity_tag
6313
+ else:
6314
+ raise ValueError('Required property \'entity_tag\' not present in AccountSettingsResponse JSON')
6315
+ if (mfa := _dict.get('mfa')) is not None:
6316
+ args['mfa'] = mfa
6317
+ else:
6318
+ raise ValueError('Required property \'mfa\' not present in AccountSettingsResponse JSON')
6319
+ if (user_mfa := _dict.get('user_mfa')) is not None:
6320
+ args['user_mfa'] = [AccountSettingsUserMFA.from_dict(v) for v in user_mfa]
6321
+ else:
6322
+ raise ValueError('Required property \'user_mfa\' not present in AccountSettingsResponse JSON')
6323
+ if (history := _dict.get('history')) is not None:
6324
+ args['history'] = [EnityHistoryRecord.from_dict(v) for v in history]
6325
+ if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None:
6326
+ args['session_expiration_in_seconds'] = session_expiration_in_seconds
6327
+ else:
6328
+ raise ValueError(
6329
+ 'Required property \'session_expiration_in_seconds\' not present in AccountSettingsResponse JSON'
6330
+ )
6331
+ if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None:
6332
+ args['session_invalidation_in_seconds'] = session_invalidation_in_seconds
6333
+ else:
6334
+ raise ValueError(
6335
+ 'Required property \'session_invalidation_in_seconds\' not present in AccountSettingsResponse JSON'
6336
+ )
6337
+ if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None:
6338
+ args['max_sessions_per_identity'] = max_sessions_per_identity
6339
+ else:
6340
+ raise ValueError(
6341
+ 'Required property \'max_sessions_per_identity\' not present in AccountSettingsResponse JSON'
5435
6342
  )
5436
6343
  if (
5437
6344
  system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds')
@@ -5894,82 +6801,396 @@ class AccountSettingsTemplateResponse:
5894
6801
  return self.to_dict()
5895
6802
 
5896
6803
  def __str__(self) -> str:
5897
- """Return a `str` version of this AccountSettingsTemplateResponse object."""
6804
+ """Return a `str` version of this AccountSettingsTemplateResponse object."""
6805
+ return json.dumps(self.to_dict(), indent=2)
6806
+
6807
+ def __eq__(self, other: 'AccountSettingsTemplateResponse') -> bool:
6808
+ """Return `true` when self and other are equal, false otherwise."""
6809
+ if not isinstance(other, self.__class__):
6810
+ return False
6811
+ return self.__dict__ == other.__dict__
6812
+
6813
+ def __ne__(self, other: 'AccountSettingsTemplateResponse') -> bool:
6814
+ """Return `true` when self and other are not equal, false otherwise."""
6815
+ return not self == other
6816
+
6817
+
6818
+ class AccountSettingsUserMFA:
6819
+ """
6820
+ AccountSettingsUserMFA.
6821
+
6822
+ :param str iam_id: The iam_id of the user.
6823
+ :param str mfa: Defines the MFA requirement for the user. Valid values:
6824
+ * NONE - No MFA trait set
6825
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6826
+ * TOTP - For all non-federated IBMId users
6827
+ * TOTP4ALL - For all users
6828
+ * LEVEL1 - Email-based MFA for all users
6829
+ * LEVEL2 - TOTP-based MFA for all users
6830
+ * LEVEL3 - U2F MFA for all users.
6831
+ """
6832
+
6833
+ def __init__(
6834
+ self,
6835
+ iam_id: str,
6836
+ mfa: str,
6837
+ ) -> None:
6838
+ """
6839
+ Initialize a AccountSettingsUserMFA object.
6840
+
6841
+ :param str iam_id: The iam_id of the user.
6842
+ :param str mfa: Defines the MFA requirement for the user. Valid values:
6843
+ * NONE - No MFA trait set
6844
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6845
+ * TOTP - For all non-federated IBMId users
6846
+ * TOTP4ALL - For all users
6847
+ * LEVEL1 - Email-based MFA for all users
6848
+ * LEVEL2 - TOTP-based MFA for all users
6849
+ * LEVEL3 - U2F MFA for all users.
6850
+ """
6851
+ self.iam_id = iam_id
6852
+ self.mfa = mfa
6853
+
6854
+ @classmethod
6855
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserMFA':
6856
+ """Initialize a AccountSettingsUserMFA object from a json dictionary."""
6857
+ args = {}
6858
+ if (iam_id := _dict.get('iam_id')) is not None:
6859
+ args['iam_id'] = iam_id
6860
+ else:
6861
+ raise ValueError('Required property \'iam_id\' not present in AccountSettingsUserMFA JSON')
6862
+ if (mfa := _dict.get('mfa')) is not None:
6863
+ args['mfa'] = mfa
6864
+ else:
6865
+ raise ValueError('Required property \'mfa\' not present in AccountSettingsUserMFA JSON')
6866
+ return cls(**args)
6867
+
6868
+ @classmethod
6869
+ def _from_dict(cls, _dict):
6870
+ """Initialize a AccountSettingsUserMFA object from a json dictionary."""
6871
+ return cls.from_dict(_dict)
6872
+
6873
+ def to_dict(self) -> Dict:
6874
+ """Return a json dictionary representing this model."""
6875
+ _dict = {}
6876
+ if hasattr(self, 'iam_id') and self.iam_id is not None:
6877
+ _dict['iam_id'] = self.iam_id
6878
+ if hasattr(self, 'mfa') and self.mfa is not None:
6879
+ _dict['mfa'] = self.mfa
6880
+ return _dict
6881
+
6882
+ def _to_dict(self):
6883
+ """Return a json dictionary representing this model."""
6884
+ return self.to_dict()
6885
+
6886
+ def __str__(self) -> str:
6887
+ """Return a `str` version of this AccountSettingsUserMFA object."""
6888
+ return json.dumps(self.to_dict(), indent=2)
6889
+
6890
+ def __eq__(self, other: 'AccountSettingsUserMFA') -> bool:
6891
+ """Return `true` when self and other are equal, false otherwise."""
6892
+ if not isinstance(other, self.__class__):
6893
+ return False
6894
+ return self.__dict__ == other.__dict__
6895
+
6896
+ def __ne__(self, other: 'AccountSettingsUserMFA') -> bool:
6897
+ """Return `true` when self and other are not equal, false otherwise."""
6898
+ return not self == other
6899
+
6900
+ class MfaEnum(str, Enum):
6901
+ """
6902
+ Defines the MFA requirement for the user. Valid values:
6903
+ * NONE - No MFA trait set
6904
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
6905
+ * TOTP - For all non-federated IBMId users
6906
+ * TOTP4ALL - For all users
6907
+ * LEVEL1 - Email-based MFA for all users
6908
+ * LEVEL2 - TOTP-based MFA for all users
6909
+ * LEVEL3 - U2F MFA for all users.
6910
+ """
6911
+
6912
+ NONE = 'NONE'
6913
+ NONE_NO_ROPC = 'NONE_NO_ROPC'
6914
+ TOTP = 'TOTP'
6915
+ TOTP4ALL = 'TOTP4ALL'
6916
+ LEVEL1 = 'LEVEL1'
6917
+ LEVEL2 = 'LEVEL2'
6918
+ LEVEL3 = 'LEVEL3'
6919
+
6920
+
6921
+ class ActionControls:
6922
+ """
6923
+ ActionControls.
6924
+
6925
+ :param ActionControlsIdentities identities: (optional)
6926
+ :param ActionControlsRules rules:
6927
+ :param ActionControlsPolicies policies:
6928
+ """
6929
+
6930
+ def __init__(
6931
+ self,
6932
+ rules: 'ActionControlsRules',
6933
+ policies: 'ActionControlsPolicies',
6934
+ *,
6935
+ identities: Optional['ActionControlsIdentities'] = None,
6936
+ ) -> None:
6937
+ """
6938
+ Initialize a ActionControls object.
6939
+
6940
+ :param ActionControlsRules rules:
6941
+ :param ActionControlsPolicies policies:
6942
+ :param ActionControlsIdentities identities: (optional)
6943
+ """
6944
+ self.identities = identities
6945
+ self.rules = rules
6946
+ self.policies = policies
6947
+
6948
+ @classmethod
6949
+ def from_dict(cls, _dict: Dict) -> 'ActionControls':
6950
+ """Initialize a ActionControls object from a json dictionary."""
6951
+ args = {}
6952
+ if (identities := _dict.get('identities')) is not None:
6953
+ args['identities'] = ActionControlsIdentities.from_dict(identities)
6954
+ if (rules := _dict.get('rules')) is not None:
6955
+ args['rules'] = ActionControlsRules.from_dict(rules)
6956
+ else:
6957
+ raise ValueError('Required property \'rules\' not present in ActionControls JSON')
6958
+ if (policies := _dict.get('policies')) is not None:
6959
+ args['policies'] = ActionControlsPolicies.from_dict(policies)
6960
+ else:
6961
+ raise ValueError('Required property \'policies\' not present in ActionControls JSON')
6962
+ return cls(**args)
6963
+
6964
+ @classmethod
6965
+ def _from_dict(cls, _dict):
6966
+ """Initialize a ActionControls object from a json dictionary."""
6967
+ return cls.from_dict(_dict)
6968
+
6969
+ def to_dict(self) -> Dict:
6970
+ """Return a json dictionary representing this model."""
6971
+ _dict = {}
6972
+ if hasattr(self, 'identities') and self.identities is not None:
6973
+ if isinstance(self.identities, dict):
6974
+ _dict['identities'] = self.identities
6975
+ else:
6976
+ _dict['identities'] = self.identities.to_dict()
6977
+ if hasattr(self, 'rules') and self.rules is not None:
6978
+ if isinstance(self.rules, dict):
6979
+ _dict['rules'] = self.rules
6980
+ else:
6981
+ _dict['rules'] = self.rules.to_dict()
6982
+ if hasattr(self, 'policies') and self.policies is not None:
6983
+ if isinstance(self.policies, dict):
6984
+ _dict['policies'] = self.policies
6985
+ else:
6986
+ _dict['policies'] = self.policies.to_dict()
6987
+ return _dict
6988
+
6989
+ def _to_dict(self):
6990
+ """Return a json dictionary representing this model."""
6991
+ return self.to_dict()
6992
+
6993
+ def __str__(self) -> str:
6994
+ """Return a `str` version of this ActionControls object."""
6995
+ return json.dumps(self.to_dict(), indent=2)
6996
+
6997
+ def __eq__(self, other: 'ActionControls') -> bool:
6998
+ """Return `true` when self and other are equal, false otherwise."""
6999
+ if not isinstance(other, self.__class__):
7000
+ return False
7001
+ return self.__dict__ == other.__dict__
7002
+
7003
+ def __ne__(self, other: 'ActionControls') -> bool:
7004
+ """Return `true` when self and other are not equal, false otherwise."""
7005
+ return not self == other
7006
+
7007
+
7008
+ class ActionControlsIdentities:
7009
+ """
7010
+ ActionControlsIdentities.
7011
+
7012
+ :param bool add:
7013
+ :param bool remove:
7014
+ """
7015
+
7016
+ def __init__(
7017
+ self,
7018
+ add: bool,
7019
+ remove: bool,
7020
+ ) -> None:
7021
+ """
7022
+ Initialize a ActionControlsIdentities object.
7023
+
7024
+ :param bool add:
7025
+ :param bool remove:
7026
+ """
7027
+ self.add = add
7028
+ self.remove = remove
7029
+
7030
+ @classmethod
7031
+ def from_dict(cls, _dict: Dict) -> 'ActionControlsIdentities':
7032
+ """Initialize a ActionControlsIdentities object from a json dictionary."""
7033
+ args = {}
7034
+ if (add := _dict.get('add')) is not None:
7035
+ args['add'] = add
7036
+ else:
7037
+ raise ValueError('Required property \'add\' not present in ActionControlsIdentities JSON')
7038
+ if (remove := _dict.get('remove')) is not None:
7039
+ args['remove'] = remove
7040
+ else:
7041
+ raise ValueError('Required property \'remove\' not present in ActionControlsIdentities JSON')
7042
+ return cls(**args)
7043
+
7044
+ @classmethod
7045
+ def _from_dict(cls, _dict):
7046
+ """Initialize a ActionControlsIdentities object from a json dictionary."""
7047
+ return cls.from_dict(_dict)
7048
+
7049
+ def to_dict(self) -> Dict:
7050
+ """Return a json dictionary representing this model."""
7051
+ _dict = {}
7052
+ if hasattr(self, 'add') and self.add is not None:
7053
+ _dict['add'] = self.add
7054
+ if hasattr(self, 'remove') and self.remove is not None:
7055
+ _dict['remove'] = self.remove
7056
+ return _dict
7057
+
7058
+ def _to_dict(self):
7059
+ """Return a json dictionary representing this model."""
7060
+ return self.to_dict()
7061
+
7062
+ def __str__(self) -> str:
7063
+ """Return a `str` version of this ActionControlsIdentities object."""
7064
+ return json.dumps(self.to_dict(), indent=2)
7065
+
7066
+ def __eq__(self, other: 'ActionControlsIdentities') -> bool:
7067
+ """Return `true` when self and other are equal, false otherwise."""
7068
+ if not isinstance(other, self.__class__):
7069
+ return False
7070
+ return self.__dict__ == other.__dict__
7071
+
7072
+ def __ne__(self, other: 'ActionControlsIdentities') -> bool:
7073
+ """Return `true` when self and other are not equal, false otherwise."""
7074
+ return not self == other
7075
+
7076
+
7077
+ class ActionControlsPolicies:
7078
+ """
7079
+ ActionControlsPolicies.
7080
+
7081
+ :param bool add:
7082
+ :param bool remove:
7083
+ """
7084
+
7085
+ def __init__(
7086
+ self,
7087
+ add: bool,
7088
+ remove: bool,
7089
+ ) -> None:
7090
+ """
7091
+ Initialize a ActionControlsPolicies object.
7092
+
7093
+ :param bool add:
7094
+ :param bool remove:
7095
+ """
7096
+ self.add = add
7097
+ self.remove = remove
7098
+
7099
+ @classmethod
7100
+ def from_dict(cls, _dict: Dict) -> 'ActionControlsPolicies':
7101
+ """Initialize a ActionControlsPolicies object from a json dictionary."""
7102
+ args = {}
7103
+ if (add := _dict.get('add')) is not None:
7104
+ args['add'] = add
7105
+ else:
7106
+ raise ValueError('Required property \'add\' not present in ActionControlsPolicies JSON')
7107
+ if (remove := _dict.get('remove')) is not None:
7108
+ args['remove'] = remove
7109
+ else:
7110
+ raise ValueError('Required property \'remove\' not present in ActionControlsPolicies JSON')
7111
+ return cls(**args)
7112
+
7113
+ @classmethod
7114
+ def _from_dict(cls, _dict):
7115
+ """Initialize a ActionControlsPolicies object from a json dictionary."""
7116
+ return cls.from_dict(_dict)
7117
+
7118
+ def to_dict(self) -> Dict:
7119
+ """Return a json dictionary representing this model."""
7120
+ _dict = {}
7121
+ if hasattr(self, 'add') and self.add is not None:
7122
+ _dict['add'] = self.add
7123
+ if hasattr(self, 'remove') and self.remove is not None:
7124
+ _dict['remove'] = self.remove
7125
+ return _dict
7126
+
7127
+ def _to_dict(self):
7128
+ """Return a json dictionary representing this model."""
7129
+ return self.to_dict()
7130
+
7131
+ def __str__(self) -> str:
7132
+ """Return a `str` version of this ActionControlsPolicies object."""
5898
7133
  return json.dumps(self.to_dict(), indent=2)
5899
7134
 
5900
- def __eq__(self, other: 'AccountSettingsTemplateResponse') -> bool:
7135
+ def __eq__(self, other: 'ActionControlsPolicies') -> bool:
5901
7136
  """Return `true` when self and other are equal, false otherwise."""
5902
7137
  if not isinstance(other, self.__class__):
5903
7138
  return False
5904
7139
  return self.__dict__ == other.__dict__
5905
7140
 
5906
- def __ne__(self, other: 'AccountSettingsTemplateResponse') -> bool:
7141
+ def __ne__(self, other: 'ActionControlsPolicies') -> bool:
5907
7142
  """Return `true` when self and other are not equal, false otherwise."""
5908
7143
  return not self == other
5909
7144
 
5910
7145
 
5911
- class AccountSettingsUserMFA:
7146
+ class ActionControlsRules:
5912
7147
  """
5913
- AccountSettingsUserMFA.
7148
+ ActionControlsRules.
5914
7149
 
5915
- :param str iam_id: The iam_id of the user.
5916
- :param str mfa: Defines the MFA requirement for the user. Valid values:
5917
- * NONE - No MFA trait set
5918
- * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5919
- * TOTP - For all non-federated IBMId users
5920
- * TOTP4ALL - For all users
5921
- * LEVEL1 - Email-based MFA for all users
5922
- * LEVEL2 - TOTP-based MFA for all users
5923
- * LEVEL3 - U2F MFA for all users.
7150
+ :param bool add:
7151
+ :param bool remove:
5924
7152
  """
5925
7153
 
5926
7154
  def __init__(
5927
7155
  self,
5928
- iam_id: str,
5929
- mfa: str,
7156
+ add: bool,
7157
+ remove: bool,
5930
7158
  ) -> None:
5931
7159
  """
5932
- Initialize a AccountSettingsUserMFA object.
7160
+ Initialize a ActionControlsRules object.
5933
7161
 
5934
- :param str iam_id: The iam_id of the user.
5935
- :param str mfa: Defines the MFA requirement for the user. Valid values:
5936
- * NONE - No MFA trait set
5937
- * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5938
- * TOTP - For all non-federated IBMId users
5939
- * TOTP4ALL - For all users
5940
- * LEVEL1 - Email-based MFA for all users
5941
- * LEVEL2 - TOTP-based MFA for all users
5942
- * LEVEL3 - U2F MFA for all users.
7162
+ :param bool add:
7163
+ :param bool remove:
5943
7164
  """
5944
- self.iam_id = iam_id
5945
- self.mfa = mfa
7165
+ self.add = add
7166
+ self.remove = remove
5946
7167
 
5947
7168
  @classmethod
5948
- def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserMFA':
5949
- """Initialize a AccountSettingsUserMFA object from a json dictionary."""
7169
+ def from_dict(cls, _dict: Dict) -> 'ActionControlsRules':
7170
+ """Initialize a ActionControlsRules object from a json dictionary."""
5950
7171
  args = {}
5951
- if (iam_id := _dict.get('iam_id')) is not None:
5952
- args['iam_id'] = iam_id
7172
+ if (add := _dict.get('add')) is not None:
7173
+ args['add'] = add
5953
7174
  else:
5954
- raise ValueError('Required property \'iam_id\' not present in AccountSettingsUserMFA JSON')
5955
- if (mfa := _dict.get('mfa')) is not None:
5956
- args['mfa'] = mfa
7175
+ raise ValueError('Required property \'add\' not present in ActionControlsRules JSON')
7176
+ if (remove := _dict.get('remove')) is not None:
7177
+ args['remove'] = remove
5957
7178
  else:
5958
- raise ValueError('Required property \'mfa\' not present in AccountSettingsUserMFA JSON')
7179
+ raise ValueError('Required property \'remove\' not present in ActionControlsRules JSON')
5959
7180
  return cls(**args)
5960
7181
 
5961
7182
  @classmethod
5962
7183
  def _from_dict(cls, _dict):
5963
- """Initialize a AccountSettingsUserMFA object from a json dictionary."""
7184
+ """Initialize a ActionControlsRules object from a json dictionary."""
5964
7185
  return cls.from_dict(_dict)
5965
7186
 
5966
7187
  def to_dict(self) -> Dict:
5967
7188
  """Return a json dictionary representing this model."""
5968
7189
  _dict = {}
5969
- if hasattr(self, 'iam_id') and self.iam_id is not None:
5970
- _dict['iam_id'] = self.iam_id
5971
- if hasattr(self, 'mfa') and self.mfa is not None:
5972
- _dict['mfa'] = self.mfa
7190
+ if hasattr(self, 'add') and self.add is not None:
7191
+ _dict['add'] = self.add
7192
+ if hasattr(self, 'remove') and self.remove is not None:
7193
+ _dict['remove'] = self.remove
5973
7194
  return _dict
5974
7195
 
5975
7196
  def _to_dict(self):
@@ -5977,39 +7198,19 @@ class AccountSettingsUserMFA:
5977
7198
  return self.to_dict()
5978
7199
 
5979
7200
  def __str__(self) -> str:
5980
- """Return a `str` version of this AccountSettingsUserMFA object."""
7201
+ """Return a `str` version of this ActionControlsRules object."""
5981
7202
  return json.dumps(self.to_dict(), indent=2)
5982
7203
 
5983
- def __eq__(self, other: 'AccountSettingsUserMFA') -> bool:
7204
+ def __eq__(self, other: 'ActionControlsRules') -> bool:
5984
7205
  """Return `true` when self and other are equal, false otherwise."""
5985
7206
  if not isinstance(other, self.__class__):
5986
7207
  return False
5987
7208
  return self.__dict__ == other.__dict__
5988
7209
 
5989
- def __ne__(self, other: 'AccountSettingsUserMFA') -> bool:
7210
+ def __ne__(self, other: 'ActionControlsRules') -> bool:
5990
7211
  """Return `true` when self and other are not equal, false otherwise."""
5991
7212
  return not self == other
5992
7213
 
5993
- class MfaEnum(str, Enum):
5994
- """
5995
- Defines the MFA requirement for the user. Valid values:
5996
- * NONE - No MFA trait set
5997
- * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
5998
- * TOTP - For all non-federated IBMId users
5999
- * TOTP4ALL - For all users
6000
- * LEVEL1 - Email-based MFA for all users
6001
- * LEVEL2 - TOTP-based MFA for all users
6002
- * LEVEL3 - U2F MFA for all users.
6003
- """
6004
-
6005
- NONE = 'NONE'
6006
- NONE_NO_ROPC = 'NONE_NO_ROPC'
6007
- TOTP = 'TOTP'
6008
- TOTP4ALL = 'TOTP4ALL'
6009
- LEVEL1 = 'LEVEL1'
6010
- LEVEL2 = 'LEVEL2'
6011
- LEVEL3 = 'LEVEL3'
6012
-
6013
7214
 
6014
7215
  class Activity:
6015
7216
  """
@@ -6927,6 +8128,259 @@ class CreateProfileLinkRequestLink:
6927
8128
  return not self == other
6928
8129
 
6929
8130
 
8131
+ class EffectiveAccountSettingsResponse:
8132
+ """
8133
+ Response body format for Account Settings REST requests.
8134
+
8135
+ :param ResponseContext context: (optional) Context with key properties for
8136
+ problem determination.
8137
+ :param str account_id: Unique ID of the account.
8138
+ :param AccountSettingsEffectiveSection effective:
8139
+ :param AccountSettingsAccountSection account:
8140
+ :param List[AccountSettingsAssignedTemplatesSection] assigned_templates:
8141
+ (optional) assigned template section.
8142
+ """
8143
+
8144
+ def __init__(
8145
+ self,
8146
+ account_id: str,
8147
+ effective: 'AccountSettingsEffectiveSection',
8148
+ account: 'AccountSettingsAccountSection',
8149
+ *,
8150
+ context: Optional['ResponseContext'] = None,
8151
+ assigned_templates: Optional[List['AccountSettingsAssignedTemplatesSection']] = None,
8152
+ ) -> None:
8153
+ """
8154
+ Initialize a EffectiveAccountSettingsResponse object.
8155
+
8156
+ :param str account_id: Unique ID of the account.
8157
+ :param AccountSettingsEffectiveSection effective:
8158
+ :param AccountSettingsAccountSection account:
8159
+ :param ResponseContext context: (optional) Context with key properties for
8160
+ problem determination.
8161
+ :param List[AccountSettingsAssignedTemplatesSection] assigned_templates:
8162
+ (optional) assigned template section.
8163
+ """
8164
+ self.context = context
8165
+ self.account_id = account_id
8166
+ self.effective = effective
8167
+ self.account = account
8168
+ self.assigned_templates = assigned_templates
8169
+
8170
+ @classmethod
8171
+ def from_dict(cls, _dict: Dict) -> 'EffectiveAccountSettingsResponse':
8172
+ """Initialize a EffectiveAccountSettingsResponse object from a json dictionary."""
8173
+ args = {}
8174
+ if (context := _dict.get('context')) is not None:
8175
+ args['context'] = ResponseContext.from_dict(context)
8176
+ if (account_id := _dict.get('account_id')) is not None:
8177
+ args['account_id'] = account_id
8178
+ else:
8179
+ raise ValueError('Required property \'account_id\' not present in EffectiveAccountSettingsResponse JSON')
8180
+ if (effective := _dict.get('effective')) is not None:
8181
+ args['effective'] = AccountSettingsEffectiveSection.from_dict(effective)
8182
+ else:
8183
+ raise ValueError('Required property \'effective\' not present in EffectiveAccountSettingsResponse JSON')
8184
+ if (account := _dict.get('account')) is not None:
8185
+ args['account'] = AccountSettingsAccountSection.from_dict(account)
8186
+ else:
8187
+ raise ValueError('Required property \'account\' not present in EffectiveAccountSettingsResponse JSON')
8188
+ if (assigned_templates := _dict.get('assigned_templates')) is not None:
8189
+ args['assigned_templates'] = [
8190
+ AccountSettingsAssignedTemplatesSection.from_dict(v) for v in assigned_templates
8191
+ ]
8192
+ return cls(**args)
8193
+
8194
+ @classmethod
8195
+ def _from_dict(cls, _dict):
8196
+ """Initialize a EffectiveAccountSettingsResponse object from a json dictionary."""
8197
+ return cls.from_dict(_dict)
8198
+
8199
+ def to_dict(self) -> Dict:
8200
+ """Return a json dictionary representing this model."""
8201
+ _dict = {}
8202
+ if hasattr(self, 'context') and self.context is not None:
8203
+ if isinstance(self.context, dict):
8204
+ _dict['context'] = self.context
8205
+ else:
8206
+ _dict['context'] = self.context.to_dict()
8207
+ if hasattr(self, 'account_id') and self.account_id is not None:
8208
+ _dict['account_id'] = self.account_id
8209
+ if hasattr(self, 'effective') and self.effective is not None:
8210
+ if isinstance(self.effective, dict):
8211
+ _dict['effective'] = self.effective
8212
+ else:
8213
+ _dict['effective'] = self.effective.to_dict()
8214
+ if hasattr(self, 'account') and self.account is not None:
8215
+ if isinstance(self.account, dict):
8216
+ _dict['account'] = self.account
8217
+ else:
8218
+ _dict['account'] = self.account.to_dict()
8219
+ if hasattr(self, 'assigned_templates') and self.assigned_templates is not None:
8220
+ assigned_templates_list = []
8221
+ for v in self.assigned_templates:
8222
+ if isinstance(v, dict):
8223
+ assigned_templates_list.append(v)
8224
+ else:
8225
+ assigned_templates_list.append(v.to_dict())
8226
+ _dict['assigned_templates'] = assigned_templates_list
8227
+ return _dict
8228
+
8229
+ def _to_dict(self):
8230
+ """Return a json dictionary representing this model."""
8231
+ return self.to_dict()
8232
+
8233
+ def __str__(self) -> str:
8234
+ """Return a `str` version of this EffectiveAccountSettingsResponse object."""
8235
+ return json.dumps(self.to_dict(), indent=2)
8236
+
8237
+ def __eq__(self, other: 'EffectiveAccountSettingsResponse') -> bool:
8238
+ """Return `true` when self and other are equal, false otherwise."""
8239
+ if not isinstance(other, self.__class__):
8240
+ return False
8241
+ return self.__dict__ == other.__dict__
8242
+
8243
+ def __ne__(self, other: 'EffectiveAccountSettingsResponse') -> bool:
8244
+ """Return `true` when self and other are not equal, false otherwise."""
8245
+ return not self == other
8246
+
8247
+
8248
+ class EffectiveAccountSettingsUserMFA:
8249
+ """
8250
+ EffectiveAccountSettingsUserMFA.
8251
+
8252
+ :param str iam_id: The iam_id of the user.
8253
+ :param str mfa: Defines the MFA requirement for the user. Valid values:
8254
+ * NONE - No MFA trait set
8255
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
8256
+ * TOTP - For all non-federated IBMId users
8257
+ * TOTP4ALL - For all users
8258
+ * LEVEL1 - Email-based MFA for all users
8259
+ * LEVEL2 - TOTP-based MFA for all users
8260
+ * LEVEL3 - U2F MFA for all users.
8261
+ :param str name: (optional) name of the user account.
8262
+ :param str user_name: (optional) userName of the user.
8263
+ :param str email: (optional) email of the user.
8264
+ :param str description: (optional) optional description.
8265
+ """
8266
+
8267
+ def __init__(
8268
+ self,
8269
+ iam_id: str,
8270
+ mfa: str,
8271
+ *,
8272
+ name: Optional[str] = None,
8273
+ user_name: Optional[str] = None,
8274
+ email: Optional[str] = None,
8275
+ description: Optional[str] = None,
8276
+ ) -> None:
8277
+ """
8278
+ Initialize a EffectiveAccountSettingsUserMFA object.
8279
+
8280
+ :param str iam_id: The iam_id of the user.
8281
+ :param str mfa: Defines the MFA requirement for the user. Valid values:
8282
+ * NONE - No MFA trait set
8283
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
8284
+ * TOTP - For all non-federated IBMId users
8285
+ * TOTP4ALL - For all users
8286
+ * LEVEL1 - Email-based MFA for all users
8287
+ * LEVEL2 - TOTP-based MFA for all users
8288
+ * LEVEL3 - U2F MFA for all users.
8289
+ :param str name: (optional) name of the user account.
8290
+ :param str user_name: (optional) userName of the user.
8291
+ :param str email: (optional) email of the user.
8292
+ :param str description: (optional) optional description.
8293
+ """
8294
+ self.iam_id = iam_id
8295
+ self.mfa = mfa
8296
+ self.name = name
8297
+ self.user_name = user_name
8298
+ self.email = email
8299
+ self.description = description
8300
+
8301
+ @classmethod
8302
+ def from_dict(cls, _dict: Dict) -> 'EffectiveAccountSettingsUserMFA':
8303
+ """Initialize a EffectiveAccountSettingsUserMFA object from a json dictionary."""
8304
+ args = {}
8305
+ if (iam_id := _dict.get('iam_id')) is not None:
8306
+ args['iam_id'] = iam_id
8307
+ else:
8308
+ raise ValueError('Required property \'iam_id\' not present in EffectiveAccountSettingsUserMFA JSON')
8309
+ if (mfa := _dict.get('mfa')) is not None:
8310
+ args['mfa'] = mfa
8311
+ else:
8312
+ raise ValueError('Required property \'mfa\' not present in EffectiveAccountSettingsUserMFA JSON')
8313
+ if (name := _dict.get('name')) is not None:
8314
+ args['name'] = name
8315
+ if (user_name := _dict.get('userName')) is not None:
8316
+ args['user_name'] = user_name
8317
+ if (email := _dict.get('email')) is not None:
8318
+ args['email'] = email
8319
+ if (description := _dict.get('description')) is not None:
8320
+ args['description'] = description
8321
+ return cls(**args)
8322
+
8323
+ @classmethod
8324
+ def _from_dict(cls, _dict):
8325
+ """Initialize a EffectiveAccountSettingsUserMFA object from a json dictionary."""
8326
+ return cls.from_dict(_dict)
8327
+
8328
+ def to_dict(self) -> Dict:
8329
+ """Return a json dictionary representing this model."""
8330
+ _dict = {}
8331
+ if hasattr(self, 'iam_id') and self.iam_id is not None:
8332
+ _dict['iam_id'] = self.iam_id
8333
+ if hasattr(self, 'mfa') and self.mfa is not None:
8334
+ _dict['mfa'] = self.mfa
8335
+ if hasattr(self, 'name') and self.name is not None:
8336
+ _dict['name'] = self.name
8337
+ if hasattr(self, 'user_name') and self.user_name is not None:
8338
+ _dict['userName'] = self.user_name
8339
+ if hasattr(self, 'email') and self.email is not None:
8340
+ _dict['email'] = self.email
8341
+ if hasattr(self, 'description') and self.description is not None:
8342
+ _dict['description'] = self.description
8343
+ return _dict
8344
+
8345
+ def _to_dict(self):
8346
+ """Return a json dictionary representing this model."""
8347
+ return self.to_dict()
8348
+
8349
+ def __str__(self) -> str:
8350
+ """Return a `str` version of this EffectiveAccountSettingsUserMFA object."""
8351
+ return json.dumps(self.to_dict(), indent=2)
8352
+
8353
+ def __eq__(self, other: 'EffectiveAccountSettingsUserMFA') -> bool:
8354
+ """Return `true` when self and other are equal, false otherwise."""
8355
+ if not isinstance(other, self.__class__):
8356
+ return False
8357
+ return self.__dict__ == other.__dict__
8358
+
8359
+ def __ne__(self, other: 'EffectiveAccountSettingsUserMFA') -> bool:
8360
+ """Return `true` when self and other are not equal, false otherwise."""
8361
+ return not self == other
8362
+
8363
+ class MfaEnum(str, Enum):
8364
+ """
8365
+ Defines the MFA requirement for the user. Valid values:
8366
+ * NONE - No MFA trait set
8367
+ * NONE_NO_ROPC- No MFA, disable CLI logins with only a password
8368
+ * TOTP - For all non-federated IBMId users
8369
+ * TOTP4ALL - For all users
8370
+ * LEVEL1 - Email-based MFA for all users
8371
+ * LEVEL2 - TOTP-based MFA for all users
8372
+ * LEVEL3 - U2F MFA for all users.
8373
+ """
8374
+
8375
+ NONE = 'NONE'
8376
+ NONE_NO_ROPC = 'NONE_NO_ROPC'
8377
+ TOTP = 'TOTP'
8378
+ TOTP4ALL = 'TOTP4ALL'
8379
+ LEVEL1 = 'LEVEL1'
8380
+ LEVEL2 = 'LEVEL2'
8381
+ LEVEL3 = 'LEVEL3'
8382
+
8383
+
6930
8384
  class EnityHistoryRecord:
6931
8385
  """
6932
8386
  Response body format for an entity history record.
@@ -10915,6 +12369,7 @@ class TrustedProfileTemplateResponse:
10915
12369
  :param List[PolicyTemplateReference] policy_template_references: (optional)
10916
12370
  Existing policy templates that you can reference to assign access in the trusted
10917
12371
  profile component.
12372
+ :param ActionControls action_controls: (optional)
10918
12373
  :param List[EnityHistoryRecord] history: (optional) History of the trusted
10919
12374
  profile template.
10920
12375
  :param str entity_tag: (optional) Entity tag for this templateId-version
@@ -10939,6 +12394,7 @@ class TrustedProfileTemplateResponse:
10939
12394
  committed: Optional[bool] = None,
10940
12395
  profile: Optional['TemplateProfileComponentResponse'] = None,
10941
12396
  policy_template_references: Optional[List['PolicyTemplateReference']] = None,
12397
+ action_controls: Optional['ActionControls'] = None,
10942
12398
  history: Optional[List['EnityHistoryRecord']] = None,
10943
12399
  entity_tag: Optional[str] = None,
10944
12400
  crn: Optional[str] = None,
@@ -10964,6 +12420,7 @@ class TrustedProfileTemplateResponse:
10964
12420
  :param List[PolicyTemplateReference] policy_template_references: (optional)
10965
12421
  Existing policy templates that you can reference to assign access in the
10966
12422
  trusted profile component.
12423
+ :param ActionControls action_controls: (optional)
10967
12424
  :param List[EnityHistoryRecord] history: (optional) History of the trusted
10968
12425
  profile template.
10969
12426
  :param str entity_tag: (optional) Entity tag for this templateId-version
@@ -10985,6 +12442,7 @@ class TrustedProfileTemplateResponse:
10985
12442
  self.committed = committed
10986
12443
  self.profile = profile
10987
12444
  self.policy_template_references = policy_template_references
12445
+ self.action_controls = action_controls
10988
12446
  self.history = history
10989
12447
  self.entity_tag = entity_tag
10990
12448
  self.crn = crn
@@ -11023,6 +12481,8 @@ class TrustedProfileTemplateResponse:
11023
12481
  args['policy_template_references'] = [
11024
12482
  PolicyTemplateReference.from_dict(v) for v in policy_template_references
11025
12483
  ]
12484
+ if (action_controls := _dict.get('action_controls')) is not None:
12485
+ args['action_controls'] = ActionControls.from_dict(action_controls)
11026
12486
  if (history := _dict.get('history')) is not None:
11027
12487
  args['history'] = [EnityHistoryRecord.from_dict(v) for v in history]
11028
12488
  if (entity_tag := _dict.get('entity_tag')) is not None:
@@ -11072,6 +12532,11 @@ class TrustedProfileTemplateResponse:
11072
12532
  else:
11073
12533
  policy_template_references_list.append(v.to_dict())
11074
12534
  _dict['policy_template_references'] = policy_template_references_list
12535
+ if hasattr(self, 'action_controls') and self.action_controls is not None:
12536
+ if isinstance(self.action_controls, dict):
12537
+ _dict['action_controls'] = self.action_controls
12538
+ else:
12539
+ _dict['action_controls'] = self.action_controls.to_dict()
11075
12540
  if hasattr(self, 'history') and self.history is not None:
11076
12541
  history_list = []
11077
12542
  for v in self.history: