Skip to content

Commit 40d7ae5

Browse files
fix(Enterprise Management): re-gen service after recent create_account api response changes (#255)
Signed-off-by: namratabhadauriya <[email protected]>
1 parent c69ee89 commit 40d7ae5

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

ibm_platform_services/enterprise_management_v1.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027
17+
# IBM OpenAPI SDK Code Generator Version: 3.89.1-ed9d96f4-20240417-193115
1818

1919
"""
2020
The Enterprise Management API enables you to create and manage an enterprise, account
@@ -1655,17 +1655,22 @@ class CreateAccountResponse:
16551655
"""
16561656
A newly-created account.
16571657
1658-
:attr str account_id: (optional) The ID of the account entity that was created.
1659-
:attr str iam_service_id: (optional) The iam_service_id of the account entity
1658+
:param str account_id: (optional) The ID of the account entity that was created.
1659+
:param str iam_service_id: (optional) The iam_service_id of the account entity
16601660
that was created.
1661-
:attr str iam_apikey_id: (optional) The iam_apikey_id of the account entity that
1662-
was created.
1663-
:attr str iam_apikey: (optional) The iam_apikey of the account entity with owner
1664-
iam policies that was created.
1661+
:param str iam_apikey_id: (optional) The iam_apikey_id of the account entity
1662+
that was created.
1663+
:param str iam_apikey: (optional) The iam_apikey of the account entity with
1664+
owner iam policies that was created.
16651665
"""
16661666

16671667
def __init__(
1668-
self, *, account_id: str = None, iam_service_id: str = None, iam_apikey_id: str = None, iam_apikey: str = None
1668+
self,
1669+
*,
1670+
account_id: Optional[str] = None,
1671+
iam_service_id: Optional[str] = None,
1672+
iam_apikey_id: Optional[str] = None,
1673+
iam_apikey: Optional[str] = None,
16691674
) -> None:
16701675
"""
16711676
Initialize a CreateAccountResponse object.
@@ -1688,14 +1693,14 @@ def __init__(
16881693
def from_dict(cls, _dict: Dict) -> 'CreateAccountResponse':
16891694
"""Initialize a CreateAccountResponse object from a json dictionary."""
16901695
args = {}
1691-
if 'account_id' in _dict:
1692-
args['account_id'] = _dict.get('account_id')
1693-
if 'iam_service_id' in _dict:
1694-
args['iam_service_id'] = _dict.get('iam_service_id')
1695-
if 'iam_apikey_id' in _dict:
1696-
args['iam_apikey_id'] = _dict.get('iam_apikey_id')
1697-
if 'iam_apikey' in _dict:
1698-
args['iam_apikey'] = _dict.get('iam_apikey')
1696+
if (account_id := _dict.get('account_id')) is not None:
1697+
args['account_id'] = account_id
1698+
if (iam_service_id := _dict.get('iam_service_id')) is not None:
1699+
args['iam_service_id'] = iam_service_id
1700+
if (iam_apikey_id := _dict.get('iam_apikey_id')) is not None:
1701+
args['iam_apikey_id'] = iam_apikey_id
1702+
if (iam_apikey := _dict.get('iam_apikey')) is not None:
1703+
args['iam_apikey'] = iam_apikey
16991704
return cls(**args)
17001705

17011706
@classmethod

test/unit/test_enterprise_management_v1.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def test_create_account_all_params(self):
706706
"""
707707
# Set up mock
708708
url = preprocess_url('/accounts')
709-
mock_response = '{"account_id": "account_id"}'
709+
mock_response = '{"account_id": "account_id", "iam_service_id": "iam_service_id", "iam_apikey_id": "iam_apikey_id", "iam_apikey": "iam_apikey"}'
710710
responses.add(
711711
responses.POST,
712712
url,
@@ -768,7 +768,7 @@ def test_create_account_value_error(self):
768768
"""
769769
# Set up mock
770770
url = preprocess_url('/accounts')
771-
mock_response = '{"account_id": "account_id"}'
771+
mock_response = '{"account_id": "account_id", "iam_service_id": "iam_service_id", "iam_apikey_id": "iam_apikey_id", "iam_apikey": "iam_apikey"}'
772772
responses.add(
773773
responses.POST,
774774
url,
@@ -1988,6 +1988,9 @@ def test_create_account_response_serialization(self):
19881988
# Construct a json representation of a CreateAccountResponse model
19891989
create_account_response_model_json = {}
19901990
create_account_response_model_json['account_id'] = 'testString'
1991+
create_account_response_model_json['iam_service_id'] = 'testString'
1992+
create_account_response_model_json['iam_apikey_id'] = 'testString'
1993+
create_account_response_model_json['iam_apikey'] = 'testString'
19911994

19921995
# Construct a model instance of CreateAccountResponse by calling from_dict on the json representation
19931996
create_account_response_model = CreateAccountResponse.from_dict(create_account_response_model_json)

0 commit comments

Comments
 (0)