Skip to content

Commit d3175cf

Browse files
feat(Enterprise Management): re-gen service after update trait object (#209)
Signed-off-by: namratabhadauriya <[email protected]>
1 parent 4eae624 commit d3175cf

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

ibm_platform_services/enterprise_management_v1.py

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,10 @@ def create_account(
379379
:param str owner_iam_id: The IAM ID of the account owner, such as
380380
`IBMid-0123ABC`. The IAM ID must already exist.
381381
:param CreateAccountRequestTraits traits: (optional) The traits object can
382-
be used to opt-out of Multi-Factor Authentication setting when creating a
383-
child account in the enterprise. This is an optional field.
382+
be used to set properties on child accounts of an enterprise. You can pass
383+
a field to opt-out of Multi-Factor Authentication setting or setup
384+
enterprise IAM settings when creating a child account in the enterprise.
385+
This is an optional field.
384386
:param dict headers: A `dict` containing the request headers
385387
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
386388
:rtype: DetailedResponse with `dict` result representing a `CreateAccountResponse` object
@@ -1314,28 +1316,43 @@ def __ne__(self, other: 'CreateAccountGroupResponse') -> bool:
13141316

13151317
class CreateAccountRequestTraits:
13161318
"""
1317-
The traits object can be used to opt-out of Multi-Factor Authentication setting when
1318-
creating a child account in the enterprise. This is an optional field.
1319-
1320-
:attr str mfa: (optional) By default MFA will be set on the account. To opt out,
1321-
pass the traits object with the mfa field set to empty string.
1319+
The traits object can be used to set properties on child accounts of an enterprise.
1320+
You can pass a field to opt-out of Multi-Factor Authentication setting or setup
1321+
enterprise IAM settings when creating a child account in the enterprise. This is an
1322+
optional field.
1323+
1324+
:attr str mfa: (optional) By default MFA will be enabled on a child account. To
1325+
opt out, pass the traits object with the mfa field set to empty string. This is
1326+
an optional field.
1327+
:attr bool enterprise_iam_managed: (optional) The Enterprise IAM settings
1328+
property will be turned off for a newly created child account by default. You
1329+
can enable this property by passing 'true' in this boolean field. This is an
1330+
optional field.
13221331
"""
13231332

1324-
def __init__(self, *, mfa: str = None) -> None:
1333+
def __init__(self, *, mfa: str = None, enterprise_iam_managed: bool = None) -> None:
13251334
"""
13261335
Initialize a CreateAccountRequestTraits object.
13271336
1328-
:param str mfa: (optional) By default MFA will be set on the account. To
1329-
opt out, pass the traits object with the mfa field set to empty string.
1337+
:param str mfa: (optional) By default MFA will be enabled on a child
1338+
account. To opt out, pass the traits object with the mfa field set to empty
1339+
string. This is an optional field.
1340+
:param bool enterprise_iam_managed: (optional) The Enterprise IAM settings
1341+
property will be turned off for a newly created child account by default.
1342+
You can enable this property by passing 'true' in this boolean field. This
1343+
is an optional field.
13301344
"""
13311345
self.mfa = mfa
1346+
self.enterprise_iam_managed = enterprise_iam_managed
13321347

13331348
@classmethod
13341349
def from_dict(cls, _dict: Dict) -> 'CreateAccountRequestTraits':
13351350
"""Initialize a CreateAccountRequestTraits object from a json dictionary."""
13361351
args = {}
13371352
if 'mfa' in _dict:
13381353
args['mfa'] = _dict.get('mfa')
1354+
if 'enterprise_iam_managed' in _dict:
1355+
args['enterprise_iam_managed'] = _dict.get('enterprise_iam_managed')
13391356
return cls(**args)
13401357

13411358
@classmethod
@@ -1348,6 +1365,8 @@ def to_dict(self) -> Dict:
13481365
_dict = {}
13491366
if hasattr(self, 'mfa') and self.mfa is not None:
13501367
_dict['mfa'] = self.mfa
1368+
if hasattr(self, 'enterprise_iam_managed') and self.enterprise_iam_managed is not None:
1369+
_dict['enterprise_iam_managed'] = self.enterprise_iam_managed
13511370
return _dict
13521371

13531372
def _to_dict(self):

test/unit/test_enterprise_management_v1.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ def test_create_account_all_params(self):
614614
# Construct a dict representation of a CreateAccountRequestTraits model
615615
create_account_request_traits_model = {}
616616
create_account_request_traits_model['mfa'] = 'testString'
617+
create_account_request_traits_model['enterprise_iam_managed'] = True
617618

618619
# Set up parameter values
619620
parent = 'testString'
@@ -656,6 +657,7 @@ def test_create_account_value_error(self):
656657
# Construct a dict representation of a CreateAccountRequestTraits model
657658
create_account_request_traits_model = {}
658659
create_account_request_traits_model['mfa'] = 'testString'
660+
create_account_request_traits_model['enterprise_iam_managed'] = True
659661

660662
# Set up parameter values
661663
parent = 'testString'
@@ -1623,6 +1625,7 @@ def test_create_account_request_traits_serialization(self):
16231625
# Construct a json representation of a CreateAccountRequestTraits model
16241626
create_account_request_traits_model_json = {}
16251627
create_account_request_traits_model_json['mfa'] = 'testString'
1628+
create_account_request_traits_model_json['enterprise_iam_managed'] = True
16261629

16271630
# Construct a model instance of CreateAccountRequestTraits by calling from_dict on the json representation
16281631
create_account_request_traits_model = CreateAccountRequestTraits.from_dict(

0 commit comments

Comments
 (0)