From 1a4c91101603434e9722ec86046ec59f6c3592b9 Mon Sep 17 00:00:00 2001 From: Hari K Arla Date: Sun, 28 Jun 2026 21:00:44 +0530 Subject: [PATCH] feat(identity): enable IDP sharing Signed-off-by: Hari K Arla --- examples/test_iam_identity_v1_examples.py | 319 + ibm_platform_services/iam_identity_v1.py | 16556 ++++++++++++-------- test/integration/test_iam_identity_v1.py | 231 + test/unit/test_iam_identity_v1.py | 5210 +++++- 4 files changed, 15156 insertions(+), 7160 deletions(-) diff --git a/examples/test_iam_identity_v1_examples.py b/examples/test_iam_identity_v1_examples.py index c1a64496..925a9054 100644 --- a/examples/test_iam_identity_v1_examples.py +++ b/examples/test_iam_identity_v1_examples.py @@ -103,6 +103,9 @@ account_settings_template_assignment_etag = None account_settings_template_name = 'Python-SDK-Example-AccountSettings-Template-' + now +idp_id = None +idp_etag = None + iam_id_for_preferences = None @@ -1985,6 +1988,322 @@ def test_delete_account_settings_template(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_create_idp_example(self): + """ + create_idp request example + """ + try: + print('\ncreate_idp() result:') + # begin-create_idp + + create_idp_request_properties_idp_model = { + 'entity_id': 'http://www.okta.com/abcdefg', + 'redirect_binding_url': 'https://trial-12345.okta.com/app/trial-6789/abcdefg/sso/saml', + 'want_request_signed': True, + } + + create_idp_request_properties_sp_model = { + 'want_assertion_signed': True, + 'want_response_signed': True, + 'encrypt_response': True, + 'idp_initiated_login_enabled': True, + 'logout_url_enabled_when_available': True, + } + + create_idp_request_properties_model = { + 'idp': create_idp_request_properties_idp_model, + 'sp': create_idp_request_properties_sp_model, + } + + create_idp_request_secrets_model = { + 'idp': {}, + 'sp': {}, + } + + idp = iam_identity_service.create_idp( + account_id=account_id, + name='Python-SDK-Example-IdP', + type='saml', + active=True, + properties=create_idp_request_properties_model, + secrets=create_idp_request_secrets_model, + ).get_result() + print(json.dumps(idp, indent=2)) + + # end-create_idp + + global idp_id + idp_id = idp['idp_id'] + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_idps_example(self): + """ + list_idps request example + """ + try: + print('\nlist_idps() result:') + # begin-list_idps + + list_idps_response = iam_identity_service.list_idps( + account_id=account_id, + ).get_result() + print(json.dumps(list_idps_response, indent=2)) + + # end-list_idps + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_idp_example(self): + """ + get_idp request example + """ + try: + print('\nget_idp() result:') + # begin-get_idp + + response = iam_identity_service.get_idp(idp_id=idp_id) + idp = response.get_result() + print(json.dumps(idp, indent=2)) + + # end-get_idp + + global idp_etag + idp_etag = response.get_headers()['Etag'] + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_idp_example(self): + """ + update_idp request example + """ + try: + print('\nupdate_idp() result:') + # begin-update_idp + + update_idp_request_properties_idp_model = { + 'entity_id': 'http://www.okta.com/abcdefgijk', + 'redirect_binding_url': 'https://trial-12345.okta.com/app/trial-6789/abcdefgijk/sso/saml', + 'want_request_signed': False, + } + + update_idp_request_properties_sp_model = { + 'want_assertion_signed': False, + 'want_response_signed': False, + 'encrypt_response': True, + 'idp_initiated_login_enabled': False, + 'logout_url_enabled_when_available': True, + } + + update_idp_request_properties_model = { + 'idp': update_idp_request_properties_idp_model, + 'sp': update_idp_request_properties_sp_model, + } + + idp = iam_identity_service.update_idp( + idp_id=idp_id, + if_match=idp_etag, + ui_setup_completed=True, + active=True, + properties=update_idp_request_properties_model, + force_share_scope_update=True, + ).get_result() + print(json.dumps(idp, indent=2)) + + # end-update_idp + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_consumer_accounts_example(self): + """ + list_consumer_accounts request example + """ + try: + print('\nlist_consumer_accounts() result:') + # begin-list_consumer_accounts + + consumers_response = iam_identity_service.list_consumer_accounts( + idp_id=idp_id, + ).get_result() + print(json.dumps(consumers_response, indent=2)) + + # end-list_consumer_accounts + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_login_settings_example(self): + """ + get_login_settings request example + """ + try: + print('\nget_login_settings() result:') + # begin-get_login_settings + + account_login_settings = iam_identity_service.get_login_settings( + account_id=account_id, + ).get_result() + print(json.dumps(account_login_settings, indent=2)) + + # end-get_login_settings + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_login_settings_example(self): + """ + update_login_settings request example + """ + try: + print('\nupdate_login_settings() result:') + # begin-update_login_settings + + account_login_settings = iam_identity_service.update_login_settings( + account_id=account_id, + alias='my_alias_update_test', + ).get_result() + print(json.dumps(account_login_settings, indent=2)) + + # end-update_login_settings + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_id_p_settings_example(self): + """ + list_id_p_settings request example + """ + try: + print('\nlist_id_p_settings() result:') + # begin-list_idp_settings + + list_idp_settings_response = iam_identity_service.list_id_p_settings( + account_id=account_id, + type='consumable', + include_idp_metadata='true', + ).get_result() + print(json.dumps(list_idp_settings_response, indent=2)) + + # end-list_idp_settings + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_add_id_p_setting_example(self): + """ + add_id_p_setting request example + """ + try: + print('\nadd_id_p_setting() result:') + # begin-add_idp_setting + + account_idp_settings = iam_identity_service.add_id_p_setting( + account_id=account_id, + idp_id=idp_id, + cloud_user_strategy='STATIC', + active=True, + ui_default=True, + ).get_result() + print(json.dumps(account_idp_settings, indent=2)) + + # end-add_idp_setting + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_id_p_setting_example(self): + """ + get_id_p_setting request example + """ + try: + print('\nget_id_p_setting() result:') + # begin-get_idp_setting + + account_idp_settings = iam_identity_service.get_id_p_setting( + account_id=account_id, + idp_id=idp_id, + ).get_result() + print(json.dumps(account_idp_settings, indent=2)) + + # end-get_idp_setting + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_id_p_setting_example(self): + """ + update_id_p_setting request example + """ + try: + print('\nupdate_id_p_setting() result:') + # begin-update_idp_setting + + account_idp_settings = iam_identity_service.update_id_p_setting( + account_id=account_id, + idp_id=idp_id, + cloud_user_strategy='STATIC', + active=True, + ui_default=False, + ).get_result() + print(json.dumps(account_idp_settings, indent=2)) + + # end-update_idp_setting + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_remove_id_p_setting_example(self): + """ + remove_id_p_setting request example + """ + try: + # begin-remove_idp_setting + + response = iam_identity_service.remove_id_p_setting( + account_id=account_id, + idp_id=idp_id, + ) + + # end-remove_idp_setting + + print('\nremove_id_p_setting() response status code: ', response.get_status_code()) + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_idp_example(self): + """ + delete_idp request example + """ + try: + # begin-delete_idp + + response = iam_identity_service.delete_idp(idp_id=idp_id) + + # end-delete_idp + + print('\ndelete_idp() response status code: ', response.get_status_code()) + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_update_preference_on_scope_account(self): """ diff --git a/ibm_platform_services/iam_identity_v1.py b/ibm_platform_services/iam_identity_v1.py index fe7e9cfc..018d3b40 100644 --- a/ibm_platform_services/iam_identity_v1.py +++ b/ibm_platform_services/iam_identity_v1.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.113.1-d76630af-20260320-135953 +# IBM OpenAPI SDK Code Generator Version: 3.113.0-3f9df07a-20260317-160650 """ The IAM Identity Service API allows for the management of Account Settings and Identities @@ -25,7 +25,7 @@ from datetime import datetime from enum import Enum -from typing import Dict, List, Optional +from typing import BinaryIO, Dict, List, Optional, TextIO, Union import json from ibm_cloud_sdk_core import BaseService, DetailedResponse @@ -5608,707 +5608,5106 @@ def bulk_list_account_entity_consumption( response = self.send(request, **kwargs) return response + ######################### + # IDP Management + ######################### -class ListServiceIdsEnums: - """ - Enums for list_service_ids parameters. - """ - - class Order(str, Enum): + def list_idps( + self, + account_id: str, + *, + include_history: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: """ - Optional sort order, valid values are asc and desc. Default: asc. + List IdPs. + + :param str account_id: Account id to query. + :param str include_history: (optional) include history of the idp. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ListIdpsResponse` object """ - ASC = 'asc' - DESC = 'desc' + if not account_id: + raise ValueError('account_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_idps', + ) + headers.update(sdk_headers) + params = { + 'account_id': account_id, + 'include_history': include_history, + } -class ListApiKeysEnums: - """ - Enums for list_api_keys parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class Scope(str, Enum): - """ - Optional parameter to define the scope of the queried API keys. Can be 'entity' - (default) or 'account'. - """ + url = '/v1/idps/' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - ENTITY = 'entity' - ACCOUNT = 'account' + response = self.send(request, **kwargs) + return response - class Type(str, Enum): + def create_idp( + self, + account_id: str, + name: str, + type: str, + *, + active: Optional[bool] = None, + properties: Optional['CreateIdpRequestProperties'] = None, + secrets: Optional['CreateIdpRequestSecrets'] = None, + share_scope: Optional[List['ShareScope']] = None, + automation: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: """ - Optional parameter to filter the type of the queried API keys. Can be 'user' or - 'serviceid'. + Create IdP. + + :param str account_id: Account where the IdP resides in. + :param str name: Speaking name of the Identity Provider. + :param str type: Type of the IDP. + :param bool active: (optional) Defines if the IDP is active (enabled) for + all accounts (including those who consumed the IdP). Default during + creation is true. + :param CreateIdpRequestProperties properties: (optional) Properties of the + IDP. Will be stored plain-text. + :param CreateIdpRequestSecrets secrets: (optional) Secrets of the IDP. Will + be stored encrypted. + :param List[ShareScope] share_scope: (optional) List of targets which can + consume the IdP. + :param str automation: (optional) boolean to flag if IdP is created via + automation. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `Idp` object """ - USER = 'user' - SERVICEID = 'serviceid' + if account_id is None: + raise ValueError('account_id must be provided') + if name is None: + raise ValueError('name must be provided') + if type is None: + raise ValueError('type must be provided') + if properties is not None: + properties = convert_model(properties) + if secrets is not None: + secrets = convert_model(secrets) + if share_scope is not None: + share_scope = [convert_model(x) for x in share_scope] + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_idp', + ) + headers.update(sdk_headers) - class Order(str, Enum): - """ - Optional sort order, valid values are asc and desc. Default: asc. - """ + params = { + 'automation': automation, + } - ASC = 'asc' - DESC = 'desc' + data = { + 'account_id': account_id, + 'name': name, + 'type': type, + 'active': active, + 'properties': properties, + 'secrets': secrets, + 'share_scope': share_scope, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' -class ListProfilesEnums: - """ - Enums for list_profiles parameters. - """ + url = '/v1/idps/' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) - class Order(str, Enum): - """ - Optional sort order, valid values are asc and desc. Default: asc. - """ + response = self.send(request, **kwargs) + return response - ASC = 'asc' - DESC = 'desc' + def get_idp( + self, + idp_id: str, + *, + include_history: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Get IdP. + :param str idp_id: ID of the IDP. + :param str include_history: (optional) include history of the idp. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `Idp` object + """ -class SetProfileIdentityEnums: - """ - Enums for set_profile_identity parameters. - """ + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_idp', + ) + headers.update(sdk_headers) - class IdentityType(str, Enum): - """ - Type of the identity. - """ + params = { + 'include_history': include_history, + } - USER = 'user' - SERVICEID = 'serviceid' - CRN = 'crn' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) -class GetProfileIdentityEnums: - """ - Enums for get_profile_identity parameters. - """ + response = self.send(request, **kwargs) + return response - class IdentityType(str, Enum): + def update_idp( + self, + idp_id: str, + if_match: str, + *, + ui_setup_completed: Optional[bool] = None, + name: Optional[str] = None, + active: Optional[bool] = None, + properties: Optional['UpdateIdPRequestProperties'] = None, + secrets: Optional['UpdateIdPRequestSecrets'] = None, + share_scope: Optional[List['ShareScope']] = None, + force_share_scope_update: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: """ - Type of the identity. + Update IdP. + + :param str idp_id: ID of the IDP. + :param str if_match: Version of the account IdP settings to be updated. + Specify the version that you retrieved as entity_tag (ETag header) when + reading the account. This value helps identifying parallel usage of this + API. Pass * to indicate to update any version available. This might result + in stale updates. + :param bool ui_setup_completed: (optional) Defines if the IDP setup was + finished in the UI. + :param str name: (optional) Speaking name of the Identity Provider. + :param bool active: (optional) Defines if the IDP is active (enabled) for + all accounts (including those who consumed the IdP). + :param UpdateIdPRequestProperties properties: (optional) Properties of the + IDP. Will be stored plain-text. + :param UpdateIdPRequestSecrets secrets: (optional) Secrets of the IDP. Will + be stored encrypted. + :param List[ShareScope] share_scope: (optional) List of targets which can + consume the IdP. + :param bool force_share_scope_update: (optional) Enforces sharescope update + even if active consumers are removed from the share scope. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `Idp` object """ - USER = 'user' - SERVICEID = 'serviceid' - CRN = 'crn' - + if not idp_id: + raise ValueError('idp_id must be provided') + if not if_match: + raise ValueError('if_match must be provided') + if properties is not None: + properties = convert_model(properties) + if secrets is not None: + secrets = convert_model(secrets) + if share_scope is not None: + share_scope = [convert_model(x) for x in share_scope] + headers = { + 'If-Match': if_match, + } + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_idp', + ) + headers.update(sdk_headers) -class DeleteProfileIdentityEnums: - """ - Enums for delete_profile_identity parameters. - """ + params = { + 'force_share_scope_update': force_share_scope_update, + } - class IdentityType(str, Enum): - """ - Type of the identity. - """ + data = { + 'ui_setup_completed': ui_setup_completed, + 'name': name, + 'active': active, + 'properties': properties, + 'secrets': secrets, + 'share_scope': share_scope, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' - USER = 'user' - SERVICEID = 'serviceid' - CRN = 'crn' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) -class ListProfileTemplatesEnums: - """ - Enums for list_profile_templates parameters. - """ + response = self.send(request, **kwargs) + return response - class Sort(str, Enum): - """ - Optional sort property. If specified, the returned templates are sorted according - to this property. + def delete_idp( + self, + idp_id: str, + **kwargs, + ) -> DetailedResponse: """ + Delete IdP. - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' - NAME = 'name' - - class Order(str, Enum): - """ - Optional sort order. + :param str idp_id: ID of the IDP. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse """ - ASC = 'asc' - DESC = 'desc' + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_idp', + ) + headers.update(sdk_headers) + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] -class ListVersionsOfProfileTemplateEnums: - """ - Enums for list_versions_of_profile_template parameters. - """ - - class Sort(str, Enum): - """ - Optional sort property. If specified, the returned templated are sorted according - to this property. - """ + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + ) - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' - NAME = 'name' + response = self.send(request, **kwargs) + return response - class Order(str, Enum): - """ - Optional sort order. + def list_consumer_accounts( + self, + idp_id: str, + **kwargs, + ) -> DetailedResponse: """ + Get consumers of IdP. - ASC = 'asc' - DESC = 'desc' + :param str idp_id: ID of the IDP. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ConsumersResponse` object + """ + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_consumer_accounts', + ) + headers.update(sdk_headers) -class ListTrustedProfileAssignmentsEnums: - """ - Enums for list_trusted_profile_assignments parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class TargetType(str, Enum): - """ - Filter results by the assignment's target type. - """ + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}/consumers'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) - ACCOUNT = 'Account' - ACCOUNTGROUP = 'AccountGroup' + response = self.send(request, **kwargs) + return response - class Sort(str, Enum): - """ - If specified, the items are sorted by the value of this property. + def export_saml_metadata( + self, + idp_id: str, + **kwargs, + ) -> DetailedResponse: """ + Export SAML IdP metadata. - TEMPLATE_ID = 'template_id' - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' + Returns the Service Provider (SP) SAML metadata document for the specified + Identity Provider. + The generated metadata contains the SP entity ID, signing certificate, supported + NameID formats, and Assertion Consumer Service endpoints derived from the Identity + Provider configuration. - class Order(str, Enum): - """ - Sort order. + :param str idp_id: ID of the IDP. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `str` result """ - ASC = 'asc' - DESC = 'desc' + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='export_saml_metadata', + ) + headers.update(sdk_headers) + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'text/xml' -class ListAccountSettingsTemplatesEnums: - """ - Enums for list_account_settings_templates parameters. - """ + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}/saml/metadata'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) - class Sort(str, Enum): - """ - Optional sort property. If specified, the returned templated are sorted according - to this property. + response = self.send(request, **kwargs) + return response + + def import_saml_idp_metadata( + self, + idp_id: str, + body: Union[BinaryIO, str, TextIO], + *, + parse_only: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: """ + Import SAML IdP metadata. - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' - NAME = 'name' + Import a metadata.xml originating from the federated SAML Identity Provider. - class Order(str, Enum): - """ - Optional sort order. + :param str idp_id: ID of the IDP. + :param BinaryIO body: + :param bool parse_only: (optional) If true, validates and parses the + metadata without updating the Identity Provider. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `SamlMetadataImportResponse` object """ - ASC = 'asc' - DESC = 'desc' - + if not idp_id: + raise ValueError('idp_id must be provided') + if body is None: + raise ValueError('body must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='import_saml_idp_metadata', + ) + headers.update(sdk_headers) -class ListVersionsOfAccountSettingsTemplateEnums: - """ - Enums for list_versions_of_account_settings_template parameters. - """ + params = { + 'parse_only': parse_only, + } - class Sort(str, Enum): - """ - Optional sort property. If specified, the returned templated are sorted according - to this property. - """ + data = body + headers['content-type'] = 'text/xml' - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' - NAME = 'name' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class Order(str, Enum): - """ - Optional sort order. - """ + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}/saml/metadata'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) - ASC = 'asc' - DESC = 'desc' + response = self.send(request, **kwargs) + return response + def get_idp_test_result( + self, + idp_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Get IdP test results. -class ListAccountSettingsAssignmentsEnums: - """ - Enums for list_account_settings_assignments parameters. - """ + Get IDP test record. - class TargetType(str, Enum): - """ - Filter results by the assignment's target type. + :param str idp_id: ID of the IDP. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `TestResult` object """ - ACCOUNT = 'Account' - ACCOUNTGROUP = 'AccountGroup' + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_idp_test_result', + ) + headers.update(sdk_headers) - class Sort(str, Enum): - """ - If specified, the items are sorted by the value of this property. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - TEMPLATE_ID = 'template_id' - CREATED_AT = 'created_at' - LAST_MODIFIED_AT = 'last_modified_at' + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}/test'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) - class Order(str, Enum): - """ - Sort order. + response = self.send(request, **kwargs) + return response + + def test_idp( + self, + idp_id: str, + **kwargs, + ) -> DetailedResponse: """ + Trigger IdP configuration test. - ASC = 'asc' - DESC = 'desc' + :param str idp_id: ID of the IDP. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `TestTriggerResponse` object + """ + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='test_idp', + ) + headers.update(sdk_headers) -############################################################################## -# Models -############################################################################## + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + path_param_keys = ['idp_id'] + path_param_values = self.encode_path_vars(idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/idps/{idp_id}/test'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + ) -class AccessGroupCount: - """ - Claim rule count for a specific access group. + response = self.send(request, **kwargs) + return response - :param str group_id: (optional) Access group identifier. - :param int count: (optional) Number of claim rules for the access group. - """ + ######################### + # Account Settings for IdP + ######################### - def __init__( + def get_login_settings( self, - *, - group_id: Optional[str] = None, - count: Optional[int] = None, - ) -> None: + account_id: str, + **kwargs, + ) -> DetailedResponse: """ - Initialize a AccessGroupCount object. + Get account login settings. - :param str group_id: (optional) Access group identifier. - :param int count: (optional) Number of claim rules for the access group. + :param str account_id: Account which is bound to the alias. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `AccountLoginSettings` object """ - self.group_id = group_id - self.count = count - @classmethod - def from_dict(cls, _dict: Dict) -> 'AccessGroupCount': - """Initialize a AccessGroupCount object from a json dictionary.""" - args = {} - if (group_id := _dict.get('group_id')) is not None: - args['group_id'] = group_id - if (count := _dict.get('count')) is not None: - args['count'] = count - return cls(**args) + if not account_id: + raise ValueError('account_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_login_settings', + ) + headers.update(sdk_headers) - @classmethod - def _from_dict(cls, _dict): - """Initialize a AccessGroupCount object from a json dictionary.""" - return cls.from_dict(_dict) + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'group_id') and self.group_id is not None: - _dict['group_id'] = self.group_id - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count - return _dict + path_param_keys = ['account_id'] + path_param_values = self.encode_path_vars(account_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + response = self.send(request, **kwargs) + return response - def __str__(self) -> str: - """Return a `str` version of this AccessGroupCount object.""" - return json.dumps(self.to_dict(), indent=2) + def update_login_settings( + self, + account_id: str, + *, + alias: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Update account login settings. - def __eq__(self, other: 'AccessGroupCount') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + :param str account_id: Account which is bound to the alias. + :param str alias: (optional) Alias of the account. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `AccountLoginSettings` object + """ - def __ne__(self, other: 'AccessGroupCount') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + if not account_id: + raise ValueError('account_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_login_settings', + ) + headers.update(sdk_headers) + data = { + 'alias': alias, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' -class AccountBasedMfaEnrollment: - """ - AccountBasedMfaEnrollment. + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - :param MfaEnrollmentTypeStatus security_questions: - :param MfaEnrollmentTypeStatus totp: - :param MfaEnrollmentTypeStatus verisign: - :param bool complies: The enrollment complies to the effective requirement. - """ + path_param_keys = ['account_id'] + path_param_values = self.encode_path_vars(account_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) - def __init__( + response = self.send(request, **kwargs) + return response + + def list_id_p_settings( self, - security_questions: 'MfaEnrollmentTypeStatus', - totp: 'MfaEnrollmentTypeStatus', - verisign: 'MfaEnrollmentTypeStatus', - complies: bool, - ) -> None: + account_id: str, + type: str, + *, + include_idp_metadata: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: """ - Initialize a AccountBasedMfaEnrollment object. + List IdP Settings. - :param MfaEnrollmentTypeStatus security_questions: - :param MfaEnrollmentTypeStatus totp: - :param MfaEnrollmentTypeStatus verisign: - :param bool complies: The enrollment complies to the effective requirement. + :param str account_id: Account which is bound to the IDP. + :param str type: Type of IDP. + :param str include_idp_metadata: (optional) Flag if meta-information about + account and idp should be included. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ListIdPSettingsResponse` object """ - self.security_questions = security_questions - self.totp = totp - self.verisign = verisign - self.complies = complies - @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountBasedMfaEnrollment': - """Initialize a AccountBasedMfaEnrollment object from a json dictionary.""" - args = {} - if (security_questions := _dict.get('security_questions')) is not None: - args['security_questions'] = MfaEnrollmentTypeStatus.from_dict(security_questions) - else: - raise ValueError('Required property \'security_questions\' not present in AccountBasedMfaEnrollment JSON') - if (totp := _dict.get('totp')) is not None: - args['totp'] = MfaEnrollmentTypeStatus.from_dict(totp) - else: - raise ValueError('Required property \'totp\' not present in AccountBasedMfaEnrollment JSON') - if (verisign := _dict.get('verisign')) is not None: - args['verisign'] = MfaEnrollmentTypeStatus.from_dict(verisign) - else: - raise ValueError('Required property \'verisign\' not present in AccountBasedMfaEnrollment JSON') - if (complies := _dict.get('complies')) is not None: - args['complies'] = complies - else: - raise ValueError('Required property \'complies\' not present in AccountBasedMfaEnrollment JSON') - return cls(**args) + if not account_id: + raise ValueError('account_id must be provided') + if not type: + raise ValueError('type must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_id_p_settings', + ) + headers.update(sdk_headers) - @classmethod - def _from_dict(cls, _dict): - """Initialize a AccountBasedMfaEnrollment object from a json dictionary.""" - return cls.from_dict(_dict) + params = { + 'type': type, + 'include_idp_metadata': include_idp_metadata, + } - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'security_questions') and self.security_questions is not None: - if isinstance(self.security_questions, dict): - _dict['security_questions'] = self.security_questions - else: - _dict['security_questions'] = self.security_questions.to_dict() - if hasattr(self, 'totp') and self.totp is not None: - if isinstance(self.totp, dict): - _dict['totp'] = self.totp - else: - _dict['totp'] = self.totp.to_dict() - if hasattr(self, 'verisign') and self.verisign is not None: - if isinstance(self.verisign, dict): - _dict['verisign'] = self.verisign - else: - _dict['verisign'] = self.verisign.to_dict() - if hasattr(self, 'complies') and self.complies is not None: - _dict['complies'] = self.complies - return _dict + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + path_param_keys = ['account_id'] + path_param_values = self.encode_path_vars(account_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}/idps'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - def __str__(self) -> str: - """Return a `str` version of this AccountBasedMfaEnrollment object.""" - return json.dumps(self.to_dict(), indent=2) + response = self.send(request, **kwargs) + return response - def __eq__(self, other: 'AccountBasedMfaEnrollment') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + def get_id_p_setting( + self, + account_id: str, + idp_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Get IdP setting. - def __ne__(self, other: 'AccountBasedMfaEnrollment') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + :param str account_id: Account which is bound to the IDP. + :param str idp_id: Identity provider ID. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `AccountIdpSettings` object + """ + if not account_id: + raise ValueError('account_id must be provided') + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_id_p_setting', + ) + headers.update(sdk_headers) -class AccountSettingsAssignedTemplatesSection: - """ - Input body parameters for the Account Settings REST request. + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - :param str template_id: Template Id. - :param int template_version: Template version. - :param str template_name: Template name. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets - from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users + path_param_keys = ['account_id', 'idp_id'] + path_param_values = self.encode_path_vars(account_id, idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + + def add_id_p_setting( + self, + account_id: str, + idp_id: str, + cloud_user_strategy: str, + active: bool, + ui_default: bool, + **kwargs, + ) -> DetailedResponse: + """ + Add IdP Setting. + + :param str account_id: Account which is bound to the IDP. + :param str idp_id: Identity provider ID. + :param str cloud_user_strategy: Strategy how Cloud User representives for + the IdP users are handled. + :param bool active: Specifies if the IdP is enabled for usage in the given + account context. + :param bool ui_default: Specifies if the IdP is used as default in the + given account context. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `AccountIdpSettings` object + """ + + if not account_id: + raise ValueError('account_id must be provided') + if not idp_id: + raise ValueError('idp_id must be provided') + if cloud_user_strategy is None: + raise ValueError('cloud_user_strategy must be provided') + if active is None: + raise ValueError('active must be provided') + if ui_default is None: + raise ValueError('ui_default must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='add_id_p_setting', + ) + headers.update(sdk_headers) + + data = { + 'cloud_user_strategy': cloud_user_strategy, + 'active': active, + 'ui_default': ui_default, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['account_id', 'idp_id'] + path_param_values = self.encode_path_vars(account_id, idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def update_id_p_setting( + self, + account_id: str, + idp_id: str, + *, + cloud_user_strategy: Optional[str] = None, + active: Optional[bool] = None, + ui_default: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: + """ + Update IdP Setting. + + :param str account_id: Account which is bound to the IDP. + :param str idp_id: Identity provider ID. + :param str cloud_user_strategy: (optional) Strategy how Cloud User + representives for the IdP users are handled. + :param bool active: (optional) Specifies if the IdP is enabled for usage in + the given account context. + :param bool ui_default: (optional) Specifies if the IdP is used as default + in the given account context. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `AccountIdpSettings` object + """ + + if not account_id: + raise ValueError('account_id must be provided') + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_id_p_setting', + ) + headers.update(sdk_headers) + + data = { + 'cloud_user_strategy': cloud_user_strategy, + 'active': active, + 'ui_default': ui_default, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['account_id', 'idp_id'] + path_param_values = self.encode_path_vars(account_id, idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def remove_id_p_setting( + self, + account_id: str, + idp_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Remove IdP Setting. + + :param str account_id: Account which is bound to the IDP. + :param str idp_id: Identity provider ID. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not account_id: + raise ValueError('account_id must be provided') + if not idp_id: + raise ValueError('idp_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='remove_id_p_setting', + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['account_id', 'idp_id'] + path_param_values = self.encode_path_vars(account_id, idp_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v2/loginsettings/{account_id}/idps/{idp_id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + + +class ListServiceIdsEnums: + """ + Enums for list_service_ids parameters. + """ + + class Order(str, Enum): + """ + Optional sort order, valid values are asc and desc. Default: asc. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListApiKeysEnums: + """ + Enums for list_api_keys parameters. + """ + + class Scope(str, Enum): + """ + Optional parameter to define the scope of the queried API keys. Can be 'entity' + (default) or 'account'. + """ + + ENTITY = 'entity' + ACCOUNT = 'account' + + class Type(str, Enum): + """ + Optional parameter to filter the type of the queried API keys. Can be 'user' or + 'serviceid'. + """ + + USER = 'user' + SERVICEID = 'serviceid' + + class Order(str, Enum): + """ + Optional sort order, valid values are asc and desc. Default: asc. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListProfilesEnums: + """ + Enums for list_profiles parameters. + """ + + class Order(str, Enum): + """ + Optional sort order, valid values are asc and desc. Default: asc. + """ + + ASC = 'asc' + DESC = 'desc' + + +class SetProfileIdentityEnums: + """ + Enums for set_profile_identity parameters. + """ + + class IdentityType(str, Enum): + """ + Type of the identity. + """ + + USER = 'user' + SERVICEID = 'serviceid' + CRN = 'crn' + + +class GetProfileIdentityEnums: + """ + Enums for get_profile_identity parameters. + """ + + class IdentityType(str, Enum): + """ + Type of the identity. + """ + + USER = 'user' + SERVICEID = 'serviceid' + CRN = 'crn' + + +class DeleteProfileIdentityEnums: + """ + Enums for delete_profile_identity parameters. + """ + + class IdentityType(str, Enum): + """ + Type of the identity. + """ + + USER = 'user' + SERVICEID = 'serviceid' + CRN = 'crn' + + +class ListProfileTemplatesEnums: + """ + Enums for list_profile_templates parameters. + """ + + class Sort(str, Enum): + """ + Optional sort property. If specified, the returned templates are sorted according + to this property. + """ + + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + NAME = 'name' + + class Order(str, Enum): + """ + Optional sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListVersionsOfProfileTemplateEnums: + """ + Enums for list_versions_of_profile_template parameters. + """ + + class Sort(str, Enum): + """ + Optional sort property. If specified, the returned templated are sorted according + to this property. + """ + + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + NAME = 'name' + + class Order(str, Enum): + """ + Optional sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListTrustedProfileAssignmentsEnums: + """ + Enums for list_trusted_profile_assignments parameters. + """ + + class TargetType(str, Enum): + """ + Filter results by the assignment's target type. + """ + + ACCOUNT = 'Account' + ACCOUNTGROUP = 'AccountGroup' + + class Sort(str, Enum): + """ + If specified, the items are sorted by the value of this property. + """ + + TEMPLATE_ID = 'template_id' + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + + class Order(str, Enum): + """ + Sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListAccountSettingsTemplatesEnums: + """ + Enums for list_account_settings_templates parameters. + """ + + class Sort(str, Enum): + """ + Optional sort property. If specified, the returned templated are sorted according + to this property. + """ + + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + NAME = 'name' + + class Order(str, Enum): + """ + Optional sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListVersionsOfAccountSettingsTemplateEnums: + """ + Enums for list_versions_of_account_settings_template parameters. + """ + + class Sort(str, Enum): + """ + Optional sort property. If specified, the returned templated are sorted according + to this property. + """ + + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + NAME = 'name' + + class Order(str, Enum): + """ + Optional sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListAccountSettingsAssignmentsEnums: + """ + Enums for list_account_settings_assignments parameters. + """ + + class TargetType(str, Enum): + """ + Filter results by the assignment's target type. + """ + + ACCOUNT = 'Account' + ACCOUNTGROUP = 'AccountGroup' + + class Sort(str, Enum): + """ + If specified, the items are sorted by the value of this property. + """ + + TEMPLATE_ID = 'template_id' + CREATED_AT = 'created_at' + LAST_MODIFIED_AT = 'last_modified_at' + + class Order(str, Enum): + """ + Sort order. + """ + + ASC = 'asc' + DESC = 'desc' + + +class ListIdPSettingsEnums: + """ + Enums for list_id_p_settings parameters. + """ + + class Type(str, Enum): + """ + Type of IDP. + """ + + CONSUMABLE = 'consumable' + CONSUMED = 'consumed' + + +############################################################################## +# Models +############################################################################## + + +class AccessGroupCount: + """ + Claim rule count for a specific access group. + + :param str group_id: (optional) Access group identifier. + :param int count: (optional) Number of claim rules for the access group. + """ + + def __init__( + self, + *, + group_id: Optional[str] = None, + count: Optional[int] = None, + ) -> None: + """ + Initialize a AccessGroupCount object. + + :param str group_id: (optional) Access group identifier. + :param int count: (optional) Number of claim rules for the access group. + """ + self.group_id = group_id + self.count = count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccessGroupCount': + """Initialize a AccessGroupCount object from a json dictionary.""" + args = {} + if (group_id := _dict.get('group_id')) is not None: + args['group_id'] = group_id + if (count := _dict.get('count')) is not None: + args['count'] = count + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccessGroupCount object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'group_id') and self.group_id is not None: + _dict['group_id'] = self.group_id + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccessGroupCount object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccessGroupCount') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccessGroupCount') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountBasedMfaEnrollment: + """ + AccountBasedMfaEnrollment. + + :param MfaEnrollmentTypeStatus security_questions: + :param MfaEnrollmentTypeStatus totp: + :param MfaEnrollmentTypeStatus verisign: + :param bool complies: The enrollment complies to the effective requirement. + """ + + def __init__( + self, + security_questions: 'MfaEnrollmentTypeStatus', + totp: 'MfaEnrollmentTypeStatus', + verisign: 'MfaEnrollmentTypeStatus', + complies: bool, + ) -> None: + """ + Initialize a AccountBasedMfaEnrollment object. + + :param MfaEnrollmentTypeStatus security_questions: + :param MfaEnrollmentTypeStatus totp: + :param MfaEnrollmentTypeStatus verisign: + :param bool complies: The enrollment complies to the effective requirement. + """ + self.security_questions = security_questions + self.totp = totp + self.verisign = verisign + self.complies = complies + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountBasedMfaEnrollment': + """Initialize a AccountBasedMfaEnrollment object from a json dictionary.""" + args = {} + if (security_questions := _dict.get('security_questions')) is not None: + args['security_questions'] = MfaEnrollmentTypeStatus.from_dict(security_questions) + else: + raise ValueError('Required property \'security_questions\' not present in AccountBasedMfaEnrollment JSON') + if (totp := _dict.get('totp')) is not None: + args['totp'] = MfaEnrollmentTypeStatus.from_dict(totp) + else: + raise ValueError('Required property \'totp\' not present in AccountBasedMfaEnrollment JSON') + if (verisign := _dict.get('verisign')) is not None: + args['verisign'] = MfaEnrollmentTypeStatus.from_dict(verisign) + else: + raise ValueError('Required property \'verisign\' not present in AccountBasedMfaEnrollment JSON') + if (complies := _dict.get('complies')) is not None: + args['complies'] = complies + else: + raise ValueError('Required property \'complies\' not present in AccountBasedMfaEnrollment JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountBasedMfaEnrollment object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'security_questions') and self.security_questions is not None: + if isinstance(self.security_questions, dict): + _dict['security_questions'] = self.security_questions + else: + _dict['security_questions'] = self.security_questions.to_dict() + if hasattr(self, 'totp') and self.totp is not None: + if isinstance(self.totp, dict): + _dict['totp'] = self.totp + else: + _dict['totp'] = self.totp.to_dict() + if hasattr(self, 'verisign') and self.verisign is not None: + if isinstance(self.verisign, dict): + _dict['verisign'] = self.verisign + else: + _dict['verisign'] = self.verisign.to_dict() + if hasattr(self, 'complies') and self.complies is not None: + _dict['complies'] = self.complies + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountBasedMfaEnrollment object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountBasedMfaEnrollment') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountBasedMfaEnrollment') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountIdpSettings: + """ + AccountIdpSettings. + + :param str idp_id: (optional) + :param str owner_account: (optional) + :param str owner_account_name: (optional) + :param str idp_name: (optional) + :param str idp_type: (optional) + :param str cloud_user_strategy: (optional) + :param bool active: (optional) + :param bool ui_default: (optional) + """ + + def __init__( + self, + *, + idp_id: Optional[str] = None, + owner_account: Optional[str] = None, + owner_account_name: Optional[str] = None, + idp_name: Optional[str] = None, + idp_type: Optional[str] = None, + cloud_user_strategy: Optional[str] = None, + active: Optional[bool] = None, + ui_default: Optional[bool] = None, + ) -> None: + """ + Initialize a AccountIdpSettings object. + + :param str idp_id: (optional) + :param str owner_account: (optional) + :param str owner_account_name: (optional) + :param str idp_name: (optional) + :param str idp_type: (optional) + :param str cloud_user_strategy: (optional) + :param bool active: (optional) + :param bool ui_default: (optional) + """ + self.idp_id = idp_id + self.owner_account = owner_account + self.owner_account_name = owner_account_name + self.idp_name = idp_name + self.idp_type = idp_type + self.cloud_user_strategy = cloud_user_strategy + self.active = active + self.ui_default = ui_default + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountIdpSettings': + """Initialize a AccountIdpSettings object from a json dictionary.""" + args = {} + if (idp_id := _dict.get('idp_id')) is not None: + args['idp_id'] = idp_id + if (owner_account := _dict.get('owner_account')) is not None: + args['owner_account'] = owner_account + if (owner_account_name := _dict.get('owner_account_name')) is not None: + args['owner_account_name'] = owner_account_name + if (idp_name := _dict.get('idp_name')) is not None: + args['idp_name'] = idp_name + if (idp_type := _dict.get('idp_type')) is not None: + args['idp_type'] = idp_type + if (cloud_user_strategy := _dict.get('cloud_user_strategy')) is not None: + args['cloud_user_strategy'] = cloud_user_strategy + if (active := _dict.get('active')) is not None: + args['active'] = active + if (ui_default := _dict.get('ui_default')) is not None: + args['ui_default'] = ui_default + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountIdpSettings object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'idp_id') and self.idp_id is not None: + _dict['idp_id'] = self.idp_id + if hasattr(self, 'owner_account') and self.owner_account is not None: + _dict['owner_account'] = self.owner_account + if hasattr(self, 'owner_account_name') and self.owner_account_name is not None: + _dict['owner_account_name'] = self.owner_account_name + if hasattr(self, 'idp_name') and self.idp_name is not None: + _dict['idp_name'] = self.idp_name + if hasattr(self, 'idp_type') and self.idp_type is not None: + _dict['idp_type'] = self.idp_type + if hasattr(self, 'cloud_user_strategy') and self.cloud_user_strategy is not None: + _dict['cloud_user_strategy'] = self.cloud_user_strategy + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'ui_default') and self.ui_default is not None: + _dict['ui_default'] = self.ui_default + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountIdpSettings object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountIdpSettings') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountIdpSettings') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CloudUserStrategyEnum(str, Enum): + """ + cloud_user_strategy. + """ + + STATIC = 'STATIC' + DYNAMIC = 'DYNAMIC' + NEVER = 'NEVER' + + +class AccountLoginSettings: + """ + AccountLoginSettings. + + :param str alias: (optional) + """ + + def __init__( + self, + *, + alias: Optional[str] = None, + ) -> None: + """ + Initialize a AccountLoginSettings object. + + :param str alias: (optional) + """ + self.alias = alias + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountLoginSettings': + """Initialize a AccountLoginSettings object from a json dictionary.""" + args = {} + if (alias := _dict.get('alias')) is not None: + args['alias'] = alias + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountLoginSettings object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'alias') and self.alias is not None: + _dict['alias'] = self.alias + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountLoginSettings object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountLoginSettings') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountLoginSettings') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountSettingsAssignedTemplatesSection: + """ + Input body parameters for the Account Settings REST request. + + :param str template_id: Template Id. + :param int template_version: Template version. + :param str template_name: Template name. + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets + from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period of + time in seconds in which a session will be invalidated due to inactivity. Valid + values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines the + access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines the + refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: (optional) Defines whether or not user + visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, + such as those the user has invited to the account, or descendants of those users + based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. + :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of users + that are exempted from the MFA requirement of the account. + :param AssignedTemplatesAccountSettingsRestrictUserDomains + restrict_user_domains: (optional) + """ + + def __init__( + self, + template_id: str, + template_version: int, + template_name: str, + *, + restrict_create_service_id: Optional[str] = None, + restrict_create_platform_apikey: Optional[str] = None, + allowed_ip_addresses: Optional[str] = None, + mfa: Optional[str] = None, + session_expiration_in_seconds: Optional[str] = None, + session_invalidation_in_seconds: Optional[str] = None, + max_sessions_per_identity: Optional[str] = None, + system_access_token_expiration_in_seconds: Optional[str] = None, + system_refresh_token_expiration_in_seconds: Optional[str] = None, + restrict_user_list_visibility: Optional[str] = None, + user_mfa: Optional[List['AccountSettingsUserMFAResponse']] = None, + restrict_user_domains: Optional['AssignedTemplatesAccountSettingsRestrictUserDomains'] = None, + ) -> None: + """ + Initialize a AccountSettingsAssignedTemplatesSection object. + + :param str template_id: Template Id. + :param int template_version: Template version. + :param str template_name: Template name. + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or + not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and + subnets from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period + of time in seconds in which a session will be invalidated due to + inactivity. Valid values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines + the access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines + the refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: (optional) Defines whether or not + user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the + account, such as those the user has invited to the account, or descendants + of those users based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the + Users page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. + :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of + users that are exempted from the MFA requirement of the account. + :param AssignedTemplatesAccountSettingsRestrictUserDomains + restrict_user_domains: (optional) + """ + self.template_id = template_id + self.template_version = template_version + self.template_name = template_name + self.restrict_create_service_id = restrict_create_service_id + self.restrict_create_platform_apikey = restrict_create_platform_apikey + self.allowed_ip_addresses = allowed_ip_addresses + self.mfa = mfa + self.session_expiration_in_seconds = session_expiration_in_seconds + self.session_invalidation_in_seconds = session_invalidation_in_seconds + self.max_sessions_per_identity = max_sessions_per_identity + self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds + self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds + self.restrict_user_list_visibility = restrict_user_list_visibility + self.user_mfa = user_mfa + self.restrict_user_domains = restrict_user_domains + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsAssignedTemplatesSection': + """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary.""" + args = {} + if (template_id := _dict.get('template_id')) is not None: + args['template_id'] = template_id + else: + raise ValueError( + 'Required property \'template_id\' not present in AccountSettingsAssignedTemplatesSection JSON' + ) + if (template_version := _dict.get('template_version')) is not None: + args['template_version'] = template_version + else: + raise ValueError( + 'Required property \'template_version\' not present in AccountSettingsAssignedTemplatesSection JSON' + ) + if (template_name := _dict.get('template_name')) is not None: + args['template_name'] = template_name + else: + raise ValueError( + 'Required property \'template_name\' not present in AccountSettingsAssignedTemplatesSection JSON' + ) + if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: + args['restrict_create_service_id'] = restrict_create_service_id + if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: + args['restrict_create_platform_apikey'] = restrict_create_platform_apikey + if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: + args['allowed_ip_addresses'] = allowed_ip_addresses + if (mfa := _dict.get('mfa')) is not None: + args['mfa'] = mfa + if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: + args['session_expiration_in_seconds'] = session_expiration_in_seconds + if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: + args['session_invalidation_in_seconds'] = session_invalidation_in_seconds + if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: + args['max_sessions_per_identity'] = max_sessions_per_identity + if ( + system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') + ) is not None: + args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds + if ( + system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') + ) is not None: + args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: + args['restrict_user_list_visibility'] = restrict_user_list_visibility + if (user_mfa := _dict.get('user_mfa')) is not None: + args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] + if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: + args['restrict_user_domains'] = AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( + restrict_user_domains + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'template_id') and self.template_id is not None: + _dict['template_id'] = self.template_id + if hasattr(self, 'template_version') and self.template_version is not None: + _dict['template_version'] = self.template_version + if hasattr(self, 'template_name') and self.template_name is not None: + _dict['template_name'] = self.template_name + if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: + _dict['restrict_create_service_id'] = self.restrict_create_service_id + if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: + _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey + if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: + _dict['allowed_ip_addresses'] = self.allowed_ip_addresses + if hasattr(self, 'mfa') and self.mfa is not None: + _dict['mfa'] = self.mfa + if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: + _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds + if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: + _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds + if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: + _dict['max_sessions_per_identity'] = self.max_sessions_per_identity + if ( + hasattr(self, 'system_access_token_expiration_in_seconds') + and self.system_access_token_expiration_in_seconds is not None + ): + _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds + if ( + hasattr(self, 'system_refresh_token_expiration_in_seconds') + and self.system_refresh_token_expiration_in_seconds is not None + ): + _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds + if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: + _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility + if hasattr(self, 'user_mfa') and self.user_mfa is not None: + user_mfa_list = [] + for v in self.user_mfa: + if isinstance(v, dict): + user_mfa_list.append(v) + else: + user_mfa_list.append(v.to_dict()) + _dict['user_mfa'] = user_mfa_list + if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: + if isinstance(self.restrict_user_domains, dict): + _dict['restrict_user_domains'] = self.restrict_user_domains + else: + _dict['restrict_user_domains'] = self.restrict_user_domains.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsAssignedTemplatesSection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class RestrictCreateServiceIdEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class RestrictCreatePlatformApikeyEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class MfaEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ + + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' + + class RestrictUserListVisibilityEnum(str, Enum): + """ + Defines whether or not user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, such + as those the user has invited to the account, or descendants of those users based + on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + +class AccountSettingsEffectiveSection: + """ + AccountSettingsEffectiveSection. + + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_user_list_visibility: (optional) Defines whether or not user + visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, + such as those the user has invited to the account, or descendants of those users + based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets + from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of users + that are exempted from the MFA requirement of the account. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period of + time in seconds in which a session will be invalidated due to inactivity. Valid + values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines the + access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines the + refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + """ + + def __init__( + self, + *, + restrict_create_service_id: Optional[str] = None, + restrict_create_platform_apikey: Optional[str] = None, + restrict_user_list_visibility: Optional[str] = None, + allowed_ip_addresses: Optional[str] = None, + mfa: Optional[str] = None, + user_mfa: Optional[List['AccountSettingsUserMFAResponse']] = None, + session_expiration_in_seconds: Optional[str] = None, + session_invalidation_in_seconds: Optional[str] = None, + max_sessions_per_identity: Optional[str] = None, + system_access_token_expiration_in_seconds: Optional[str] = None, + system_refresh_token_expiration_in_seconds: Optional[str] = None, + ) -> None: + """ + Initialize a AccountSettingsEffectiveSection object. + + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or + not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_user_list_visibility: (optional) Defines whether or not + user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the + account, such as those the user has invited to the account, or descendants + of those users based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the + Users page in IBM Cloud console. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and + subnets from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of + users that are exempted from the MFA requirement of the account. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period + of time in seconds in which a session will be invalidated due to + inactivity. Valid values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines + the access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines + the refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + """ + self.restrict_create_service_id = restrict_create_service_id + self.restrict_create_platform_apikey = restrict_create_platform_apikey + self.restrict_user_list_visibility = restrict_user_list_visibility + self.allowed_ip_addresses = allowed_ip_addresses + self.mfa = mfa + self.user_mfa = user_mfa + self.session_expiration_in_seconds = session_expiration_in_seconds + self.session_invalidation_in_seconds = session_invalidation_in_seconds + self.max_sessions_per_identity = max_sessions_per_identity + self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds + self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsEffectiveSection': + """Initialize a AccountSettingsEffectiveSection object from a json dictionary.""" + args = {} + if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: + args['restrict_create_service_id'] = restrict_create_service_id + if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: + args['restrict_create_platform_apikey'] = restrict_create_platform_apikey + if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: + args['restrict_user_list_visibility'] = restrict_user_list_visibility + if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: + args['allowed_ip_addresses'] = allowed_ip_addresses + if (mfa := _dict.get('mfa')) is not None: + args['mfa'] = mfa + if (user_mfa := _dict.get('user_mfa')) is not None: + args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] + if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: + args['session_expiration_in_seconds'] = session_expiration_in_seconds + if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: + args['session_invalidation_in_seconds'] = session_invalidation_in_seconds + if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: + args['max_sessions_per_identity'] = max_sessions_per_identity + if ( + system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') + ) is not None: + args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds + if ( + system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') + ) is not None: + args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsEffectiveSection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: + _dict['restrict_create_service_id'] = self.restrict_create_service_id + if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: + _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey + if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: + _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility + if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: + _dict['allowed_ip_addresses'] = self.allowed_ip_addresses + if hasattr(self, 'mfa') and self.mfa is not None: + _dict['mfa'] = self.mfa + if hasattr(self, 'user_mfa') and self.user_mfa is not None: + user_mfa_list = [] + for v in self.user_mfa: + if isinstance(v, dict): + user_mfa_list.append(v) + else: + user_mfa_list.append(v.to_dict()) + _dict['user_mfa'] = user_mfa_list + if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: + _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds + if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: + _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds + if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: + _dict['max_sessions_per_identity'] = self.max_sessions_per_identity + if ( + hasattr(self, 'system_access_token_expiration_in_seconds') + and self.system_access_token_expiration_in_seconds is not None + ): + _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds + if ( + hasattr(self, 'system_refresh_token_expiration_in_seconds') + and self.system_refresh_token_expiration_in_seconds is not None + ): + _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsEffectiveSection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsEffectiveSection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsEffectiveSection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class RestrictCreateServiceIdEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class RestrictCreatePlatformApikeyEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class RestrictUserListVisibilityEnum(str, Enum): + """ + Defines whether or not user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, such + as those the user has invited to the account, or descendants of those users based + on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console. + """ + + NOT_RESTRICTED = 'NOT_RESTRICTED' + RESTRICTED = 'RESTRICTED' + + class MfaEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ + + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' + + +class AccountSettingsResponse: + """ + Input body parameters for the Account Settings REST request. + + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str account_id: Unique ID of the account. + :param str entity_tag: Version of the account settings. + :param List[EnityHistoryRecord] history: (optional) History of the Account + Settings. + :param str restrict_create_service_id: Defines whether or not creating the + resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: Defines whether or not creating the + resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: Defines the IP addresses and subnets from which + IAM tokens can be created for the account. + :param str mfa: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str session_expiration_in_seconds: Defines the session expiration in + seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: Defines the period of time in + seconds in which a session will be invalidated due to inactivity. Valid values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: Defines the max allowed sessions per + identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: Defines the access token + expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: Defines the refresh token + expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: Defines whether or not user visibility + is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, + such as those the user has invited to the account, or descendants of those users + based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console. + :param List[AccountSettingsUserMFAResponse] user_mfa: List of users that are + exempted from the MFA requirement of the account. + :param List[AccountSettingsUserDomainRestriction] restrict_user_domains: Defines + if account invitations are restricted to specified domains. To remove an entry + for a realm_id, perform an update (PUT) request with only the realm_id set. + """ + + def __init__( + self, + account_id: str, + entity_tag: str, + restrict_create_service_id: str, + restrict_create_platform_apikey: str, + allowed_ip_addresses: str, + mfa: str, + session_expiration_in_seconds: str, + session_invalidation_in_seconds: str, + max_sessions_per_identity: str, + system_access_token_expiration_in_seconds: str, + system_refresh_token_expiration_in_seconds: str, + restrict_user_list_visibility: str, + user_mfa: List['AccountSettingsUserMFAResponse'], + restrict_user_domains: List['AccountSettingsUserDomainRestriction'], + *, + context: Optional['ResponseContext'] = None, + history: Optional[List['EnityHistoryRecord']] = None, + ) -> None: + """ + Initialize a AccountSettingsResponse object. + + :param str account_id: Unique ID of the account. + :param str entity_tag: Version of the account settings. + :param str restrict_create_service_id: Defines whether or not creating the + resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: Defines whether or not creating + the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: Defines the IP addresses and subnets from + which IAM tokens can be created for the account. + :param str mfa: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str session_expiration_in_seconds: Defines the session expiration in + seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: Defines the period of time in + seconds in which a session will be invalidated due to inactivity. Valid + values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: Defines the max allowed sessions per + identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: Defines the access + token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: Defines the refresh + token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: Defines whether or not user + visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the + account, such as those the user has invited to the account, or descendants + of those users based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the + Users page in IBM Cloud console. + :param List[AccountSettingsUserMFAResponse] user_mfa: List of users that + are exempted from the MFA requirement of the account. + :param List[AccountSettingsUserDomainRestriction] restrict_user_domains: + Defines if account invitations are restricted to specified domains. To + remove an entry for a realm_id, perform an update (PUT) request with only + the realm_id set. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param List[EnityHistoryRecord] history: (optional) History of the Account + Settings. + """ + self.context = context + self.account_id = account_id + self.entity_tag = entity_tag + self.history = history + self.restrict_create_service_id = restrict_create_service_id + self.restrict_create_platform_apikey = restrict_create_platform_apikey + self.allowed_ip_addresses = allowed_ip_addresses + self.mfa = mfa + self.session_expiration_in_seconds = session_expiration_in_seconds + self.session_invalidation_in_seconds = session_invalidation_in_seconds + self.max_sessions_per_identity = max_sessions_per_identity + self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds + self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds + self.restrict_user_list_visibility = restrict_user_list_visibility + self.user_mfa = user_mfa + self.restrict_user_domains = restrict_user_domains + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse': + """Initialize a AccountSettingsResponse object from a json dictionary.""" + args = {} + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in AccountSettingsResponse JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in AccountSettingsResponse JSON') + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: + args['restrict_create_service_id'] = restrict_create_service_id + else: + raise ValueError( + 'Required property \'restrict_create_service_id\' not present in AccountSettingsResponse JSON' + ) + if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: + args['restrict_create_platform_apikey'] = restrict_create_platform_apikey + else: + raise ValueError( + 'Required property \'restrict_create_platform_apikey\' not present in AccountSettingsResponse JSON' + ) + if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: + args['allowed_ip_addresses'] = allowed_ip_addresses + else: + raise ValueError('Required property \'allowed_ip_addresses\' not present in AccountSettingsResponse JSON') + if (mfa := _dict.get('mfa')) is not None: + args['mfa'] = mfa + else: + raise ValueError('Required property \'mfa\' not present in AccountSettingsResponse JSON') + if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: + args['session_expiration_in_seconds'] = session_expiration_in_seconds + else: + raise ValueError( + 'Required property \'session_expiration_in_seconds\' not present in AccountSettingsResponse JSON' + ) + if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: + args['session_invalidation_in_seconds'] = session_invalidation_in_seconds + else: + raise ValueError( + 'Required property \'session_invalidation_in_seconds\' not present in AccountSettingsResponse JSON' + ) + if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: + args['max_sessions_per_identity'] = max_sessions_per_identity + else: + raise ValueError( + 'Required property \'max_sessions_per_identity\' not present in AccountSettingsResponse JSON' + ) + if ( + system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') + ) is not None: + args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds + else: + raise ValueError( + 'Required property \'system_access_token_expiration_in_seconds\' not present in AccountSettingsResponse JSON' + ) + if ( + system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') + ) is not None: + args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + else: + raise ValueError( + 'Required property \'system_refresh_token_expiration_in_seconds\' not present in AccountSettingsResponse JSON' + ) + if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: + args['restrict_user_list_visibility'] = restrict_user_list_visibility + else: + raise ValueError( + 'Required property \'restrict_user_list_visibility\' not present in AccountSettingsResponse JSON' + ) + if (user_mfa := _dict.get('user_mfa')) is not None: + args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] + else: + raise ValueError('Required property \'user_mfa\' not present in AccountSettingsResponse JSON') + if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: + args['restrict_user_domains'] = [ + AccountSettingsUserDomainRestriction.from_dict(v) for v in restrict_user_domains + ] + else: + raise ValueError('Required property \'restrict_user_domains\' not present in AccountSettingsResponse JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: + _dict['restrict_create_service_id'] = self.restrict_create_service_id + if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: + _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey + if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: + _dict['allowed_ip_addresses'] = self.allowed_ip_addresses + if hasattr(self, 'mfa') and self.mfa is not None: + _dict['mfa'] = self.mfa + if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: + _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds + if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: + _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds + if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: + _dict['max_sessions_per_identity'] = self.max_sessions_per_identity + if ( + hasattr(self, 'system_access_token_expiration_in_seconds') + and self.system_access_token_expiration_in_seconds is not None + ): + _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds + if ( + hasattr(self, 'system_refresh_token_expiration_in_seconds') + and self.system_refresh_token_expiration_in_seconds is not None + ): + _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds + if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: + _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility + if hasattr(self, 'user_mfa') and self.user_mfa is not None: + user_mfa_list = [] + for v in self.user_mfa: + if isinstance(v, dict): + user_mfa_list.append(v) + else: + user_mfa_list.append(v.to_dict()) + _dict['user_mfa'] = user_mfa_list + if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: + restrict_user_domains_list = [] + for v in self.restrict_user_domains: + if isinstance(v, dict): + restrict_user_domains_list.append(v) + else: + restrict_user_domains_list.append(v.to_dict()) + _dict['restrict_user_domains'] = restrict_user_domains_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class RestrictCreateServiceIdEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class RestrictCreatePlatformApikeyEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ + + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' + + class MfaEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ + + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' + + class RestrictUserListVisibilityEnum(str, Enum): + """ + Defines whether or not user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, such + as those the user has invited to the account, or descendants of those users based + on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console. + """ + + NOT_RESTRICTED = 'NOT_RESTRICTED' + RESTRICTED = 'RESTRICTED' + + +class AccountSettingsTemplateList: + """ + AccountSettingsTemplateList. + + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is available. + :param str next: (optional) Link to the next available page. If 'next' property + is not part of the response no next page is available. + :param List[AccountSettingsTemplateResponse] account_settings_templates: List of + account settings templates based on the query paramters and the page size. The + account_settings_templates array is always part of the response but might be + empty depending on the query parameter values provided. + """ + + def __init__( + self, + account_settings_templates: List['AccountSettingsTemplateResponse'], + *, + context: Optional['ResponseContext'] = None, + offset: Optional[int] = None, + limit: Optional[int] = None, + first: Optional[str] = None, + previous: Optional[str] = None, + next: Optional[str] = None, + ) -> None: + """ + Initialize a AccountSettingsTemplateList object. + + :param List[AccountSettingsTemplateResponse] account_settings_templates: + List of account settings templates based on the query paramters and the + page size. The account_settings_templates array is always part of the + response but might be empty depending on the query parameter values + provided. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is + available. + :param str next: (optional) Link to the next available page. If 'next' + property is not part of the response no next page is available. + """ + self.context = context + self.offset = offset + self.limit = limit + self.first = first + self.previous = previous + self.next = next + self.account_settings_templates = account_settings_templates + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsTemplateList': + """Initialize a AccountSettingsTemplateList object from a json dictionary.""" + args = {} + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (offset := _dict.get('offset')) is not None: + args['offset'] = offset + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (first := _dict.get('first')) is not None: + args['first'] = first + if (previous := _dict.get('previous')) is not None: + args['previous'] = previous + if (next := _dict.get('next')) is not None: + args['next'] = next + if (account_settings_templates := _dict.get('account_settings_templates')) is not None: + args['account_settings_templates'] = [ + AccountSettingsTemplateResponse.from_dict(v) for v in account_settings_templates + ] + else: + raise ValueError( + 'Required property \'account_settings_templates\' not present in AccountSettingsTemplateList JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsTemplateList object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first + if hasattr(self, 'previous') and self.previous is not None: + _dict['previous'] = self.previous + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next + if hasattr(self, 'account_settings_templates') and self.account_settings_templates is not None: + account_settings_templates_list = [] + for v in self.account_settings_templates: + if isinstance(v, dict): + account_settings_templates_list.append(v) + else: + account_settings_templates_list.append(v.to_dict()) + _dict['account_settings_templates'] = account_settings_templates_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsTemplateList object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsTemplateList') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsTemplateList') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountSettingsTemplateResponse: + """ + Response body format for account settings template REST requests. + + :param str id: ID of the the template. + :param int version: Version of the the template. + :param str account_id: ID of the account where the template resides. + :param str name: The name of the trusted profile template. This is visible only + in the enterprise account. + :param str description: (optional) The description of the trusted profile + template. Describe the template for enterprise account users. + :param bool committed: Committed flag determines if the template is ready for + assignment. + :param TemplateAccountSettings account_settings: Input body parameters for the + Account Settings REST request. + :param List[EnityHistoryRecord] history: (optional) History of the Template. + :param str entity_tag: Entity tag for this templateId-version combination. + :param str crn: Cloud resource name. + :param str created_at: (optional) Template Created At. + :param str created_by_id: (optional) IAMid of the creator. + :param str last_modified_at: (optional) Template last modified at. + :param str last_modified_by_id: (optional) IAMid of the identity that made the + latest modification. + """ + + def __init__( + self, + id: str, + version: int, + account_id: str, + name: str, + committed: bool, + account_settings: 'TemplateAccountSettings', + entity_tag: str, + crn: str, + *, + description: Optional[str] = None, + history: Optional[List['EnityHistoryRecord']] = None, + created_at: Optional[str] = None, + created_by_id: Optional[str] = None, + last_modified_at: Optional[str] = None, + last_modified_by_id: Optional[str] = None, + ) -> None: + """ + Initialize a AccountSettingsTemplateResponse object. + + :param str id: ID of the the template. + :param int version: Version of the the template. + :param str account_id: ID of the account where the template resides. + :param str name: The name of the trusted profile template. This is visible + only in the enterprise account. + :param bool committed: Committed flag determines if the template is ready + for assignment. + :param TemplateAccountSettings account_settings: Input body parameters for + the Account Settings REST request. + :param str entity_tag: Entity tag for this templateId-version combination. + :param str crn: Cloud resource name. + :param str description: (optional) The description of the trusted profile + template. Describe the template for enterprise account users. + :param List[EnityHistoryRecord] history: (optional) History of the + Template. + :param str created_at: (optional) Template Created At. + :param str created_by_id: (optional) IAMid of the creator. + :param str last_modified_at: (optional) Template last modified at. + :param str last_modified_by_id: (optional) IAMid of the identity that made + the latest modification. + """ + self.id = id + self.version = version + self.account_id = account_id + self.name = name + self.description = description + self.committed = committed + self.account_settings = account_settings + self.history = history + self.entity_tag = entity_tag + self.crn = crn + self.created_at = created_at + self.created_by_id = created_by_id + self.last_modified_at = last_modified_at + self.last_modified_by_id = last_modified_by_id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsTemplateResponse': + """Initialize a AccountSettingsTemplateResponse object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in AccountSettingsTemplateResponse JSON') + if (version := _dict.get('version')) is not None: + args['version'] = version + else: + raise ValueError('Required property \'version\' not present in AccountSettingsTemplateResponse JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in AccountSettingsTemplateResponse JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in AccountSettingsTemplateResponse JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (committed := _dict.get('committed')) is not None: + args['committed'] = committed + else: + raise ValueError('Required property \'committed\' not present in AccountSettingsTemplateResponse JSON') + if (account_settings := _dict.get('account_settings')) is not None: + args['account_settings'] = TemplateAccountSettings.from_dict(account_settings) + else: + raise ValueError( + 'Required property \'account_settings\' not present in AccountSettingsTemplateResponse JSON' + ) + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in AccountSettingsTemplateResponse JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in AccountSettingsTemplateResponse JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = created_at + if (created_by_id := _dict.get('created_by_id')) is not None: + args['created_by_id'] = created_by_id + if (last_modified_at := _dict.get('last_modified_at')) is not None: + args['last_modified_at'] = last_modified_at + if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: + args['last_modified_by_id'] = last_modified_by_id + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsTemplateResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'committed') and self.committed is not None: + _dict['committed'] = self.committed + if hasattr(self, 'account_settings') and self.account_settings is not None: + if isinstance(self.account_settings, dict): + _dict['account_settings'] = self.account_settings + else: + _dict['account_settings'] = self.account_settings.to_dict() + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = self.created_at + if hasattr(self, 'created_by_id') and self.created_by_id is not None: + _dict['created_by_id'] = self.created_by_id + if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: + _dict['last_modified_at'] = self.last_modified_at + if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: + _dict['last_modified_by_id'] = self.last_modified_by_id + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsTemplateResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsTemplateResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsTemplateResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountSettingsUserDomainRestriction: + """ + Input body parameters for the Account Settings REST request. + + :param str realm_id: The realm that the restrictions apply to. + :param List[str] invitation_email_allow_patterns: (optional) The list of allowed + email patterns. Wildcard syntax is supported, '*' represents any sequence of + zero or more characters in the string, except for '.' and '@'. The sequence ends + if a '.' or '@' was found. '**' represents any sequence of zero or more + characters in the string - without limit. + :param bool restrict_invitation: (optional) When true invites will only be + possible to the domain patterns provided, otherwise invites are unrestricted. + """ + + def __init__( + self, + realm_id: str, + *, + invitation_email_allow_patterns: Optional[List[str]] = None, + restrict_invitation: Optional[bool] = None, + ) -> None: + """ + Initialize a AccountSettingsUserDomainRestriction object. + + :param str realm_id: The realm that the restrictions apply to. + :param List[str] invitation_email_allow_patterns: (optional) The list of + allowed email patterns. Wildcard syntax is supported, '*' represents any + sequence of zero or more characters in the string, except for '.' and '@'. + The sequence ends if a '.' or '@' was found. '**' represents any sequence + of zero or more characters in the string - without limit. + :param bool restrict_invitation: (optional) When true invites will only be + possible to the domain patterns provided, otherwise invites are + unrestricted. + """ + self.realm_id = realm_id + self.invitation_email_allow_patterns = invitation_email_allow_patterns + self.restrict_invitation = restrict_invitation + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserDomainRestriction': + """Initialize a AccountSettingsUserDomainRestriction object from a json dictionary.""" + args = {} + if (realm_id := _dict.get('realm_id')) is not None: + args['realm_id'] = realm_id + else: + raise ValueError('Required property \'realm_id\' not present in AccountSettingsUserDomainRestriction JSON') + if (invitation_email_allow_patterns := _dict.get('invitation_email_allow_patterns')) is not None: + args['invitation_email_allow_patterns'] = invitation_email_allow_patterns + if (restrict_invitation := _dict.get('restrict_invitation')) is not None: + args['restrict_invitation'] = restrict_invitation + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsUserDomainRestriction object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'realm_id') and self.realm_id is not None: + _dict['realm_id'] = self.realm_id + if hasattr(self, 'invitation_email_allow_patterns') and self.invitation_email_allow_patterns is not None: + _dict['invitation_email_allow_patterns'] = self.invitation_email_allow_patterns + if hasattr(self, 'restrict_invitation') and self.restrict_invitation is not None: + _dict['restrict_invitation'] = self.restrict_invitation + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsUserDomainRestriction object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsUserDomainRestriction') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsUserDomainRestriction') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AccountSettingsUserMFAResponse: + """ + AccountSettingsUserMFAResponse. + + :param str iam_id: The iam_id of the user. + :param str mfa: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - Security Key MFA for all users. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period of - time in seconds in which a session will be invalidated due to inactivity. Valid - values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines the - access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines the - refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: (optional) Defines whether or not user - visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, - such as those the user has invited to the account, or descendants of those users - based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. - :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of users - that are exempted from the MFA requirement of the account. - :param AssignedTemplatesAccountSettingsRestrictUserDomains - restrict_user_domains: (optional) + :param str name: (optional) name of the user account. + :param str user_name: (optional) userName of the user. + :param str email: (optional) email of the user. + :param str description: (optional) optional description. + """ + + def __init__( + self, + iam_id: str, + mfa: str, + *, + name: Optional[str] = None, + user_name: Optional[str] = None, + email: Optional[str] = None, + description: Optional[str] = None, + ) -> None: + """ + Initialize a AccountSettingsUserMFAResponse object. + + :param str iam_id: The iam_id of the user. + :param str mfa: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str name: (optional) name of the user account. + :param str user_name: (optional) userName of the user. + :param str email: (optional) email of the user. + :param str description: (optional) optional description. + """ + self.iam_id = iam_id + self.mfa = mfa + self.name = name + self.user_name = user_name + self.email = email + self.description = description + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserMFAResponse': + """Initialize a AccountSettingsUserMFAResponse object from a json dictionary.""" + args = {} + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + else: + raise ValueError('Required property \'iam_id\' not present in AccountSettingsUserMFAResponse JSON') + if (mfa := _dict.get('mfa')) is not None: + args['mfa'] = mfa + else: + raise ValueError('Required property \'mfa\' not present in AccountSettingsUserMFAResponse JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (user_name := _dict.get('userName')) is not None: + args['user_name'] = user_name + if (email := _dict.get('email')) is not None: + args['email'] = email + if (description := _dict.get('description')) is not None: + args['description'] = description + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountSettingsUserMFAResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'mfa') and self.mfa is not None: + _dict['mfa'] = self.mfa + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'user_name') and self.user_name is not None: + _dict['userName'] = self.user_name + if hasattr(self, 'email') and self.email is not None: + _dict['email'] = self.email + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountSettingsUserMFAResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountSettingsUserMFAResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountSettingsUserMFAResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class MfaEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ + + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' + + +class ActionControls: + """ + ActionControls. + + :param ActionControlsIdentities identities: (optional) + :param ActionControlsRules rules: + :param ActionControlsPolicies policies: + """ + + def __init__( + self, + rules: 'ActionControlsRules', + policies: 'ActionControlsPolicies', + *, + identities: Optional['ActionControlsIdentities'] = None, + ) -> None: + """ + Initialize a ActionControls object. + + :param ActionControlsRules rules: + :param ActionControlsPolicies policies: + :param ActionControlsIdentities identities: (optional) + """ + self.identities = identities + self.rules = rules + self.policies = policies + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ActionControls': + """Initialize a ActionControls object from a json dictionary.""" + args = {} + if (identities := _dict.get('identities')) is not None: + args['identities'] = ActionControlsIdentities.from_dict(identities) + if (rules := _dict.get('rules')) is not None: + args['rules'] = ActionControlsRules.from_dict(rules) + else: + raise ValueError('Required property \'rules\' not present in ActionControls JSON') + if (policies := _dict.get('policies')) is not None: + args['policies'] = ActionControlsPolicies.from_dict(policies) + else: + raise ValueError('Required property \'policies\' not present in ActionControls JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ActionControls object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'identities') and self.identities is not None: + if isinstance(self.identities, dict): + _dict['identities'] = self.identities + else: + _dict['identities'] = self.identities.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + if isinstance(self.rules, dict): + _dict['rules'] = self.rules + else: + _dict['rules'] = self.rules.to_dict() + if hasattr(self, 'policies') and self.policies is not None: + if isinstance(self.policies, dict): + _dict['policies'] = self.policies + else: + _dict['policies'] = self.policies.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ActionControls object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ActionControls') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ActionControls') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ActionControlsIdentities: + """ + ActionControlsIdentities. + + :param bool add: + :param bool remove: + """ + + def __init__( + self, + add: bool, + remove: bool, + ) -> None: + """ + Initialize a ActionControlsIdentities object. + + :param bool add: + :param bool remove: + """ + self.add = add + self.remove = remove + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ActionControlsIdentities': + """Initialize a ActionControlsIdentities object from a json dictionary.""" + args = {} + if (add := _dict.get('add')) is not None: + args['add'] = add + else: + raise ValueError('Required property \'add\' not present in ActionControlsIdentities JSON') + if (remove := _dict.get('remove')) is not None: + args['remove'] = remove + else: + raise ValueError('Required property \'remove\' not present in ActionControlsIdentities JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ActionControlsIdentities object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'add') and self.add is not None: + _dict['add'] = self.add + if hasattr(self, 'remove') and self.remove is not None: + _dict['remove'] = self.remove + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ActionControlsIdentities object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ActionControlsIdentities') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ActionControlsIdentities') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ActionControlsPolicies: + """ + ActionControlsPolicies. + + :param bool add: + :param bool remove: + """ + + def __init__( + self, + add: bool, + remove: bool, + ) -> None: + """ + Initialize a ActionControlsPolicies object. + + :param bool add: + :param bool remove: + """ + self.add = add + self.remove = remove + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ActionControlsPolicies': + """Initialize a ActionControlsPolicies object from a json dictionary.""" + args = {} + if (add := _dict.get('add')) is not None: + args['add'] = add + else: + raise ValueError('Required property \'add\' not present in ActionControlsPolicies JSON') + if (remove := _dict.get('remove')) is not None: + args['remove'] = remove + else: + raise ValueError('Required property \'remove\' not present in ActionControlsPolicies JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ActionControlsPolicies object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'add') and self.add is not None: + _dict['add'] = self.add + if hasattr(self, 'remove') and self.remove is not None: + _dict['remove'] = self.remove + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ActionControlsPolicies object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ActionControlsPolicies') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ActionControlsPolicies') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ActionControlsRules: + """ + ActionControlsRules. + + :param bool add: + :param bool remove: + """ + + def __init__( + self, + add: bool, + remove: bool, + ) -> None: + """ + Initialize a ActionControlsRules object. + + :param bool add: + :param bool remove: + """ + self.add = add + self.remove = remove + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ActionControlsRules': + """Initialize a ActionControlsRules object from a json dictionary.""" + args = {} + if (add := _dict.get('add')) is not None: + args['add'] = add + else: + raise ValueError('Required property \'add\' not present in ActionControlsRules JSON') + if (remove := _dict.get('remove')) is not None: + args['remove'] = remove + else: + raise ValueError('Required property \'remove\' not present in ActionControlsRules JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ActionControlsRules object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'add') and self.add is not None: + _dict['add'] = self.add + if hasattr(self, 'remove') and self.remove is not None: + _dict['remove'] = self.remove + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ActionControlsRules object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ActionControlsRules') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ActionControlsRules') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class Activity: + """ + Activity. + + :param str last_authn: (optional) Time when the entity was last authenticated. + :param int authn_count: Authentication count, number of times the entity was + authenticated. + """ + + def __init__( + self, + authn_count: int, + *, + last_authn: Optional[str] = None, + ) -> None: + """ + Initialize a Activity object. + + :param int authn_count: Authentication count, number of times the entity + was authenticated. + :param str last_authn: (optional) Time when the entity was last + authenticated. + """ + self.last_authn = last_authn + self.authn_count = authn_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'Activity': + """Initialize a Activity object from a json dictionary.""" + args = {} + if (last_authn := _dict.get('last_authn')) is not None: + args['last_authn'] = last_authn + if (authn_count := _dict.get('authn_count')) is not None: + args['authn_count'] = authn_count + else: + raise ValueError('Required property \'authn_count\' not present in Activity JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a Activity object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'last_authn') and self.last_authn is not None: + _dict['last_authn'] = self.last_authn + if hasattr(self, 'authn_count') and self.authn_count is not None: + _dict['authn_count'] = self.authn_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this Activity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'Activity') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'Activity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApiKey: + """ + Response body format for API key V1 REST requests. + + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str id: Unique identifier of this API Key. + :param str entity_tag: (optional) Version of the API Key details object. You + need to specify this value when updating the API key to avoid stale updates. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'. + :param bool locked: The API key cannot be changed if set to true. + :param bool disabled: (optional) Defines if API key is disabled, API key cannot + be used if 'disabled' is set to true. + :param datetime created_at: (optional) If set contains a date time string of the + creation date in ISO format. + :param str created_by: IAM ID of the user or service which created the API key. + :param datetime modified_at: (optional) If set contains a date time string of + the last modification date in ISO format. + :param str name: Name of the API key. The name is not checked for uniqueness. + Therefore multiple names with the same value can exist. Access is done via the + UUID of the API key. + :param bool support_sessions: (optional) Defines whether you can manage CLI + login sessions for the API key. When `true`, sessions are created and can be + reviewed or revoked. When `false`, no sessions are tracked. To block access, + delete or rotate the API key. Available only for user API keys. + :param str action_when_leaked: (optional) Defines the action to take when API + key is leaked, valid values are 'none', 'disable' and 'delete'. + :param str expires_at: (optional) Date and time when the API key becomes + invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** An + API key will be permanently and irrevocably deleted when both the expires_at and + modified_at timestamps are more than ninety (90) days in the past, regardless of + the key’s locked status or any other state. + :param str description: (optional) The optional description of the API key. The + 'description' property is only available if a description was provided during a + create of an API key. + :param str iam_id: The iam_id that this API key authenticates. + :param str account_id: ID of the account that this API key authenticates for. + :param str apikey: The API key value. This property only contains the API key + value for the following cases: create an API key, update a service ID API key + that stores the API key value as retrievable, or get a service ID API key that + stores the API key value as retrievable. All other operations don't return the + API key value, for example all user API key related operations, except for + create, don't contain the API key value. + :param List[EnityHistoryRecord] history: (optional) History of the API key. + :param Activity activity: (optional) + """ + + def __init__( + self, + id: str, + crn: str, + locked: bool, + created_by: str, + name: str, + iam_id: str, + account_id: str, + apikey: str, + *, + context: Optional['ResponseContext'] = None, + entity_tag: Optional[str] = None, + disabled: Optional[bool] = None, + created_at: Optional[datetime] = None, + modified_at: Optional[datetime] = None, + support_sessions: Optional[bool] = None, + action_when_leaked: Optional[str] = None, + expires_at: Optional[str] = None, + description: Optional[str] = None, + history: Optional[List['EnityHistoryRecord']] = None, + activity: Optional['Activity'] = None, + ) -> None: + """ + Initialize a ApiKey object. + + :param str id: Unique identifier of this API Key. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource + Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'. + :param bool locked: The API key cannot be changed if set to true. + :param str created_by: IAM ID of the user or service which created the API + key. + :param str name: Name of the API key. The name is not checked for + uniqueness. Therefore multiple names with the same value can exist. Access + is done via the UUID of the API key. + :param str iam_id: The iam_id that this API key authenticates. + :param str account_id: ID of the account that this API key authenticates + for. + :param str apikey: The API key value. This property only contains the API + key value for the following cases: create an API key, update a service ID + API key that stores the API key value as retrievable, or get a service ID + API key that stores the API key value as retrievable. All other operations + don't return the API key value, for example all user API key related + operations, except for create, don't contain the API key value. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str entity_tag: (optional) Version of the API Key details object. + You need to specify this value when updating the API key to avoid stale + updates. + :param bool disabled: (optional) Defines if API key is disabled, API key + cannot be used if 'disabled' is set to true. + :param datetime created_at: (optional) If set contains a date time string + of the creation date in ISO format. + :param datetime modified_at: (optional) If set contains a date time string + of the last modification date in ISO format. + :param bool support_sessions: (optional) Defines whether you can manage CLI + login sessions for the API key. When `true`, sessions are created and can + be reviewed or revoked. When `false`, no sessions are tracked. To block + access, delete or rotate the API key. Available only for user API keys. + :param str action_when_leaked: (optional) Defines the action to take when + API key is leaked, valid values are 'none', 'disable' and 'delete'. + :param str expires_at: (optional) Date and time when the API key becomes + invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. + **WARNING** An API key will be permanently and irrevocably deleted when + both the expires_at and modified_at timestamps are more than ninety (90) + days in the past, regardless of the key’s locked status or any other state. + :param str description: (optional) The optional description of the API key. + The 'description' property is only available if a description was provided + during a create of an API key. + :param List[EnityHistoryRecord] history: (optional) History of the API key. + :param Activity activity: (optional) + """ + self.context = context + self.id = id + self.entity_tag = entity_tag + self.crn = crn + self.locked = locked + self.disabled = disabled + self.created_at = created_at + self.created_by = created_by + self.modified_at = modified_at + self.name = name + self.support_sessions = support_sessions + self.action_when_leaked = action_when_leaked + self.expires_at = expires_at + self.description = description + self.iam_id = iam_id + self.account_id = account_id + self.apikey = apikey + self.history = history + self.activity = activity + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApiKey': + """Initialize a ApiKey object from a json dictionary.""" + args = {} + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ApiKey JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in ApiKey JSON') + if (locked := _dict.get('locked')) is not None: + args['locked'] = locked + else: + raise ValueError('Required property \'locked\' not present in ApiKey JSON') + if (disabled := _dict.get('disabled')) is not None: + args['disabled'] = disabled + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + if (created_by := _dict.get('created_by')) is not None: + args['created_by'] = created_by + else: + raise ValueError('Required property \'created_by\' not present in ApiKey JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ApiKey JSON') + if (support_sessions := _dict.get('support_sessions')) is not None: + args['support_sessions'] = support_sessions + if (action_when_leaked := _dict.get('action_when_leaked')) is not None: + args['action_when_leaked'] = action_when_leaked + if (expires_at := _dict.get('expires_at')) is not None: + args['expires_at'] = expires_at + if (description := _dict.get('description')) is not None: + args['description'] = description + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + else: + raise ValueError('Required property \'iam_id\' not present in ApiKey JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in ApiKey JSON') + if (apikey := _dict.get('apikey')) is not None: + args['apikey'] = apikey + else: + raise ValueError('Required property \'apikey\' not present in ApiKey JSON') + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (activity := _dict.get('activity')) is not None: + args['activity'] = Activity.from_dict(activity) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApiKey object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'locked') and self.locked is not None: + _dict['locked'] = self.locked + if hasattr(self, 'disabled') and self.disabled is not None: + _dict['disabled'] = self.disabled + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'created_by') and self.created_by is not None: + _dict['created_by'] = self.created_by + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'support_sessions') and self.support_sessions is not None: + _dict['support_sessions'] = self.support_sessions + if hasattr(self, 'action_when_leaked') and self.action_when_leaked is not None: + _dict['action_when_leaked'] = self.action_when_leaked + if hasattr(self, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = self.expires_at + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'apikey') and self.apikey is not None: + _dict['apikey'] = self.apikey + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'activity') and self.activity is not None: + if isinstance(self.activity, dict): + _dict['activity'] = self.activity + else: + _dict['activity'] = self.activity.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApiKey object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApiKey') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApiKey') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApiKeyInsideCreateServiceIdRequest: + """ + Parameters for the API key in the Create service Id V1 REST request. + + :param str name: Name of the API key. The name is not checked for uniqueness. + Therefore multiple names with the same value can exist. Access is done via the + UUID of the API key. + :param str description: (optional) The optional description of the API key. The + 'description' property is only available if a description was provided during a + create of an API key. + :param str apikey: (optional) You can optionally passthrough the API key value + for this API key. If passed, a minimum length validation of 32 characters for + that apiKey value is done, i.e. the value can contain any characters and can + even be non-URL safe, but the minimum length requirement must be met. If + omitted, the API key management will create an URL safe opaque API key value. + The value of the API key is checked for uniqueness. Ensure enough variations + when passing in this value. + :param bool store_value: (optional) Send true or false to set whether the API + key value is retrievable in the future by using the Get details of an API key + request. If you create an API key for a user, you must specify `false` or omit + the value. We don't allow storing of API keys for users. + :param str action_when_leaked: (optional) Defines the action to take when API + key is leaked, valid values are 'none', 'disable' and 'delete'. + :param str expires_at: (optional) Date and time when the API key becomes + invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** An + API key will be permanently and irrevocably deleted when both the expires_at and + modified_at timestamps are more than ninety (90) days in the past, regardless of + the key’s locked status or any other state. + """ + + def __init__( + self, + name: str, + *, + description: Optional[str] = None, + apikey: Optional[str] = None, + store_value: Optional[bool] = None, + action_when_leaked: Optional[str] = None, + expires_at: Optional[str] = None, + ) -> None: + """ + Initialize a ApiKeyInsideCreateServiceIdRequest object. + + :param str name: Name of the API key. The name is not checked for + uniqueness. Therefore multiple names with the same value can exist. Access + is done via the UUID of the API key. + :param str description: (optional) The optional description of the API key. + The 'description' property is only available if a description was provided + during a create of an API key. + :param str apikey: (optional) You can optionally passthrough the API key + value for this API key. If passed, a minimum length validation of 32 + characters for that apiKey value is done, i.e. the value can contain any + characters and can even be non-URL safe, but the minimum length requirement + must be met. If omitted, the API key management will create an URL safe + opaque API key value. The value of the API key is checked for uniqueness. + Ensure enough variations when passing in this value. + :param bool store_value: (optional) Send true or false to set whether the + API key value is retrievable in the future by using the Get details of an + API key request. If you create an API key for a user, you must specify + `false` or omit the value. We don't allow storing of API keys for users. + :param str action_when_leaked: (optional) Defines the action to take when + API key is leaked, valid values are 'none', 'disable' and 'delete'. + :param str expires_at: (optional) Date and time when the API key becomes + invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. + **WARNING** An API key will be permanently and irrevocably deleted when + both the expires_at and modified_at timestamps are more than ninety (90) + days in the past, regardless of the key’s locked status or any other state. + """ + self.name = name + self.description = description + self.apikey = apikey + self.store_value = store_value + self.action_when_leaked = action_when_leaked + self.expires_at = expires_at + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApiKeyInsideCreateServiceIdRequest': + """Initialize a ApiKeyInsideCreateServiceIdRequest object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ApiKeyInsideCreateServiceIdRequest JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (apikey := _dict.get('apikey')) is not None: + args['apikey'] = apikey + if (store_value := _dict.get('store_value')) is not None: + args['store_value'] = store_value + if (action_when_leaked := _dict.get('action_when_leaked')) is not None: + args['action_when_leaked'] = action_when_leaked + if (expires_at := _dict.get('expires_at')) is not None: + args['expires_at'] = expires_at + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApiKeyInsideCreateServiceIdRequest object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'apikey') and self.apikey is not None: + _dict['apikey'] = self.apikey + if hasattr(self, 'store_value') and self.store_value is not None: + _dict['store_value'] = self.store_value + if hasattr(self, 'action_when_leaked') and self.action_when_leaked is not None: + _dict['action_when_leaked'] = self.action_when_leaked + if hasattr(self, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = self.expires_at + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApiKeyInsideCreateServiceIdRequest object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApiKeyInsideCreateServiceIdRequest') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApiKeyInsideCreateServiceIdRequest') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApiKeyList: + """ + Response body format for the List API keys V1 REST request. + + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 items + per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is available. + :param str next: (optional) Link to the next available page. If 'next' property + is not part of the response no next page is available. + :param List[ApiKey] apikeys: List of API keys based on the query paramters and + the page size. The apikeys array is always part of the response but might be + empty depending on the query parameters values provided. + """ + + def __init__( + self, + apikeys: List['ApiKey'], + *, + context: Optional['ResponseContext'] = None, + offset: Optional[int] = None, + limit: Optional[int] = None, + first: Optional[str] = None, + previous: Optional[str] = None, + next: Optional[str] = None, + ) -> None: + """ + Initialize a ApiKeyList object. + + :param List[ApiKey] apikeys: List of API keys based on the query paramters + and the page size. The apikeys array is always part of the response but + might be empty depending on the query parameters values provided. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 + items per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is + available. + :param str next: (optional) Link to the next available page. If 'next' + property is not part of the response no next page is available. + """ + self.context = context + self.offset = offset + self.limit = limit + self.first = first + self.previous = previous + self.next = next + self.apikeys = apikeys + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApiKeyList': + """Initialize a ApiKeyList object from a json dictionary.""" + args = {} + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (offset := _dict.get('offset')) is not None: + args['offset'] = offset + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (first := _dict.get('first')) is not None: + args['first'] = first + if (previous := _dict.get('previous')) is not None: + args['previous'] = previous + if (next := _dict.get('next')) is not None: + args['next'] = next + if (apikeys := _dict.get('apikeys')) is not None: + args['apikeys'] = [ApiKey.from_dict(v) for v in apikeys] + else: + raise ValueError('Required property \'apikeys\' not present in ApiKeyList JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApiKeyList object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first + if hasattr(self, 'previous') and self.previous is not None: + _dict['previous'] = self.previous + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next + if hasattr(self, 'apikeys') and self.apikeys is not None: + apikeys_list = [] + for v in self.apikeys: + if isinstance(v, dict): + apikeys_list.append(v) + else: + apikeys_list.append(v.to_dict()) + _dict['apikeys'] = apikeys_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApiKeyList object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApiKeyList') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApiKeyList') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApikeyActivity: + """ + Apikeys activity details. + + :param str id: Unique id of the apikey. + :param str name: (optional) Name provided during creation of the apikey. + :param str type: Type of the apikey. Supported values are `serviceid` and + `user`. + :param ApikeyActivityServiceid serviceid: (optional) serviceid details will be + present if type is `serviceid`. + :param ApikeyActivityUser user: (optional) user details will be present if type + is `user`. + :param str last_authn: (optional) Time when the apikey was last authenticated. + """ + + def __init__( + self, + id: str, + type: str, + *, + name: Optional[str] = None, + serviceid: Optional['ApikeyActivityServiceid'] = None, + user: Optional['ApikeyActivityUser'] = None, + last_authn: Optional[str] = None, + ) -> None: + """ + Initialize a ApikeyActivity object. + + :param str id: Unique id of the apikey. + :param str type: Type of the apikey. Supported values are `serviceid` and + `user`. + :param str name: (optional) Name provided during creation of the apikey. + :param ApikeyActivityServiceid serviceid: (optional) serviceid details will + be present if type is `serviceid`. + :param ApikeyActivityUser user: (optional) user details will be present if + type is `user`. + :param str last_authn: (optional) Time when the apikey was last + authenticated. + """ + self.id = id + self.name = name + self.type = type + self.serviceid = serviceid + self.user = user + self.last_authn = last_authn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApikeyActivity': + """Initialize a ApikeyActivity object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ApikeyActivity JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in ApikeyActivity JSON') + if (serviceid := _dict.get('serviceid')) is not None: + args['serviceid'] = ApikeyActivityServiceid.from_dict(serviceid) + if (user := _dict.get('user')) is not None: + args['user'] = ApikeyActivityUser.from_dict(user) + if (last_authn := _dict.get('last_authn')) is not None: + args['last_authn'] = last_authn + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApikeyActivity object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'serviceid') and self.serviceid is not None: + if isinstance(self.serviceid, dict): + _dict['serviceid'] = self.serviceid + else: + _dict['serviceid'] = self.serviceid.to_dict() + if hasattr(self, 'user') and self.user is not None: + if isinstance(self.user, dict): + _dict['user'] = self.user + else: + _dict['user'] = self.user.to_dict() + if hasattr(self, 'last_authn') and self.last_authn is not None: + _dict['last_authn'] = self.last_authn + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApikeyActivity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApikeyActivity') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApikeyActivity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApikeyActivityServiceid: + """ + serviceid details will be present if type is `serviceid`. + + :param str id: (optional) Unique identifier of this Service Id. + :param str name: (optional) Name provided during creation of the serviceid. + """ + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a ApikeyActivityServiceid object. + + :param str id: (optional) Unique identifier of this Service Id. + :param str name: (optional) Name provided during creation of the serviceid. + """ + self.id = id + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApikeyActivityServiceid': + """Initialize a ApikeyActivityServiceid object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApikeyActivityServiceid object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApikeyActivityServiceid object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApikeyActivityServiceid') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApikeyActivityServiceid') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ApikeyActivityUser: + """ + user details will be present if type is `user`. + + :param str iam_id: (optional) IAMid of the user. + :param str name: (optional) Name of the user. + :param str username: (optional) Username of the user. + :param str email: (optional) Email of the user. + """ + + def __init__( + self, + *, + iam_id: Optional[str] = None, + name: Optional[str] = None, + username: Optional[str] = None, + email: Optional[str] = None, + ) -> None: + """ + Initialize a ApikeyActivityUser object. + + :param str iam_id: (optional) IAMid of the user. + :param str name: (optional) Name of the user. + :param str username: (optional) Username of the user. + :param str email: (optional) Email of the user. + """ + self.iam_id = iam_id + self.name = name + self.username = username + self.email = email + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ApikeyActivityUser': + """Initialize a ApikeyActivityUser object from a json dictionary.""" + args = {} + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + if (name := _dict.get('name')) is not None: + args['name'] = name + if (username := _dict.get('username')) is not None: + args['username'] = username + if (email := _dict.get('email')) is not None: + args['email'] = email + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ApikeyActivityUser object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'username') and self.username is not None: + _dict['username'] = self.username + if hasattr(self, 'email') and self.email is not None: + _dict['email'] = self.email + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ApikeyActivityUser object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ApikeyActivityUser') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ApikeyActivityUser') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AssignedTemplatesAccountSettingsRestrictUserDomains: + """ + AssignedTemplatesAccountSettingsRestrictUserDomains. + + :param bool account_sufficient: (optional) + :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) + Defines if account invitations are restricted to specified domains. To remove an + entry for a realm_id, perform an update (PUT) request with only the realm_id + set. + """ + + def __init__( + self, + *, + account_sufficient: Optional[bool] = None, + restrictions: Optional[List['AccountSettingsUserDomainRestriction']] = None, + ) -> None: + """ + Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object. + + :param bool account_sufficient: (optional) + :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) + Defines if account invitations are restricted to specified domains. To + remove an entry for a realm_id, perform an update (PUT) request with only + the realm_id set. + """ + self.account_sufficient = account_sufficient + self.restrictions = restrictions + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AssignedTemplatesAccountSettingsRestrictUserDomains': + """Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object from a json dictionary.""" + args = {} + if (account_sufficient := _dict.get('account_sufficient')) is not None: + args['account_sufficient'] = account_sufficient + if (restrictions := _dict.get('restrictions')) is not None: + args['restrictions'] = [AccountSettingsUserDomainRestriction.from_dict(v) for v in restrictions] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'account_sufficient') and self.account_sufficient is not None: + _dict['account_sufficient'] = self.account_sufficient + if hasattr(self, 'restrictions') and self.restrictions is not None: + restrictions_list = [] + for v in self.restrictions: + if isinstance(v, dict): + restrictions_list.append(v) + else: + restrictions_list.append(v.to_dict()) + _dict['restrictions'] = restrictions_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AssignedTemplatesAccountSettingsRestrictUserDomains object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AssignedTemplatesAccountSettingsRestrictUserDomains') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AssignedTemplatesAccountSettingsRestrictUserDomains') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ConsumersResponse: + """ + ConsumersResponse. + + :param str idp_id: (optional) + :param List[ConsumersResponseConsumersItem] consumers: (optional) + """ + + def __init__( + self, + *, + idp_id: Optional[str] = None, + consumers: Optional[List['ConsumersResponseConsumersItem']] = None, + ) -> None: + """ + Initialize a ConsumersResponse object. + + :param str idp_id: (optional) + :param List[ConsumersResponseConsumersItem] consumers: (optional) + """ + self.idp_id = idp_id + self.consumers = consumers + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ConsumersResponse': + """Initialize a ConsumersResponse object from a json dictionary.""" + args = {} + if (idp_id := _dict.get('idp_id')) is not None: + args['idp_id'] = idp_id + if (consumers := _dict.get('consumers')) is not None: + args['consumers'] = [ConsumersResponseConsumersItem.from_dict(v) for v in consumers] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ConsumersResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'idp_id') and self.idp_id is not None: + _dict['idp_id'] = self.idp_id + if hasattr(self, 'consumers') and self.consumers is not None: + consumers_list = [] + for v in self.consumers: + if isinstance(v, dict): + consumers_list.append(v) + else: + consumers_list.append(v.to_dict()) + _dict['consumers'] = consumers_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ConsumersResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ConsumersResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ConsumersResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ConsumersResponseConsumersItem: + """ + ConsumersResponseConsumersItem. + + :param str account_id: (optional) + :param List[ShareScope] share_scope: (optional) + """ + + def __init__( + self, + *, + account_id: Optional[str] = None, + share_scope: Optional[List['ShareScope']] = None, + ) -> None: + """ + Initialize a ConsumersResponseConsumersItem object. + + :param str account_id: (optional) + :param List[ShareScope] share_scope: (optional) + """ + self.account_id = account_id + self.share_scope = share_scope + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ConsumersResponseConsumersItem': + """Initialize a ConsumersResponseConsumersItem object from a json dictionary.""" + args = {} + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + if (share_scope := _dict.get('share_scope')) is not None: + args['share_scope'] = [ShareScope.from_dict(v) for v in share_scope] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ConsumersResponseConsumersItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'share_scope') and self.share_scope is not None: + share_scope_list = [] + for v in self.share_scope: + if isinstance(v, dict): + share_scope_list.append(v) + else: + share_scope_list.append(v.to_dict()) + _dict['share_scope'] = share_scope_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ConsumersResponseConsumersItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ConsumersResponseConsumersItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ConsumersResponseConsumersItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestProperties: + """ + Properties of the IDP. Will be stored plain-text. + + :param CreateIdpRequestPropertiesIdp idp: (optional) Identity Provider + configuration. + :param CreateIdpRequestPropertiesSp sp: (optional) Service Provider + configuration. + """ + + def __init__( + self, + *, + idp: Optional['CreateIdpRequestPropertiesIdp'] = None, + sp: Optional['CreateIdpRequestPropertiesSp'] = None, + ) -> None: + """ + Initialize a CreateIdpRequestProperties object. + + :param CreateIdpRequestPropertiesIdp idp: (optional) Identity Provider + configuration. + :param CreateIdpRequestPropertiesSp sp: (optional) Service Provider + configuration. + """ + self.idp = idp + self.sp = sp + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestProperties': + """Initialize a CreateIdpRequestProperties object from a json dictionary.""" + args = {} + if (idp := _dict.get('idp')) is not None: + args['idp'] = CreateIdpRequestPropertiesIdp.from_dict(idp) + if (sp := _dict.get('sp')) is not None: + args['sp'] = CreateIdpRequestPropertiesSp.from_dict(sp) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestProperties object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'idp') and self.idp is not None: + if isinstance(self.idp, dict): + _dict['idp'] = self.idp + else: + _dict['idp'] = self.idp.to_dict() + if hasattr(self, 'sp') and self.sp is not None: + if isinstance(self.sp, dict): + _dict['sp'] = self.sp + else: + _dict['sp'] = self.sp.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestProperties object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestProperties') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestProperties') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestPropertiesIdp: + """ + Identity Provider configuration. + + :param bool xml_import: (optional) Flag indicating if IdP should be imported + from metadata.xml. + :param str entity_id: (optional) SAML IDP entity ID (required when not using + xml_import). + :param str redirect_binding_url: (optional) Redirect binding URL (required when + not using xml_import). + :param bool want_request_signed: (optional) Indicates if IDP wants requests to + be signed. + :param str logout_url: (optional) SAML IDP logout URL (optional). + """ + + def __init__( + self, + *, + xml_import: Optional[bool] = None, + entity_id: Optional[str] = None, + redirect_binding_url: Optional[str] = None, + want_request_signed: Optional[bool] = None, + logout_url: Optional[str] = None, + ) -> None: + """ + Initialize a CreateIdpRequestPropertiesIdp object. + + :param bool xml_import: (optional) Flag indicating if IdP should be + imported from metadata.xml. + :param str entity_id: (optional) SAML IDP entity ID (required when not + using xml_import). + :param str redirect_binding_url: (optional) Redirect binding URL (required + when not using xml_import). + :param bool want_request_signed: (optional) Indicates if IDP wants requests + to be signed. + :param str logout_url: (optional) SAML IDP logout URL (optional). + """ + self.xml_import = xml_import + self.entity_id = entity_id + self.redirect_binding_url = redirect_binding_url + self.want_request_signed = want_request_signed + self.logout_url = logout_url + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestPropertiesIdp': + """Initialize a CreateIdpRequestPropertiesIdp object from a json dictionary.""" + args = {} + if (xml_import := _dict.get('xml_import')) is not None: + args['xml_import'] = xml_import + if (entity_id := _dict.get('entity_id')) is not None: + args['entity_id'] = entity_id + if (redirect_binding_url := _dict.get('redirect_binding_url')) is not None: + args['redirect_binding_url'] = redirect_binding_url + if (want_request_signed := _dict.get('want_request_signed')) is not None: + args['want_request_signed'] = want_request_signed + if (logout_url := _dict.get('logout_url')) is not None: + args['logout_url'] = logout_url + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestPropertiesIdp object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'xml_import') and self.xml_import is not None: + _dict['xml_import'] = self.xml_import + if hasattr(self, 'entity_id') and self.entity_id is not None: + _dict['entity_id'] = self.entity_id + if hasattr(self, 'redirect_binding_url') and self.redirect_binding_url is not None: + _dict['redirect_binding_url'] = self.redirect_binding_url + if hasattr(self, 'want_request_signed') and self.want_request_signed is not None: + _dict['want_request_signed'] = self.want_request_signed + if hasattr(self, 'logout_url') and self.logout_url is not None: + _dict['logout_url'] = self.logout_url + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestPropertiesIdp object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestPropertiesIdp') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestPropertiesIdp') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestPropertiesSp: + """ + Service Provider configuration. + + :param bool want_assertion_signed: (optional) Indicates if SP wants assertions + to be signed. + :param bool want_response_signed: (optional) Indicates if SP wants responses to + be signed. + :param bool encrypt_response: (optional) Indicates if responses should be + encrypted. + :param bool idp_initiated_login_enabled: (optional) Enables IDP-initiated login. + :param bool logout_url_enabled_when_available: (optional) Enables logout URL + when available. + :param List[str] idp_initiated_urls: (optional) URLs for IDP-initiated login + (only when IdP initiated login is used). + :param CreateIdpRequestPropertiesSpAuthnContext authn_context: (optional) + Authentication context configuration (can be left empty to apply default). + :param dict claims: (optional) Custom mapping between SAML assertions and IAM + claims (can be left empty when no custom mapping is needed). + """ + + def __init__( + self, + *, + want_assertion_signed: Optional[bool] = None, + want_response_signed: Optional[bool] = None, + encrypt_response: Optional[bool] = None, + idp_initiated_login_enabled: Optional[bool] = None, + logout_url_enabled_when_available: Optional[bool] = None, + idp_initiated_urls: Optional[List[str]] = None, + authn_context: Optional['CreateIdpRequestPropertiesSpAuthnContext'] = None, + claims: Optional[dict] = None, + ) -> None: + """ + Initialize a CreateIdpRequestPropertiesSp object. + + :param bool want_assertion_signed: (optional) Indicates if SP wants + assertions to be signed. + :param bool want_response_signed: (optional) Indicates if SP wants + responses to be signed. + :param bool encrypt_response: (optional) Indicates if responses should be + encrypted. + :param bool idp_initiated_login_enabled: (optional) Enables IDP-initiated + login. + :param bool logout_url_enabled_when_available: (optional) Enables logout + URL when available. + :param List[str] idp_initiated_urls: (optional) URLs for IDP-initiated + login (only when IdP initiated login is used). + :param CreateIdpRequestPropertiesSpAuthnContext authn_context: (optional) + Authentication context configuration (can be left empty to apply default). + :param dict claims: (optional) Custom mapping between SAML assertions and + IAM claims (can be left empty when no custom mapping is needed). + """ + self.want_assertion_signed = want_assertion_signed + self.want_response_signed = want_response_signed + self.encrypt_response = encrypt_response + self.idp_initiated_login_enabled = idp_initiated_login_enabled + self.logout_url_enabled_when_available = logout_url_enabled_when_available + self.idp_initiated_urls = idp_initiated_urls + self.authn_context = authn_context + self.claims = claims + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestPropertiesSp': + """Initialize a CreateIdpRequestPropertiesSp object from a json dictionary.""" + args = {} + if (want_assertion_signed := _dict.get('want_assertion_signed')) is not None: + args['want_assertion_signed'] = want_assertion_signed + if (want_response_signed := _dict.get('want_response_signed')) is not None: + args['want_response_signed'] = want_response_signed + if (encrypt_response := _dict.get('encrypt_response')) is not None: + args['encrypt_response'] = encrypt_response + if (idp_initiated_login_enabled := _dict.get('idp_initiated_login_enabled')) is not None: + args['idp_initiated_login_enabled'] = idp_initiated_login_enabled + if (logout_url_enabled_when_available := _dict.get('logout_url_enabled_when_available')) is not None: + args['logout_url_enabled_when_available'] = logout_url_enabled_when_available + if (idp_initiated_urls := _dict.get('idp_initiated_urls')) is not None: + args['idp_initiated_urls'] = idp_initiated_urls + if (authn_context := _dict.get('authn_context')) is not None: + args['authn_context'] = CreateIdpRequestPropertiesSpAuthnContext.from_dict(authn_context) + if (claims := _dict.get('claims')) is not None: + args['claims'] = claims + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestPropertiesSp object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'want_assertion_signed') and self.want_assertion_signed is not None: + _dict['want_assertion_signed'] = self.want_assertion_signed + if hasattr(self, 'want_response_signed') and self.want_response_signed is not None: + _dict['want_response_signed'] = self.want_response_signed + if hasattr(self, 'encrypt_response') and self.encrypt_response is not None: + _dict['encrypt_response'] = self.encrypt_response + if hasattr(self, 'idp_initiated_login_enabled') and self.idp_initiated_login_enabled is not None: + _dict['idp_initiated_login_enabled'] = self.idp_initiated_login_enabled + if hasattr(self, 'logout_url_enabled_when_available') and self.logout_url_enabled_when_available is not None: + _dict['logout_url_enabled_when_available'] = self.logout_url_enabled_when_available + if hasattr(self, 'idp_initiated_urls') and self.idp_initiated_urls is not None: + _dict['idp_initiated_urls'] = self.idp_initiated_urls + if hasattr(self, 'authn_context') and self.authn_context is not None: + if isinstance(self.authn_context, dict): + _dict['authn_context'] = self.authn_context + else: + _dict['authn_context'] = self.authn_context.to_dict() + if hasattr(self, 'claims') and self.claims is not None: + _dict['claims'] = self.claims + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestPropertiesSp object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestPropertiesSp') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestPropertiesSp') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestPropertiesSpAuthnContext: + """ + Authentication context configuration (can be left empty to apply default). + + :param List[str] request: (optional) Requested authentication context classes. + :param List[str] accept: (optional) Accepted authentication context classes. + """ + + def __init__( + self, + *, + request: Optional[List[str]] = None, + accept: Optional[List[str]] = None, + ) -> None: + """ + Initialize a CreateIdpRequestPropertiesSpAuthnContext object. + + :param List[str] request: (optional) Requested authentication context + classes. + :param List[str] accept: (optional) Accepted authentication context + classes. + """ + self.request = request + self.accept = accept + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestPropertiesSpAuthnContext': + """Initialize a CreateIdpRequestPropertiesSpAuthnContext object from a json dictionary.""" + args = {} + if (request := _dict.get('request')) is not None: + args['request'] = request + if (accept := _dict.get('accept')) is not None: + args['accept'] = accept + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestPropertiesSpAuthnContext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'request') and self.request is not None: + _dict['request'] = self.request + if hasattr(self, 'accept') and self.accept is not None: + _dict['accept'] = self.accept + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestPropertiesSpAuthnContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestPropertiesSpAuthnContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestPropertiesSpAuthnContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestSecrets: + """ + Secrets of the IDP. Will be stored encrypted. + + :param CreateIdpRequestSecretsIdp idp: (optional) Identity Provider secrets. + :param CreateIdpRequestSecretsSp sp: (optional) Service Provider secrets (can be + left empty to auto-generate SP certs). """ def __init__( self, - template_id: str, - template_version: int, - template_name: str, *, - restrict_create_service_id: Optional[str] = None, - restrict_create_platform_apikey: Optional[str] = None, - allowed_ip_addresses: Optional[str] = None, - mfa: Optional[str] = None, - session_expiration_in_seconds: Optional[str] = None, - session_invalidation_in_seconds: Optional[str] = None, - max_sessions_per_identity: Optional[str] = None, - system_access_token_expiration_in_seconds: Optional[str] = None, - system_refresh_token_expiration_in_seconds: Optional[str] = None, - restrict_user_list_visibility: Optional[str] = None, - user_mfa: Optional[List['AccountSettingsUserMFAResponse']] = None, - restrict_user_domains: Optional['AssignedTemplatesAccountSettingsRestrictUserDomains'] = None, + idp: Optional['CreateIdpRequestSecretsIdp'] = None, + sp: Optional['CreateIdpRequestSecretsSp'] = None, ) -> None: """ - Initialize a AccountSettingsAssignedTemplatesSection object. + Initialize a CreateIdpRequestSecrets object. - :param str template_id: Template Id. - :param int template_version: Template version. - :param str template_name: Template name. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or - not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and - subnets from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period - of time in seconds in which a session will be invalidated due to - inactivity. Valid values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines - the access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines - the refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: (optional) Defines whether or not - user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the - account, such as those the user has invited to the account, or descendants - of those users based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the - Users page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. - :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of - users that are exempted from the MFA requirement of the account. - :param AssignedTemplatesAccountSettingsRestrictUserDomains - restrict_user_domains: (optional) + :param CreateIdpRequestSecretsIdp idp: (optional) Identity Provider + secrets. + :param CreateIdpRequestSecretsSp sp: (optional) Service Provider secrets + (can be left empty to auto-generate SP certs). """ - self.template_id = template_id - self.template_version = template_version - self.template_name = template_name - self.restrict_create_service_id = restrict_create_service_id - self.restrict_create_platform_apikey = restrict_create_platform_apikey - self.allowed_ip_addresses = allowed_ip_addresses - self.mfa = mfa - self.session_expiration_in_seconds = session_expiration_in_seconds - self.session_invalidation_in_seconds = session_invalidation_in_seconds - self.max_sessions_per_identity = max_sessions_per_identity - self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds - self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds - self.restrict_user_list_visibility = restrict_user_list_visibility - self.user_mfa = user_mfa - self.restrict_user_domains = restrict_user_domains + self.idp = idp + self.sp = sp @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsAssignedTemplatesSection': - """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecrets': + """Initialize a CreateIdpRequestSecrets object from a json dictionary.""" args = {} - if (template_id := _dict.get('template_id')) is not None: - args['template_id'] = template_id - else: - raise ValueError( - 'Required property \'template_id\' not present in AccountSettingsAssignedTemplatesSection JSON' - ) - if (template_version := _dict.get('template_version')) is not None: - args['template_version'] = template_version - else: - raise ValueError( - 'Required property \'template_version\' not present in AccountSettingsAssignedTemplatesSection JSON' - ) - if (template_name := _dict.get('template_name')) is not None: - args['template_name'] = template_name - else: - raise ValueError( - 'Required property \'template_name\' not present in AccountSettingsAssignedTemplatesSection JSON' - ) - if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: - args['restrict_create_service_id'] = restrict_create_service_id - if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: - args['restrict_create_platform_apikey'] = restrict_create_platform_apikey - if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: - args['allowed_ip_addresses'] = allowed_ip_addresses - if (mfa := _dict.get('mfa')) is not None: - args['mfa'] = mfa - if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: - args['session_expiration_in_seconds'] = session_expiration_in_seconds - if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: - args['session_invalidation_in_seconds'] = session_invalidation_in_seconds - if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: - args['max_sessions_per_identity'] = max_sessions_per_identity - if ( - system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') - ) is not None: - args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds - if ( - system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') - ) is not None: - args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds - if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: - args['restrict_user_list_visibility'] = restrict_user_list_visibility - if (user_mfa := _dict.get('user_mfa')) is not None: - args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] - if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: - args['restrict_user_domains'] = AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( - restrict_user_domains - ) + if (idp := _dict.get('idp')) is not None: + args['idp'] = CreateIdpRequestSecretsIdp.from_dict(idp) + if (sp := _dict.get('sp')) is not None: + args['sp'] = CreateIdpRequestSecretsSp.from_dict(sp) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsAssignedTemplatesSection object from a json dictionary.""" + """Initialize a CreateIdpRequestSecrets object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'template_id') and self.template_id is not None: - _dict['template_id'] = self.template_id - if hasattr(self, 'template_version') and self.template_version is not None: - _dict['template_version'] = self.template_version - if hasattr(self, 'template_name') and self.template_name is not None: - _dict['template_name'] = self.template_name - if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: - _dict['restrict_create_service_id'] = self.restrict_create_service_id - if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: - _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey - if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: - _dict['allowed_ip_addresses'] = self.allowed_ip_addresses - if hasattr(self, 'mfa') and self.mfa is not None: - _dict['mfa'] = self.mfa - if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: - _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds - if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: - _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds - if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: - _dict['max_sessions_per_identity'] = self.max_sessions_per_identity - if ( - hasattr(self, 'system_access_token_expiration_in_seconds') - and self.system_access_token_expiration_in_seconds is not None - ): - _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds - if ( - hasattr(self, 'system_refresh_token_expiration_in_seconds') - and self.system_refresh_token_expiration_in_seconds is not None - ): - _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds - if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: - _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility - if hasattr(self, 'user_mfa') and self.user_mfa is not None: - user_mfa_list = [] - for v in self.user_mfa: - if isinstance(v, dict): - user_mfa_list.append(v) - else: - user_mfa_list.append(v.to_dict()) - _dict['user_mfa'] = user_mfa_list - if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: - if isinstance(self.restrict_user_domains, dict): - _dict['restrict_user_domains'] = self.restrict_user_domains + if hasattr(self, 'idp') and self.idp is not None: + if isinstance(self.idp, dict): + _dict['idp'] = self.idp else: - _dict['restrict_user_domains'] = self.restrict_user_domains.to_dict() + _dict['idp'] = self.idp.to_dict() + if hasattr(self, 'sp') and self.sp is not None: + if isinstance(self.sp, dict): + _dict['sp'] = self.sp + else: + _dict['sp'] = self.sp.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestSecrets object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestSecrets') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestSecrets') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CreateIdpRequestSecretsIdp: + """ + Identity Provider secrets. + + :param bool xml_import: (optional) Flag indicating if secrets should be imported + from metadata.xml. + :param List[CreateIdpRequestSecretsIdpSigningItem] signing: (optional) IDP + signing certificates (required when not using xml_import). + :param List[CreateIdpRequestSecretsIdpEncryptingItem] encrypting: (optional) IDP + encrypting certificates (optional). + """ + + def __init__( + self, + *, + xml_import: Optional[bool] = None, + signing: Optional[List['CreateIdpRequestSecretsIdpSigningItem']] = None, + encrypting: Optional[List['CreateIdpRequestSecretsIdpEncryptingItem']] = None, + ) -> None: + """ + Initialize a CreateIdpRequestSecretsIdp object. + + :param bool xml_import: (optional) Flag indicating if secrets should be + imported from metadata.xml. + :param List[CreateIdpRequestSecretsIdpSigningItem] signing: (optional) IDP + signing certificates (required when not using xml_import). + :param List[CreateIdpRequestSecretsIdpEncryptingItem] encrypting: + (optional) IDP encrypting certificates (optional). + """ + self.xml_import = xml_import + self.signing = signing + self.encrypting = encrypting + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecretsIdp': + """Initialize a CreateIdpRequestSecretsIdp object from a json dictionary.""" + args = {} + if (xml_import := _dict.get('xml_import')) is not None: + args['xml_import'] = xml_import + if (signing := _dict.get('signing')) is not None: + args['signing'] = [CreateIdpRequestSecretsIdpSigningItem.from_dict(v) for v in signing] + if (encrypting := _dict.get('encrypting')) is not None: + args['encrypting'] = [CreateIdpRequestSecretsIdpEncryptingItem.from_dict(v) for v in encrypting] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestSecretsIdp object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'xml_import') and self.xml_import is not None: + _dict['xml_import'] = self.xml_import + if hasattr(self, 'signing') and self.signing is not None: + signing_list = [] + for v in self.signing: + if isinstance(v, dict): + signing_list.append(v) + else: + signing_list.append(v.to_dict()) + _dict['signing'] = signing_list + if hasattr(self, 'encrypting') and self.encrypting is not None: + encrypting_list = [] + for v in self.encrypting: + if isinstance(v, dict): + encrypting_list.append(v) + else: + encrypting_list.append(v.to_dict()) + _dict['encrypting'] = encrypting_list return _dict def _to_dict(self): @@ -6316,296 +10715,213 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsAssignedTemplatesSection object.""" + """Return a `str` version of this CreateIdpRequestSecretsIdp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool: + def __eq__(self, other: 'CreateIdpRequestSecretsIdp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsAssignedTemplatesSection') -> bool: + def __ne__(self, other: 'CreateIdpRequestSecretsIdp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RestrictCreateServiceIdEnum(str, Enum): - """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - """ - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' +class CreateIdpRequestSecretsIdpEncryptingItem: + """ + CreateIdpRequestSecretsIdpEncryptingItem. - class RestrictCreatePlatformApikeyEnum(str, Enum): + :param str value: (optional) Certificate value. + :param str type: (optional) Certificate type. + """ + + def __init__( + self, + *, + value: Optional[str] = None, + type: Optional[str] = None, + ) -> None: """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. + Initialize a CreateIdpRequestSecretsIdpEncryptingItem object. + + :param str value: (optional) Certificate value. + :param str type: (optional) Certificate type. """ + self.value = value + self.type = type - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecretsIdpEncryptingItem': + """Initialize a CreateIdpRequestSecretsIdpEncryptingItem object from a json dictionary.""" + args = {} + if (value := _dict.get('value')) is not None: + args['value'] = value + if (type := _dict.get('type')) is not None: + args['type'] = type + return cls(**args) - class MfaEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestSecretsIdpEncryptingItem object from a json dictionary.""" + return cls.from_dict(_dict) - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict - class RestrictUserListVisibilityEnum(str, Enum): + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestSecretsIdpEncryptingItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestSecretsIdpEncryptingItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestSecretsIdpEncryptingItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): """ - Defines whether or not user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, such - as those the user has invited to the account, or descendants of those users based - on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. + Certificate type. """ - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' + PRIMARY = 'primary' + SECONDARY = 'secondary' -class AccountSettingsEffectiveSection: +class CreateIdpRequestSecretsIdpSigningItem: """ - AccountSettingsEffectiveSection. + CreateIdpRequestSecretsIdpSigningItem. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_user_list_visibility: (optional) Defines whether or not user - visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, - such as those the user has invited to the account, or descendants of those users - based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets - from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of users - that are exempted from the MFA requirement of the account. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period of - time in seconds in which a session will be invalidated due to inactivity. Valid - values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines the - access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines the - refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. + :param str value: (optional) Certificate value in PEM format. + :param str type: (optional) Certificate type. """ def __init__( self, *, - restrict_create_service_id: Optional[str] = None, - restrict_create_platform_apikey: Optional[str] = None, - restrict_user_list_visibility: Optional[str] = None, - allowed_ip_addresses: Optional[str] = None, - mfa: Optional[str] = None, - user_mfa: Optional[List['AccountSettingsUserMFAResponse']] = None, - session_expiration_in_seconds: Optional[str] = None, - session_invalidation_in_seconds: Optional[str] = None, - max_sessions_per_identity: Optional[str] = None, - system_access_token_expiration_in_seconds: Optional[str] = None, - system_refresh_token_expiration_in_seconds: Optional[str] = None, + value: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a AccountSettingsEffectiveSection object. + Initialize a CreateIdpRequestSecretsIdpSigningItem object. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or - not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_user_list_visibility: (optional) Defines whether or not - user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the - account, such as those the user has invited to the account, or descendants - of those users based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the - Users page in IBM Cloud console. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and - subnets from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param List[AccountSettingsUserMFAResponse] user_mfa: (optional) List of - users that are exempted from the MFA requirement of the account. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period - of time in seconds in which a session will be invalidated due to - inactivity. Valid values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines - the access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines - the refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. + :param str value: (optional) Certificate value in PEM format. + :param str type: (optional) Certificate type. + """ + self.value = value + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecretsIdpSigningItem': + """Initialize a CreateIdpRequestSecretsIdpSigningItem object from a json dictionary.""" + args = {} + if (value := _dict.get('value')) is not None: + args['value'] = value + if (type := _dict.get('type')) is not None: + args['type'] = type + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestSecretsIdpSigningItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestSecretsIdpSigningItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestSecretsIdpSigningItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestSecretsIdpSigningItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): """ - self.restrict_create_service_id = restrict_create_service_id - self.restrict_create_platform_apikey = restrict_create_platform_apikey - self.restrict_user_list_visibility = restrict_user_list_visibility - self.allowed_ip_addresses = allowed_ip_addresses - self.mfa = mfa - self.user_mfa = user_mfa - self.session_expiration_in_seconds = session_expiration_in_seconds - self.session_invalidation_in_seconds = session_invalidation_in_seconds - self.max_sessions_per_identity = max_sessions_per_identity - self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds - self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds + Certificate type. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + + +class CreateIdpRequestSecretsSp: + """ + Service Provider secrets (can be left empty to auto-generate SP certs). + + :param List[CreateIdpRequestSecretsSpSigningItem] signing: (optional) SP signing + certificates. + """ + + def __init__( + self, + *, + signing: Optional[List['CreateIdpRequestSecretsSpSigningItem']] = None, + ) -> None: + """ + Initialize a CreateIdpRequestSecretsSp object. + + :param List[CreateIdpRequestSecretsSpSigningItem] signing: (optional) SP + signing certificates. + """ + self.signing = signing @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsEffectiveSection': - """Initialize a AccountSettingsEffectiveSection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecretsSp': + """Initialize a CreateIdpRequestSecretsSp object from a json dictionary.""" args = {} - if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: - args['restrict_create_service_id'] = restrict_create_service_id - if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: - args['restrict_create_platform_apikey'] = restrict_create_platform_apikey - if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: - args['restrict_user_list_visibility'] = restrict_user_list_visibility - if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: - args['allowed_ip_addresses'] = allowed_ip_addresses - if (mfa := _dict.get('mfa')) is not None: - args['mfa'] = mfa - if (user_mfa := _dict.get('user_mfa')) is not None: - args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] - if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: - args['session_expiration_in_seconds'] = session_expiration_in_seconds - if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: - args['session_invalidation_in_seconds'] = session_invalidation_in_seconds - if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: - args['max_sessions_per_identity'] = max_sessions_per_identity - if ( - system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') - ) is not None: - args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds - if ( - system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') - ) is not None: - args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + if (signing := _dict.get('signing')) is not None: + args['signing'] = [CreateIdpRequestSecretsSpSigningItem.from_dict(v) for v in signing] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsEffectiveSection object from a json dictionary.""" + """Initialize a CreateIdpRequestSecretsSp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: - _dict['restrict_create_service_id'] = self.restrict_create_service_id - if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: - _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey - if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: - _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility - if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: - _dict['allowed_ip_addresses'] = self.allowed_ip_addresses - if hasattr(self, 'mfa') and self.mfa is not None: - _dict['mfa'] = self.mfa - if hasattr(self, 'user_mfa') and self.user_mfa is not None: - user_mfa_list = [] - for v in self.user_mfa: + if hasattr(self, 'signing') and self.signing is not None: + signing_list = [] + for v in self.signing: if isinstance(v, dict): - user_mfa_list.append(v) + signing_list.append(v) else: - user_mfa_list.append(v.to_dict()) - _dict['user_mfa'] = user_mfa_list - if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: - _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds - if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: - _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds - if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: - _dict['max_sessions_per_identity'] = self.max_sessions_per_identity - if ( - hasattr(self, 'system_access_token_expiration_in_seconds') - and self.system_access_token_expiration_in_seconds is not None - ): - _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds - if ( - hasattr(self, 'system_refresh_token_expiration_in_seconds') - and self.system_refresh_token_expiration_in_seconds is not None - ): - _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds + signing_list.append(v.to_dict()) + _dict['signing'] = signing_list return _dict def _to_dict(self): @@ -6613,339 +10929,278 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsEffectiveSection object.""" + """Return a `str` version of this CreateIdpRequestSecretsSp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsEffectiveSection') -> bool: + def __eq__(self, other: 'CreateIdpRequestSecretsSp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsEffectiveSection') -> bool: + def __ne__(self, other: 'CreateIdpRequestSecretsSp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RestrictCreateServiceIdEnum(str, Enum): - """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - """ - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' +class CreateIdpRequestSecretsSpSigningItem: + """ + CreateIdpRequestSecretsSpSigningItem. - class RestrictCreatePlatformApikeyEnum(str, Enum): + :param str certificate_value: (optional) Certificate value in PEM format. + :param str key_value: (optional) Private key value. + :param str key_encoding: (optional) Key encoding format (e.g., pkcs8). + :param str type: (optional) Certificate type. + """ + + def __init__( + self, + *, + certificate_value: Optional[str] = None, + key_value: Optional[str] = None, + key_encoding: Optional[str] = None, + type: Optional[str] = None, + ) -> None: """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. + Initialize a CreateIdpRequestSecretsSpSigningItem object. + + :param str certificate_value: (optional) Certificate value in PEM format. + :param str key_value: (optional) Private key value. + :param str key_encoding: (optional) Key encoding format (e.g., pkcs8). + :param str type: (optional) Certificate type. """ + self.certificate_value = certificate_value + self.key_value = key_value + self.key_encoding = key_encoding + self.type = type - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateIdpRequestSecretsSpSigningItem': + """Initialize a CreateIdpRequestSecretsSpSigningItem object from a json dictionary.""" + args = {} + if (certificate_value := _dict.get('certificate_value')) is not None: + args['certificate_value'] = certificate_value + if (key_value := _dict.get('key_value')) is not None: + args['key_value'] = key_value + if (key_encoding := _dict.get('key_encoding')) is not None: + args['key_encoding'] = key_encoding + if (type := _dict.get('type')) is not None: + args['type'] = type + return cls(**args) - class RestrictUserListVisibilityEnum(str, Enum): + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateIdpRequestSecretsSpSigningItem object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'certificate_value') and self.certificate_value is not None: + _dict['certificate_value'] = self.certificate_value + if hasattr(self, 'key_value') and self.key_value is not None: + _dict['key_value'] = self.key_value + if hasattr(self, 'key_encoding') and self.key_encoding is not None: + _dict['key_encoding'] = self.key_encoding + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CreateIdpRequestSecretsSpSigningItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CreateIdpRequestSecretsSpSigningItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateIdpRequestSecretsSpSigningItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): """ - Defines whether or not user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, such - as those the user has invited to the account, or descendants of those users based - on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console. + Certificate type. """ - NOT_RESTRICTED = 'NOT_RESTRICTED' - RESTRICTED = 'RESTRICTED' + PRIMARY = 'primary' + SECONDARY = 'secondary' - class MfaEnum(str, Enum): + +class CreateProfileLinkRequestLink: + """ + Link details. + + :param str crn: The CRN of the compute resource. + :param str namespace: (optional) The compute resource namespace, only required + if cr_type is IKS_SA or ROKS_SA. + :param str name: (optional) Name of the compute resource, only required if + cr_type is IKS_SA or ROKS_SA. + :param str component_type: (optional) Component type of the compute resource, + only required if cr_type is CE. + :param str component_name: (optional) Component name of the compute resource, + only required if cr_type is CE. + """ + + def __init__( + self, + crn: str, + *, + namespace: Optional[str] = None, + name: Optional[str] = None, + component_type: Optional[str] = None, + component_name: Optional[str] = None, + ) -> None: """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. + Initialize a CreateProfileLinkRequestLink object. + + :param str crn: The CRN of the compute resource. + :param str namespace: (optional) The compute resource namespace, only + required if cr_type is IKS_SA or ROKS_SA. + :param str name: (optional) Name of the compute resource, only required if + cr_type is IKS_SA or ROKS_SA. + :param str component_type: (optional) Component type of the compute + resource, only required if cr_type is CE. + :param str component_name: (optional) Component name of the compute + resource, only required if cr_type is CE. """ + self.crn = crn + self.namespace = namespace + self.name = name + self.component_type = component_type + self.component_name = component_name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CreateProfileLinkRequestLink': + """Initialize a CreateProfileLinkRequestLink object from a json dictionary.""" + args = {} + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in CreateProfileLinkRequestLink JSON') + if (namespace := _dict.get('namespace')) is not None: + args['namespace'] = namespace + if (name := _dict.get('name')) is not None: + args['name'] = name + if (component_type := _dict.get('component_type')) is not None: + args['component_type'] = component_type + if (component_name := _dict.get('component_name')) is not None: + args['component_name'] = component_name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CreateProfileLinkRequestLink object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'namespace') and self.namespace is not None: + _dict['namespace'] = self.namespace + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'component_type') and self.component_type is not None: + _dict['component_type'] = self.component_type + if hasattr(self, 'component_name') and self.component_name is not None: + _dict['component_name'] = self.component_name + return _dict - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this CreateProfileLinkRequestLink object.""" + return json.dumps(self.to_dict(), indent=2) -class AccountSettingsResponse: + def __eq__(self, other: 'CreateProfileLinkRequestLink') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CreateProfileLinkRequestLink') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class EffectiveAccountSettingsResponse: """ - Input body parameters for the Account Settings REST request. + Response body format for Account Settings REST requests. :param ResponseContext context: (optional) Context with key properties for problem determination. :param str account_id: Unique ID of the account. - :param str entity_tag: Version of the account settings. - :param List[EnityHistoryRecord] history: (optional) History of the Account - Settings. - :param str restrict_create_service_id: Defines whether or not creating the - resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: Defines whether or not creating the - resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: Defines the IP addresses and subnets from which - IAM tokens can be created for the account. - :param str mfa: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str session_expiration_in_seconds: Defines the session expiration in - seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: Defines the period of time in - seconds in which a session will be invalidated due to inactivity. Valid values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: Defines the max allowed sessions per - identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: Defines the access token - expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: Defines the refresh token - expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: Defines whether or not user visibility - is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, - such as those the user has invited to the account, or descendants of those users - based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console. - :param List[AccountSettingsUserMFAResponse] user_mfa: List of users that are - exempted from the MFA requirement of the account. - :param List[AccountSettingsUserDomainRestriction] restrict_user_domains: Defines - if account invitations are restricted to specified domains. To remove an entry - for a realm_id, perform an update (PUT) request with only the realm_id set. + :param AccountSettingsEffectiveSection effective: + :param AccountSettingsResponse account: Input body parameters for the Account + Settings REST request. + :param List[AccountSettingsAssignedTemplatesSection] assigned_templates: + (optional) assigned template section. """ def __init__( self, account_id: str, - entity_tag: str, - restrict_create_service_id: str, - restrict_create_platform_apikey: str, - allowed_ip_addresses: str, - mfa: str, - session_expiration_in_seconds: str, - session_invalidation_in_seconds: str, - max_sessions_per_identity: str, - system_access_token_expiration_in_seconds: str, - system_refresh_token_expiration_in_seconds: str, - restrict_user_list_visibility: str, - user_mfa: List['AccountSettingsUserMFAResponse'], - restrict_user_domains: List['AccountSettingsUserDomainRestriction'], + effective: 'AccountSettingsEffectiveSection', + account: 'AccountSettingsResponse', *, context: Optional['ResponseContext'] = None, - history: Optional[List['EnityHistoryRecord']] = None, + assigned_templates: Optional[List['AccountSettingsAssignedTemplatesSection']] = None, ) -> None: """ - Initialize a AccountSettingsResponse object. + Initialize a EffectiveAccountSettingsResponse object. :param str account_id: Unique ID of the account. - :param str entity_tag: Version of the account settings. - :param str restrict_create_service_id: Defines whether or not creating the - resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: Defines whether or not creating - the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: Defines the IP addresses and subnets from - which IAM tokens can be created for the account. - :param str mfa: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str session_expiration_in_seconds: Defines the session expiration in - seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: Defines the period of time in - seconds in which a session will be invalidated due to inactivity. Valid - values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: Defines the max allowed sessions per - identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: Defines the access - token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: Defines the refresh - token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: Defines whether or not user - visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the - account, such as those the user has invited to the account, or descendants - of those users based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the - Users page in IBM Cloud console. - :param List[AccountSettingsUserMFAResponse] user_mfa: List of users that - are exempted from the MFA requirement of the account. - :param List[AccountSettingsUserDomainRestriction] restrict_user_domains: - Defines if account invitations are restricted to specified domains. To - remove an entry for a realm_id, perform an update (PUT) request with only - the realm_id set. + :param AccountSettingsEffectiveSection effective: + :param AccountSettingsResponse account: Input body parameters for the + Account Settings REST request. :param ResponseContext context: (optional) Context with key properties for problem determination. - :param List[EnityHistoryRecord] history: (optional) History of the Account - Settings. + :param List[AccountSettingsAssignedTemplatesSection] assigned_templates: + (optional) assigned template section. """ - self.context = context - self.account_id = account_id - self.entity_tag = entity_tag - self.history = history - self.restrict_create_service_id = restrict_create_service_id - self.restrict_create_platform_apikey = restrict_create_platform_apikey - self.allowed_ip_addresses = allowed_ip_addresses - self.mfa = mfa - self.session_expiration_in_seconds = session_expiration_in_seconds - self.session_invalidation_in_seconds = session_invalidation_in_seconds - self.max_sessions_per_identity = max_sessions_per_identity - self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds - self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds - self.restrict_user_list_visibility = restrict_user_list_visibility - self.user_mfa = user_mfa - self.restrict_user_domains = restrict_user_domains - - @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse': - """Initialize a AccountSettingsResponse object from a json dictionary.""" - args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in AccountSettingsResponse JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - else: - raise ValueError('Required property \'entity_tag\' not present in AccountSettingsResponse JSON') - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: - args['restrict_create_service_id'] = restrict_create_service_id - else: - raise ValueError( - 'Required property \'restrict_create_service_id\' not present in AccountSettingsResponse JSON' - ) - if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: - args['restrict_create_platform_apikey'] = restrict_create_platform_apikey - else: - raise ValueError( - 'Required property \'restrict_create_platform_apikey\' not present in AccountSettingsResponse JSON' - ) - if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: - args['allowed_ip_addresses'] = allowed_ip_addresses - else: - raise ValueError('Required property \'allowed_ip_addresses\' not present in AccountSettingsResponse JSON') - if (mfa := _dict.get('mfa')) is not None: - args['mfa'] = mfa - else: - raise ValueError('Required property \'mfa\' not present in AccountSettingsResponse JSON') - if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: - args['session_expiration_in_seconds'] = session_expiration_in_seconds - else: - raise ValueError( - 'Required property \'session_expiration_in_seconds\' not present in AccountSettingsResponse JSON' - ) - if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: - args['session_invalidation_in_seconds'] = session_invalidation_in_seconds - else: - raise ValueError( - 'Required property \'session_invalidation_in_seconds\' not present in AccountSettingsResponse JSON' - ) - if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: - args['max_sessions_per_identity'] = max_sessions_per_identity - else: - raise ValueError( - 'Required property \'max_sessions_per_identity\' not present in AccountSettingsResponse JSON' - ) - if ( - system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') - ) is not None: - args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds - else: - raise ValueError( - 'Required property \'system_access_token_expiration_in_seconds\' not present in AccountSettingsResponse JSON' - ) - if ( - system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') - ) is not None: - args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + self.context = context + self.account_id = account_id + self.effective = effective + self.account = account + self.assigned_templates = assigned_templates + + @classmethod + def from_dict(cls, _dict: Dict) -> 'EffectiveAccountSettingsResponse': + """Initialize a EffectiveAccountSettingsResponse object from a json dictionary.""" + args = {} + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id else: - raise ValueError( - 'Required property \'system_refresh_token_expiration_in_seconds\' not present in AccountSettingsResponse JSON' - ) - if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: - args['restrict_user_list_visibility'] = restrict_user_list_visibility + raise ValueError('Required property \'account_id\' not present in EffectiveAccountSettingsResponse JSON') + if (effective := _dict.get('effective')) is not None: + args['effective'] = AccountSettingsEffectiveSection.from_dict(effective) else: - raise ValueError( - 'Required property \'restrict_user_list_visibility\' not present in AccountSettingsResponse JSON' - ) - if (user_mfa := _dict.get('user_mfa')) is not None: - args['user_mfa'] = [AccountSettingsUserMFAResponse.from_dict(v) for v in user_mfa] + raise ValueError('Required property \'effective\' not present in EffectiveAccountSettingsResponse JSON') + if (account := _dict.get('account')) is not None: + args['account'] = AccountSettingsResponse.from_dict(account) else: - raise ValueError('Required property \'user_mfa\' not present in AccountSettingsResponse JSON') - if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: - args['restrict_user_domains'] = [ - AccountSettingsUserDomainRestriction.from_dict(v) for v in restrict_user_domains + raise ValueError('Required property \'account\' not present in EffectiveAccountSettingsResponse JSON') + if (assigned_templates := _dict.get('assigned_templates')) is not None: + args['assigned_templates'] = [ + AccountSettingsAssignedTemplatesSection.from_dict(v) for v in assigned_templates ] - else: - raise ValueError('Required property \'restrict_user_domains\' not present in AccountSettingsResponse JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsResponse object from a json dictionary.""" + """Initialize a EffectiveAccountSettingsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -6958,58 +11213,24 @@ def to_dict(self) -> Dict: _dict['context'] = self.context.to_dict() if hasattr(self, 'account_id') and self.account_id is not None: _dict['account_id'] = self.account_id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: - if isinstance(v, dict): - history_list.append(v) - else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: - _dict['restrict_create_service_id'] = self.restrict_create_service_id - if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: - _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey - if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: - _dict['allowed_ip_addresses'] = self.allowed_ip_addresses - if hasattr(self, 'mfa') and self.mfa is not None: - _dict['mfa'] = self.mfa - if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: - _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds - if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: - _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds - if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: - _dict['max_sessions_per_identity'] = self.max_sessions_per_identity - if ( - hasattr(self, 'system_access_token_expiration_in_seconds') - and self.system_access_token_expiration_in_seconds is not None - ): - _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds - if ( - hasattr(self, 'system_refresh_token_expiration_in_seconds') - and self.system_refresh_token_expiration_in_seconds is not None - ): - _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds - if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: - _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility - if hasattr(self, 'user_mfa') and self.user_mfa is not None: - user_mfa_list = [] - for v in self.user_mfa: - if isinstance(v, dict): - user_mfa_list.append(v) - else: - user_mfa_list.append(v.to_dict()) - _dict['user_mfa'] = user_mfa_list - if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: - restrict_user_domains_list = [] - for v in self.restrict_user_domains: + if hasattr(self, 'effective') and self.effective is not None: + if isinstance(self.effective, dict): + _dict['effective'] = self.effective + else: + _dict['effective'] = self.effective.to_dict() + if hasattr(self, 'account') and self.account is not None: + if isinstance(self.account, dict): + _dict['account'] = self.account + else: + _dict['account'] = self.account.to_dict() + if hasattr(self, 'assigned_templates') and self.assigned_templates is not None: + assigned_templates_list = [] + for v in self.assigned_templates: if isinstance(v, dict): - restrict_user_domains_list.append(v) + assigned_templates_list.append(v) else: - restrict_user_domains_list.append(v.to_dict()) - _dict['restrict_user_domains'] = restrict_user_domains_list + assigned_templates_list.append(v.to_dict()) + _dict['assigned_templates'] = assigned_templates_list return _dict def _to_dict(self): @@ -7017,193 +11238,186 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsResponse object.""" + """Return a `str` version of this EffectiveAccountSettingsResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsResponse') -> bool: + def __eq__(self, other: 'EffectiveAccountSettingsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsResponse') -> bool: + def __ne__(self, other: 'EffectiveAccountSettingsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RestrictCreateServiceIdEnum(str, Enum): - """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - """ - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' +class EnityHistoryRecord: + """ + Response body format for an entity history record. - class RestrictCreatePlatformApikeyEnum(str, Enum): + :param str timestamp: Timestamp when the action was triggered. + :param str iam_id: IAM ID of the identity which triggered the action. + :param str iam_id_account: Account of the identity which triggered the action. + :param str action: Action of the history entry. + :param List[str] params: Params of the history entry. + :param str message: Message which summarizes the executed action. + """ + + def __init__( + self, + timestamp: str, + iam_id: str, + iam_id_account: str, + action: str, + params: List[str], + message: str, + ) -> None: """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. + Initialize a EnityHistoryRecord object. + + :param str timestamp: Timestamp when the action was triggered. + :param str iam_id: IAM ID of the identity which triggered the action. + :param str iam_id_account: Account of the identity which triggered the + action. + :param str action: Action of the history entry. + :param List[str] params: Params of the history entry. + :param str message: Message which summarizes the executed action. """ + self.timestamp = timestamp + self.iam_id = iam_id + self.iam_id_account = iam_id_account + self.action = action + self.params = params + self.message = message - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' + @classmethod + def from_dict(cls, _dict: Dict) -> 'EnityHistoryRecord': + """Initialize a EnityHistoryRecord object from a json dictionary.""" + args = {} + if (timestamp := _dict.get('timestamp')) is not None: + args['timestamp'] = timestamp + else: + raise ValueError('Required property \'timestamp\' not present in EnityHistoryRecord JSON') + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + else: + raise ValueError('Required property \'iam_id\' not present in EnityHistoryRecord JSON') + if (iam_id_account := _dict.get('iam_id_account')) is not None: + args['iam_id_account'] = iam_id_account + else: + raise ValueError('Required property \'iam_id_account\' not present in EnityHistoryRecord JSON') + if (action := _dict.get('action')) is not None: + args['action'] = action + else: + raise ValueError('Required property \'action\' not present in EnityHistoryRecord JSON') + if (params := _dict.get('params')) is not None: + args['params'] = params + else: + raise ValueError('Required property \'params\' not present in EnityHistoryRecord JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in EnityHistoryRecord JSON') + return cls(**args) - class MfaEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a EnityHistoryRecord object from a json dictionary.""" + return cls.from_dict(_dict) - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'timestamp') and self.timestamp is not None: + _dict['timestamp'] = self.timestamp + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'iam_id_account') and self.iam_id_account is not None: + _dict['iam_id_account'] = self.iam_id_account + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'params') and self.params is not None: + _dict['params'] = self.params + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + return _dict - class RestrictUserListVisibilityEnum(str, Enum): - """ - Defines whether or not user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, such - as those the user has invited to the account, or descendants of those users based - on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this EnityHistoryRecord object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'EnityHistoryRecord') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - NOT_RESTRICTED = 'NOT_RESTRICTED' - RESTRICTED = 'RESTRICTED' + def __ne__(self, other: 'EnityHistoryRecord') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class AccountSettingsTemplateList: +class EntityActivity: """ - AccountSettingsTemplateList. + EntityActivity. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is available. - :param str next: (optional) Link to the next available page. If 'next' property - is not part of the response no next page is available. - :param List[AccountSettingsTemplateResponse] account_settings_templates: List of - account settings templates based on the query paramters and the page size. The - account_settings_templates array is always part of the response but might be - empty depending on the query parameter values provided. + :param str id: Unique id of the entity. + :param str name: (optional) Name provided during creation of the entity. + :param str last_authn: (optional) Time when the entity was last authenticated. """ def __init__( self, - account_settings_templates: List['AccountSettingsTemplateResponse'], + id: str, *, - context: Optional['ResponseContext'] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, - first: Optional[str] = None, - previous: Optional[str] = None, - next: Optional[str] = None, + name: Optional[str] = None, + last_authn: Optional[str] = None, ) -> None: """ - Initialize a AccountSettingsTemplateList object. + Initialize a EntityActivity object. - :param List[AccountSettingsTemplateResponse] account_settings_templates: - List of account settings templates based on the query paramters and the - page size. The account_settings_templates array is always part of the - response but might be empty depending on the query parameter values - provided. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is - available. - :param str next: (optional) Link to the next available page. If 'next' - property is not part of the response no next page is available. + :param str id: Unique id of the entity. + :param str name: (optional) Name provided during creation of the entity. + :param str last_authn: (optional) Time when the entity was last + authenticated. """ - self.context = context - self.offset = offset - self.limit = limit - self.first = first - self.previous = previous - self.next = next - self.account_settings_templates = account_settings_templates + self.id = id + self.name = name + self.last_authn = last_authn @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsTemplateList': - """Initialize a AccountSettingsTemplateList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EntityActivity': + """Initialize a EntityActivity object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (offset := _dict.get('offset')) is not None: - args['offset'] = offset - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - if (first := _dict.get('first')) is not None: - args['first'] = first - if (previous := _dict.get('previous')) is not None: - args['previous'] = previous - if (next := _dict.get('next')) is not None: - args['next'] = next - if (account_settings_templates := _dict.get('account_settings_templates')) is not None: - args['account_settings_templates'] = [ - AccountSettingsTemplateResponse.from_dict(v) for v in account_settings_templates - ] + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError( - 'Required property \'account_settings_templates\' not present in AccountSettingsTemplateList JSON' - ) + raise ValueError('Required property \'id\' not present in EntityActivity JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (last_authn := _dict.get('last_authn')) is not None: + args['last_authn'] = last_authn return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsTemplateList object from a json dictionary.""" + """Initialize a EntityActivity object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'offset') and self.offset is not None: - _dict['offset'] = self.offset - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first - if hasattr(self, 'previous') and self.previous is not None: - _dict['previous'] = self.previous - if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next - if hasattr(self, 'account_settings_templates') and self.account_settings_templates is not None: - account_settings_templates_list = [] - for v in self.account_settings_templates: - if isinstance(v, dict): - account_settings_templates_list.append(v) - else: - account_settings_templates_list.append(v.to_dict()) - _dict['account_settings_templates'] = account_settings_templates_list + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'last_authn') and self.last_authn is not None: + _dict['last_authn'] = self.last_authn return _dict def _to_dict(self): @@ -7211,199 +11425,93 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsTemplateList object.""" + """Return a `str` version of this EntityActivity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsTemplateList') -> bool: + def __eq__(self, other: 'EntityActivity') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsTemplateList') -> bool: + def __ne__(self, other: 'EntityActivity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AccountSettingsTemplateResponse: +class Error: """ - Response body format for account settings template REST requests. + Error information. - :param str id: ID of the the template. - :param int version: Version of the the template. - :param str account_id: ID of the account where the template resides. - :param str name: The name of the trusted profile template. This is visible only - in the enterprise account. - :param str description: (optional) The description of the trusted profile - template. Describe the template for enterprise account users. - :param bool committed: Committed flag determines if the template is ready for - assignment. - :param TemplateAccountSettings account_settings: Input body parameters for the - Account Settings REST request. - :param List[EnityHistoryRecord] history: (optional) History of the Template. - :param str entity_tag: Entity tag for this templateId-version combination. - :param str crn: Cloud resource name. - :param str created_at: (optional) Template Created At. - :param str created_by_id: (optional) IAMid of the creator. - :param str last_modified_at: (optional) Template last modified at. - :param str last_modified_by_id: (optional) IAMid of the identity that made the - latest modification. + :param str code: Error code of the REST Exception. + :param str message_code: Error message code of the REST Exception. + :param str message: Error message of the REST Exception. Error messages are + derived base on the input locale of the REST request and the available Message + catalogs. Dynamic fallback to 'us-english' is happening if no message catalog is + available for the provided input locale. + :param str details: (optional) Error details of the REST Exception. """ def __init__( self, - id: str, - version: int, - account_id: str, - name: str, - committed: bool, - account_settings: 'TemplateAccountSettings', - entity_tag: str, - crn: str, + code: str, + message_code: str, + message: str, *, - description: Optional[str] = None, - history: Optional[List['EnityHistoryRecord']] = None, - created_at: Optional[str] = None, - created_by_id: Optional[str] = None, - last_modified_at: Optional[str] = None, - last_modified_by_id: Optional[str] = None, + details: Optional[str] = None, ) -> None: """ - Initialize a AccountSettingsTemplateResponse object. + Initialize a Error object. - :param str id: ID of the the template. - :param int version: Version of the the template. - :param str account_id: ID of the account where the template resides. - :param str name: The name of the trusted profile template. This is visible - only in the enterprise account. - :param bool committed: Committed flag determines if the template is ready - for assignment. - :param TemplateAccountSettings account_settings: Input body parameters for - the Account Settings REST request. - :param str entity_tag: Entity tag for this templateId-version combination. - :param str crn: Cloud resource name. - :param str description: (optional) The description of the trusted profile - template. Describe the template for enterprise account users. - :param List[EnityHistoryRecord] history: (optional) History of the - Template. - :param str created_at: (optional) Template Created At. - :param str created_by_id: (optional) IAMid of the creator. - :param str last_modified_at: (optional) Template last modified at. - :param str last_modified_by_id: (optional) IAMid of the identity that made - the latest modification. + :param str code: Error code of the REST Exception. + :param str message_code: Error message code of the REST Exception. + :param str message: Error message of the REST Exception. Error messages are + derived base on the input locale of the REST request and the available + Message catalogs. Dynamic fallback to 'us-english' is happening if no + message catalog is available for the provided input locale. + :param str details: (optional) Error details of the REST Exception. """ - self.id = id - self.version = version - self.account_id = account_id - self.name = name - self.description = description - self.committed = committed - self.account_settings = account_settings - self.history = history - self.entity_tag = entity_tag - self.crn = crn - self.created_at = created_at - self.created_by_id = created_by_id - self.last_modified_at = last_modified_at - self.last_modified_by_id = last_modified_by_id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsTemplateResponse': - """Initialize a AccountSettingsTemplateResponse object from a json dictionary.""" - args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in AccountSettingsTemplateResponse JSON') - if (version := _dict.get('version')) is not None: - args['version'] = version - else: - raise ValueError('Required property \'version\' not present in AccountSettingsTemplateResponse JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in AccountSettingsTemplateResponse JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in AccountSettingsTemplateResponse JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (committed := _dict.get('committed')) is not None: - args['committed'] = committed - else: - raise ValueError('Required property \'committed\' not present in AccountSettingsTemplateResponse JSON') - if (account_settings := _dict.get('account_settings')) is not None: - args['account_settings'] = TemplateAccountSettings.from_dict(account_settings) + self.code = code + self.message_code = message_code + self.message = message + self.details = details + + @classmethod + def from_dict(cls, _dict: Dict) -> 'Error': + """Initialize a Error object from a json dictionary.""" + args = {} + if (code := _dict.get('code')) is not None: + args['code'] = code else: - raise ValueError( - 'Required property \'account_settings\' not present in AccountSettingsTemplateResponse JSON' - ) - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag + raise ValueError('Required property \'code\' not present in Error JSON') + if (message_code := _dict.get('message_code')) is not None: + args['message_code'] = message_code else: - raise ValueError('Required property \'entity_tag\' not present in AccountSettingsTemplateResponse JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + raise ValueError('Required property \'message_code\' not present in Error JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message else: - raise ValueError('Required property \'crn\' not present in AccountSettingsTemplateResponse JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = created_at - if (created_by_id := _dict.get('created_by_id')) is not None: - args['created_by_id'] = created_by_id - if (last_modified_at := _dict.get('last_modified_at')) is not None: - args['last_modified_at'] = last_modified_at - if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: - args['last_modified_by_id'] = last_modified_by_id + raise ValueError('Required property \'message\' not present in Error JSON') + if (details := _dict.get('details')) is not None: + args['details'] = details return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsTemplateResponse object from a json dictionary.""" + """Initialize a Error object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'version') and self.version is not None: - _dict['version'] = self.version - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'committed') and self.committed is not None: - _dict['committed'] = self.committed - if hasattr(self, 'account_settings') and self.account_settings is not None: - if isinstance(self.account_settings, dict): - _dict['account_settings'] = self.account_settings - else: - _dict['account_settings'] = self.account_settings.to_dict() - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: - if isinstance(v, dict): - history_list.append(v) - else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = self.created_at - if hasattr(self, 'created_by_id') and self.created_by_id is not None: - _dict['created_by_id'] = self.created_by_id - if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: - _dict['last_modified_at'] = self.last_modified_at - if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: - _dict['last_modified_by_id'] = self.last_modified_by_id + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message_code') and self.message_code is not None: + _dict['message_code'] = self.message_code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'details') and self.details is not None: + _dict['details'] = self.details return _dict def _to_dict(self): @@ -7411,86 +11519,96 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsTemplateResponse object.""" + """Return a `str` version of this Error object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsTemplateResponse') -> bool: + def __eq__(self, other: 'Error') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsTemplateResponse') -> bool: + def __ne__(self, other: 'Error') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AccountSettingsUserDomainRestriction: +class ExceptionResponse: """ - Input body parameters for the Account Settings REST request. + Response body parameters in case of error situations. - :param str realm_id: The realm that the restrictions apply to. - :param List[str] invitation_email_allow_patterns: (optional) The list of allowed - email patterns. Wildcard syntax is supported, '*' represents any sequence of - zero or more characters in the string, except for '.' and '@'. The sequence ends - if a '.' or '@' was found. '**' represents any sequence of zero or more - characters in the string - without limit. - :param bool restrict_invitation: (optional) When true invites will only be - possible to the domain patterns provided, otherwise invites are unrestricted. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str status_code: Error message code of the REST Exception. + :param List[Error] errors: List of errors that occured. + :param str trace: (optional) Unique ID of the requst. """ def __init__( self, - realm_id: str, + status_code: str, + errors: List['Error'], *, - invitation_email_allow_patterns: Optional[List[str]] = None, - restrict_invitation: Optional[bool] = None, + context: Optional['ResponseContext'] = None, + trace: Optional[str] = None, ) -> None: """ - Initialize a AccountSettingsUserDomainRestriction object. + Initialize a ExceptionResponse object. - :param str realm_id: The realm that the restrictions apply to. - :param List[str] invitation_email_allow_patterns: (optional) The list of - allowed email patterns. Wildcard syntax is supported, '*' represents any - sequence of zero or more characters in the string, except for '.' and '@'. - The sequence ends if a '.' or '@' was found. '**' represents any sequence - of zero or more characters in the string - without limit. - :param bool restrict_invitation: (optional) When true invites will only be - possible to the domain patterns provided, otherwise invites are - unrestricted. + :param str status_code: Error message code of the REST Exception. + :param List[Error] errors: List of errors that occured. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str trace: (optional) Unique ID of the requst. """ - self.realm_id = realm_id - self.invitation_email_allow_patterns = invitation_email_allow_patterns - self.restrict_invitation = restrict_invitation + self.context = context + self.status_code = status_code + self.errors = errors + self.trace = trace @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserDomainRestriction': - """Initialize a AccountSettingsUserDomainRestriction object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ExceptionResponse': + """Initialize a ExceptionResponse object from a json dictionary.""" args = {} - if (realm_id := _dict.get('realm_id')) is not None: - args['realm_id'] = realm_id + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (status_code := _dict.get('status_code')) is not None: + args['status_code'] = status_code else: - raise ValueError('Required property \'realm_id\' not present in AccountSettingsUserDomainRestriction JSON') - if (invitation_email_allow_patterns := _dict.get('invitation_email_allow_patterns')) is not None: - args['invitation_email_allow_patterns'] = invitation_email_allow_patterns - if (restrict_invitation := _dict.get('restrict_invitation')) is not None: - args['restrict_invitation'] = restrict_invitation + raise ValueError('Required property \'status_code\' not present in ExceptionResponse JSON') + if (errors := _dict.get('errors')) is not None: + args['errors'] = [Error.from_dict(v) for v in errors] + else: + raise ValueError('Required property \'errors\' not present in ExceptionResponse JSON') + if (trace := _dict.get('trace')) is not None: + args['trace'] = trace return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsUserDomainRestriction object from a json dictionary.""" + """Initialize a ExceptionResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'realm_id') and self.realm_id is not None: - _dict['realm_id'] = self.realm_id - if hasattr(self, 'invitation_email_allow_patterns') and self.invitation_email_allow_patterns is not None: - _dict['invitation_email_allow_patterns'] = self.invitation_email_allow_patterns - if hasattr(self, 'restrict_invitation') and self.restrict_invitation is not None: - _dict['restrict_invitation'] = self.restrict_invitation + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'status_code') and self.status_code is not None: + _dict['status_code'] = self.status_code + if hasattr(self, 'errors') and self.errors is not None: + errors_list = [] + for v in self.errors: + if isinstance(v, dict): + errors_list.append(v) + else: + errors_list.append(v.to_dict()) + _dict['errors'] = errors_list + if hasattr(self, 'trace') and self.trace is not None: + _dict['trace'] = self.trace return _dict def _to_dict(self): @@ -7498,26 +11616,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsUserDomainRestriction object.""" + """Return a `str` version of this ExceptionResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsUserDomainRestriction') -> bool: + def __eq__(self, other: 'ExceptionResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsUserDomainRestriction') -> bool: + def __ne__(self, other: 'ExceptionResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AccountSettingsUserMFAResponse: +class IdBasedMfaEnrollment: """ - AccountSettingsUserMFAResponse. + IdBasedMfaEnrollment. - :param str iam_id: The iam_id of the user. - :param str mfa: MFA trait definitions as follows: + :param str trait_account_default: MFA trait definitions as follows: * NONE - No MFA trait set * NONE_NO_ROPC- No MFA, disable CLI logins with only a password * TOTP - For all non-federated IBMId users @@ -7525,27 +11642,63 @@ class AccountSettingsUserMFAResponse: * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - Security Key MFA for all users. - :param str name: (optional) name of the user account. - :param str user_name: (optional) userName of the user. - :param str email: (optional) email of the user. - :param str description: (optional) optional description. + :param str trait_user_specific: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str trait_effective: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param bool complies: The enrollment complies to the effective requirement. + :param str comply_state: (optional) Defines comply state for the account. Valid + values: + * NO - User does not comply in the given account. + * ACCOUNT- User complies in the given account, but does not comply in at least + one of the other account memberships. + * CROSS_ACCOUNT - User complies in the given account and across all other + account memberships. """ def __init__( self, - iam_id: str, - mfa: str, + trait_account_default: str, + trait_effective: str, + complies: bool, *, - name: Optional[str] = None, - user_name: Optional[str] = None, - email: Optional[str] = None, - description: Optional[str] = None, + trait_user_specific: Optional[str] = None, + comply_state: Optional[str] = None, ) -> None: """ - Initialize a AccountSettingsUserMFAResponse object. + Initialize a IdBasedMfaEnrollment object. - :param str iam_id: The iam_id of the user. - :param str mfa: MFA trait definitions as follows: + :param str trait_account_default: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param str trait_effective: MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param bool complies: The enrollment complies to the effective requirement. + :param str trait_user_specific: (optional) MFA trait definitions as + follows: * NONE - No MFA trait set * NONE_NO_ROPC- No MFA, disable CLI logins with only a password * TOTP - For all non-federated IBMId users @@ -7553,60 +11706,60 @@ def __init__( * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - Security Key MFA for all users. - :param str name: (optional) name of the user account. - :param str user_name: (optional) userName of the user. - :param str email: (optional) email of the user. - :param str description: (optional) optional description. + :param str comply_state: (optional) Defines comply state for the account. + Valid values: + * NO - User does not comply in the given account. + * ACCOUNT- User complies in the given account, but does not comply in at + least one of the other account memberships. + * CROSS_ACCOUNT - User complies in the given account and across all other + account memberships. """ - self.iam_id = iam_id - self.mfa = mfa - self.name = name - self.user_name = user_name - self.email = email - self.description = description + self.trait_account_default = trait_account_default + self.trait_user_specific = trait_user_specific + self.trait_effective = trait_effective + self.complies = complies + self.comply_state = comply_state @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountSettingsUserMFAResponse': - """Initialize a AccountSettingsUserMFAResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdBasedMfaEnrollment': + """Initialize a IdBasedMfaEnrollment object from a json dictionary.""" args = {} - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id + if (trait_account_default := _dict.get('trait_account_default')) is not None: + args['trait_account_default'] = trait_account_default else: - raise ValueError('Required property \'iam_id\' not present in AccountSettingsUserMFAResponse JSON') - if (mfa := _dict.get('mfa')) is not None: - args['mfa'] = mfa + raise ValueError('Required property \'trait_account_default\' not present in IdBasedMfaEnrollment JSON') + if (trait_user_specific := _dict.get('trait_user_specific')) is not None: + args['trait_user_specific'] = trait_user_specific + if (trait_effective := _dict.get('trait_effective')) is not None: + args['trait_effective'] = trait_effective else: - raise ValueError('Required property \'mfa\' not present in AccountSettingsUserMFAResponse JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - if (user_name := _dict.get('userName')) is not None: - args['user_name'] = user_name - if (email := _dict.get('email')) is not None: - args['email'] = email - if (description := _dict.get('description')) is not None: - args['description'] = description + raise ValueError('Required property \'trait_effective\' not present in IdBasedMfaEnrollment JSON') + if (complies := _dict.get('complies')) is not None: + args['complies'] = complies + else: + raise ValueError('Required property \'complies\' not present in IdBasedMfaEnrollment JSON') + if (comply_state := _dict.get('comply_state')) is not None: + args['comply_state'] = comply_state return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountSettingsUserMFAResponse object from a json dictionary.""" + """Initialize a IdBasedMfaEnrollment object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'mfa') and self.mfa is not None: - _dict['mfa'] = self.mfa - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'user_name') and self.user_name is not None: - _dict['userName'] = self.user_name - if hasattr(self, 'email') and self.email is not None: - _dict['email'] = self.email - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description + if hasattr(self, 'trait_account_default') and self.trait_account_default is not None: + _dict['trait_account_default'] = self.trait_account_default + if hasattr(self, 'trait_user_specific') and self.trait_user_specific is not None: + _dict['trait_user_specific'] = self.trait_user_specific + if hasattr(self, 'trait_effective') and self.trait_effective is not None: + _dict['trait_effective'] = self.trait_effective + if hasattr(self, 'complies') and self.complies is not None: + _dict['complies'] = self.complies + if hasattr(self, 'comply_state') and self.comply_state is not None: + _dict['comply_state'] = self.comply_state return _dict def _to_dict(self): @@ -7614,20 +11767,20 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountSettingsUserMFAResponse object.""" + """Return a `str` version of this IdBasedMfaEnrollment object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountSettingsUserMFAResponse') -> bool: + def __eq__(self, other: 'IdBasedMfaEnrollment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountSettingsUserMFAResponse') -> bool: + def __ne__(self, other: 'IdBasedMfaEnrollment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MfaEnum(str, Enum): + class TraitAccountDefaultEnum(str, Enum): """ MFA trait definitions as follows: * NONE - No MFA trait set @@ -7647,142 +11800,106 @@ class MfaEnum(str, Enum): LEVEL2 = 'LEVEL2' LEVEL3 = 'LEVEL3' - -class ActionControls: - """ - ActionControls. - - :param ActionControlsIdentities identities: (optional) - :param ActionControlsRules rules: - :param ActionControlsPolicies policies: - """ - - def __init__( - self, - rules: 'ActionControlsRules', - policies: 'ActionControlsPolicies', - *, - identities: Optional['ActionControlsIdentities'] = None, - ) -> None: + class TraitUserSpecificEnum(str, Enum): """ - Initialize a ActionControls object. - - :param ActionControlsRules rules: - :param ActionControlsPolicies policies: - :param ActionControlsIdentities identities: (optional) + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. """ - self.identities = identities - self.rules = rules - self.policies = policies - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ActionControls': - """Initialize a ActionControls object from a json dictionary.""" - args = {} - if (identities := _dict.get('identities')) is not None: - args['identities'] = ActionControlsIdentities.from_dict(identities) - if (rules := _dict.get('rules')) is not None: - args['rules'] = ActionControlsRules.from_dict(rules) - else: - raise ValueError('Required property \'rules\' not present in ActionControls JSON') - if (policies := _dict.get('policies')) is not None: - args['policies'] = ActionControlsPolicies.from_dict(policies) - else: - raise ValueError('Required property \'policies\' not present in ActionControls JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ActionControls object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'identities') and self.identities is not None: - if isinstance(self.identities, dict): - _dict['identities'] = self.identities - else: - _dict['identities'] = self.identities.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - if isinstance(self.rules, dict): - _dict['rules'] = self.rules - else: - _dict['rules'] = self.rules.to_dict() - if hasattr(self, 'policies') and self.policies is not None: - if isinstance(self.policies, dict): - _dict['policies'] = self.policies - else: - _dict['policies'] = self.policies.to_dict() - return _dict + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + class TraitEffectiveEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ - def __str__(self) -> str: - """Return a `str` version of this ActionControls object.""" - return json.dumps(self.to_dict(), indent=2) + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' - def __eq__(self, other: 'ActionControls') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + class ComplyStateEnum(str, Enum): + """ + Defines comply state for the account. Valid values: + * NO - User does not comply in the given account. + * ACCOUNT- User complies in the given account, but does not comply in at least + one of the other account memberships. + * CROSS_ACCOUNT - User complies in the given account and across all other + account memberships. + """ - def __ne__(self, other: 'ActionControls') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + NO = 'NO' + ACCOUNT = 'ACCOUNT' + CROSS_ACCOUNT = 'CROSS_ACCOUNT' -class ActionControlsIdentities: +class IdentityCount: """ - ActionControlsIdentities. + API key count for a specific identity. - :param bool add: - :param bool remove: + :param str iam_id: (optional) IAM identifier of the identity. + :param int count: (optional) Number of API keys for the identity. """ def __init__( self, - add: bool, - remove: bool, + *, + iam_id: Optional[str] = None, + count: Optional[int] = None, ) -> None: """ - Initialize a ActionControlsIdentities object. + Initialize a IdentityCount object. - :param bool add: - :param bool remove: + :param str iam_id: (optional) IAM identifier of the identity. + :param int count: (optional) Number of API keys for the identity. """ - self.add = add - self.remove = remove + self.iam_id = iam_id + self.count = count @classmethod - def from_dict(cls, _dict: Dict) -> 'ActionControlsIdentities': - """Initialize a ActionControlsIdentities object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityCount': + """Initialize a IdentityCount object from a json dictionary.""" args = {} - if (add := _dict.get('add')) is not None: - args['add'] = add - else: - raise ValueError('Required property \'add\' not present in ActionControlsIdentities JSON') - if (remove := _dict.get('remove')) is not None: - args['remove'] = remove - else: - raise ValueError('Required property \'remove\' not present in ActionControlsIdentities JSON') + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + if (count := _dict.get('count')) is not None: + args['count'] = count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ActionControlsIdentities object from a json dictionary.""" + """Initialize a IdentityCount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'add') and self.add is not None: - _dict['add'] = self.add - if hasattr(self, 'remove') and self.remove is not None: - _dict['remove'] = self.remove + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count return _dict def _to_dict(self): @@ -7790,68 +11907,239 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ActionControlsIdentities object.""" + """Return a `str` version of this IdentityCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ActionControlsIdentities') -> bool: + def __eq__(self, other: 'IdentityCount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ActionControlsIdentities') -> bool: + def __ne__(self, other: 'IdentityCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ActionControlsPolicies: +class IdentityLimitsUsageResponse: """ - ActionControlsPolicies. + Response body format for identity limits usage. - :param bool add: - :param bool remove: + :param LimitCount serviceid_groups: (optional) Limit and current usage count for + a resource. + :param IdentityLimitsUsageResponseServiceidsPerGroup serviceids_per_group: + (optional) Usage count for service IDs per group. + :param LimitCount profiles: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseApikeysPerIdentity apikeys_per_identity: + (optional) Usage count for API keys per identity. + :param LimitCount profile_templates: (optional) Limit and current usage count + for a resource. + :param LimitCount account_settings_templates: (optional) Limit and current usage + count for a resource. + :param IdentityLimitsUsageResponseTemplateVersionsPerTemplate + template_versions_per_template: (optional) Usage count for template versions per + template. + :param LimitCount idps: (optional) Limit and current usage count for a resource. + :param IdentityLimitsUsageResponseClaimRulesPerGroup claim_rules_per_group: + (optional) Usage count for claim rules per access group. + :param IdentityLimitsUsageResponseClaimRulesPerProfile claim_rules_per_profile: + (optional) Usage count for claim rules per profile. + :param LimitCount cr_links: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseCrLinksPerProfile cr_links_per_profile: + (optional) Usage count for compute resource links per profile. + :param LimitCount cr_rules: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseCrRulesPerProfile cr_rules_per_profile: + (optional) Usage count for compute resource rules per profile. """ def __init__( self, - add: bool, - remove: bool, + *, + serviceid_groups: Optional['LimitCount'] = None, + serviceids_per_group: Optional['IdentityLimitsUsageResponseServiceidsPerGroup'] = None, + profiles: Optional['LimitCount'] = None, + apikeys_per_identity: Optional['IdentityLimitsUsageResponseApikeysPerIdentity'] = None, + profile_templates: Optional['LimitCount'] = None, + account_settings_templates: Optional['LimitCount'] = None, + template_versions_per_template: Optional['IdentityLimitsUsageResponseTemplateVersionsPerTemplate'] = None, + idps: Optional['LimitCount'] = None, + claim_rules_per_group: Optional['IdentityLimitsUsageResponseClaimRulesPerGroup'] = None, + claim_rules_per_profile: Optional['IdentityLimitsUsageResponseClaimRulesPerProfile'] = None, + cr_links: Optional['LimitCount'] = None, + cr_links_per_profile: Optional['IdentityLimitsUsageResponseCrLinksPerProfile'] = None, + cr_rules: Optional['LimitCount'] = None, + cr_rules_per_profile: Optional['IdentityLimitsUsageResponseCrRulesPerProfile'] = None, ) -> None: """ - Initialize a ActionControlsPolicies object. + Initialize a IdentityLimitsUsageResponse object. - :param bool add: - :param bool remove: + :param LimitCount serviceid_groups: (optional) Limit and current usage + count for a resource. + :param IdentityLimitsUsageResponseServiceidsPerGroup serviceids_per_group: + (optional) Usage count for service IDs per group. + :param LimitCount profiles: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseApikeysPerIdentity apikeys_per_identity: + (optional) Usage count for API keys per identity. + :param LimitCount profile_templates: (optional) Limit and current usage + count for a resource. + :param LimitCount account_settings_templates: (optional) Limit and current + usage count for a resource. + :param IdentityLimitsUsageResponseTemplateVersionsPerTemplate + template_versions_per_template: (optional) Usage count for template + versions per template. + :param LimitCount idps: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseClaimRulesPerGroup claim_rules_per_group: + (optional) Usage count for claim rules per access group. + :param IdentityLimitsUsageResponseClaimRulesPerProfile + claim_rules_per_profile: (optional) Usage count for claim rules per + profile. + :param LimitCount cr_links: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseCrLinksPerProfile cr_links_per_profile: + (optional) Usage count for compute resource links per profile. + :param LimitCount cr_rules: (optional) Limit and current usage count for a + resource. + :param IdentityLimitsUsageResponseCrRulesPerProfile cr_rules_per_profile: + (optional) Usage count for compute resource rules per profile. """ - self.add = add - self.remove = remove + self.serviceid_groups = serviceid_groups + self.serviceids_per_group = serviceids_per_group + self.profiles = profiles + self.apikeys_per_identity = apikeys_per_identity + self.profile_templates = profile_templates + self.account_settings_templates = account_settings_templates + self.template_versions_per_template = template_versions_per_template + self.idps = idps + self.claim_rules_per_group = claim_rules_per_group + self.claim_rules_per_profile = claim_rules_per_profile + self.cr_links = cr_links + self.cr_links_per_profile = cr_links_per_profile + self.cr_rules = cr_rules + self.cr_rules_per_profile = cr_rules_per_profile @classmethod - def from_dict(cls, _dict: Dict) -> 'ActionControlsPolicies': - """Initialize a ActionControlsPolicies object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponse': + """Initialize a IdentityLimitsUsageResponse object from a json dictionary.""" args = {} - if (add := _dict.get('add')) is not None: - args['add'] = add - else: - raise ValueError('Required property \'add\' not present in ActionControlsPolicies JSON') - if (remove := _dict.get('remove')) is not None: - args['remove'] = remove - else: - raise ValueError('Required property \'remove\' not present in ActionControlsPolicies JSON') + if (serviceid_groups := _dict.get('serviceid_groups')) is not None: + args['serviceid_groups'] = LimitCount.from_dict(serviceid_groups) + if (serviceids_per_group := _dict.get('serviceids_per_group')) is not None: + args['serviceids_per_group'] = IdentityLimitsUsageResponseServiceidsPerGroup.from_dict(serviceids_per_group) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = LimitCount.from_dict(profiles) + if (apikeys_per_identity := _dict.get('apikeys_per_identity')) is not None: + args['apikeys_per_identity'] = IdentityLimitsUsageResponseApikeysPerIdentity.from_dict(apikeys_per_identity) + if (profile_templates := _dict.get('profile_templates')) is not None: + args['profile_templates'] = LimitCount.from_dict(profile_templates) + if (account_settings_templates := _dict.get('account_settings_templates')) is not None: + args['account_settings_templates'] = LimitCount.from_dict(account_settings_templates) + if (template_versions_per_template := _dict.get('template_versions_per_template')) is not None: + args['template_versions_per_template'] = IdentityLimitsUsageResponseTemplateVersionsPerTemplate.from_dict( + template_versions_per_template + ) + if (idps := _dict.get('idps')) is not None: + args['idps'] = LimitCount.from_dict(idps) + if (claim_rules_per_group := _dict.get('claim_rules_per_group')) is not None: + args['claim_rules_per_group'] = IdentityLimitsUsageResponseClaimRulesPerGroup.from_dict( + claim_rules_per_group + ) + if (claim_rules_per_profile := _dict.get('claim_rules_per_profile')) is not None: + args['claim_rules_per_profile'] = IdentityLimitsUsageResponseClaimRulesPerProfile.from_dict( + claim_rules_per_profile + ) + if (cr_links := _dict.get('cr_links')) is not None: + args['cr_links'] = LimitCount.from_dict(cr_links) + if (cr_links_per_profile := _dict.get('cr_links_per_profile')) is not None: + args['cr_links_per_profile'] = IdentityLimitsUsageResponseCrLinksPerProfile.from_dict(cr_links_per_profile) + if (cr_rules := _dict.get('cr_rules')) is not None: + args['cr_rules'] = LimitCount.from_dict(cr_rules) + if (cr_rules_per_profile := _dict.get('cr_rules_per_profile')) is not None: + args['cr_rules_per_profile'] = IdentityLimitsUsageResponseCrRulesPerProfile.from_dict(cr_rules_per_profile) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ActionControlsPolicies object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'add') and self.add is not None: - _dict['add'] = self.add - if hasattr(self, 'remove') and self.remove is not None: - _dict['remove'] = self.remove + if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: + if isinstance(self.serviceid_groups, dict): + _dict['serviceid_groups'] = self.serviceid_groups + else: + _dict['serviceid_groups'] = self.serviceid_groups.to_dict() + if hasattr(self, 'serviceids_per_group') and self.serviceids_per_group is not None: + if isinstance(self.serviceids_per_group, dict): + _dict['serviceids_per_group'] = self.serviceids_per_group + else: + _dict['serviceids_per_group'] = self.serviceids_per_group.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + if isinstance(self.profiles, dict): + _dict['profiles'] = self.profiles + else: + _dict['profiles'] = self.profiles.to_dict() + if hasattr(self, 'apikeys_per_identity') and self.apikeys_per_identity is not None: + if isinstance(self.apikeys_per_identity, dict): + _dict['apikeys_per_identity'] = self.apikeys_per_identity + else: + _dict['apikeys_per_identity'] = self.apikeys_per_identity.to_dict() + if hasattr(self, 'profile_templates') and self.profile_templates is not None: + if isinstance(self.profile_templates, dict): + _dict['profile_templates'] = self.profile_templates + else: + _dict['profile_templates'] = self.profile_templates.to_dict() + if hasattr(self, 'account_settings_templates') and self.account_settings_templates is not None: + if isinstance(self.account_settings_templates, dict): + _dict['account_settings_templates'] = self.account_settings_templates + else: + _dict['account_settings_templates'] = self.account_settings_templates.to_dict() + if hasattr(self, 'template_versions_per_template') and self.template_versions_per_template is not None: + if isinstance(self.template_versions_per_template, dict): + _dict['template_versions_per_template'] = self.template_versions_per_template + else: + _dict['template_versions_per_template'] = self.template_versions_per_template.to_dict() + if hasattr(self, 'idps') and self.idps is not None: + if isinstance(self.idps, dict): + _dict['idps'] = self.idps + else: + _dict['idps'] = self.idps.to_dict() + if hasattr(self, 'claim_rules_per_group') and self.claim_rules_per_group is not None: + if isinstance(self.claim_rules_per_group, dict): + _dict['claim_rules_per_group'] = self.claim_rules_per_group + else: + _dict['claim_rules_per_group'] = self.claim_rules_per_group.to_dict() + if hasattr(self, 'claim_rules_per_profile') and self.claim_rules_per_profile is not None: + if isinstance(self.claim_rules_per_profile, dict): + _dict['claim_rules_per_profile'] = self.claim_rules_per_profile + else: + _dict['claim_rules_per_profile'] = self.claim_rules_per_profile.to_dict() + if hasattr(self, 'cr_links') and self.cr_links is not None: + if isinstance(self.cr_links, dict): + _dict['cr_links'] = self.cr_links + else: + _dict['cr_links'] = self.cr_links.to_dict() + if hasattr(self, 'cr_links_per_profile') and self.cr_links_per_profile is not None: + if isinstance(self.cr_links_per_profile, dict): + _dict['cr_links_per_profile'] = self.cr_links_per_profile + else: + _dict['cr_links_per_profile'] = self.cr_links_per_profile.to_dict() + if hasattr(self, 'cr_rules') and self.cr_rules is not None: + if isinstance(self.cr_rules, dict): + _dict['cr_rules'] = self.cr_rules + else: + _dict['cr_rules'] = self.cr_rules.to_dict() + if hasattr(self, 'cr_rules_per_profile') and self.cr_rules_per_profile is not None: + if isinstance(self.cr_rules_per_profile, dict): + _dict['cr_rules_per_profile'] = self.cr_rules_per_profile + else: + _dict['cr_rules_per_profile'] = self.cr_rules_per_profile.to_dict() return _dict def _to_dict(self): @@ -7859,68 +12147,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ActionControlsPolicies object.""" + """Return a `str` version of this IdentityLimitsUsageResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ActionControlsPolicies') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ActionControlsPolicies') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ActionControlsRules: +class IdentityLimitsUsageResponseApikeysPerIdentity: """ - ActionControlsRules. + Usage count for API keys per identity. - :param bool add: - :param bool remove: + :param int limit: Maximum allowed API keys per identity. + :param List[IdentityCount] identities: (optional) List of identities with their + API key usage counts. """ def __init__( self, - add: bool, - remove: bool, + limit: int, + *, + identities: Optional[List['IdentityCount']] = None, ) -> None: """ - Initialize a ActionControlsRules object. + Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object. - :param bool add: - :param bool remove: + :param int limit: Maximum allowed API keys per identity. + :param List[IdentityCount] identities: (optional) List of identities with + their API key usage counts. """ - self.add = add - self.remove = remove + self.limit = limit + self.identities = identities @classmethod - def from_dict(cls, _dict: Dict) -> 'ActionControlsRules': - """Initialize a ActionControlsRules object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseApikeysPerIdentity': + """Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object from a json dictionary.""" args = {} - if (add := _dict.get('add')) is not None: - args['add'] = add - else: - raise ValueError('Required property \'add\' not present in ActionControlsRules JSON') - if (remove := _dict.get('remove')) is not None: - args['remove'] = remove + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'remove\' not present in ActionControlsRules JSON') + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseApikeysPerIdentity JSON' + ) + if (identities := _dict.get('identities')) is not None: + args['identities'] = [IdentityCount.from_dict(v) for v in identities] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ActionControlsRules object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'add') and self.add is not None: - _dict['add'] = self.add - if hasattr(self, 'remove') and self.remove is not None: - _dict['remove'] = self.remove + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'identities') and self.identities is not None: + identities_list = [] + for v in self.identities: + if isinstance(v, dict): + identities_list.append(v) + else: + identities_list.append(v.to_dict()) + _dict['identities'] = identities_list return _dict def _to_dict(self): @@ -7928,70 +12225,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ActionControlsRules object.""" + """Return a `str` version of this IdentityLimitsUsageResponseApikeysPerIdentity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ActionControlsRules') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseApikeysPerIdentity') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ActionControlsRules') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseApikeysPerIdentity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Activity: +class IdentityLimitsUsageResponseClaimRulesPerGroup: """ - Activity. + Usage count for claim rules per access group. - :param str last_authn: (optional) Time when the entity was last authenticated. - :param int authn_count: Authentication count, number of times the entity was - authenticated. + :param int limit: Maximum allowed claim rules per access group. + :param List[AccessGroupCount] access_groups: (optional) List of access groups + with their claim rules usage counts. """ def __init__( self, - authn_count: int, + limit: int, *, - last_authn: Optional[str] = None, + access_groups: Optional[List['AccessGroupCount']] = None, ) -> None: """ - Initialize a Activity object. + Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object. - :param int authn_count: Authentication count, number of times the entity - was authenticated. - :param str last_authn: (optional) Time when the entity was last - authenticated. + :param int limit: Maximum allowed claim rules per access group. + :param List[AccessGroupCount] access_groups: (optional) List of access + groups with their claim rules usage counts. """ - self.last_authn = last_authn - self.authn_count = authn_count + self.limit = limit + self.access_groups = access_groups @classmethod - def from_dict(cls, _dict: Dict) -> 'Activity': - """Initialize a Activity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseClaimRulesPerGroup': + """Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object from a json dictionary.""" args = {} - if (last_authn := _dict.get('last_authn')) is not None: - args['last_authn'] = last_authn - if (authn_count := _dict.get('authn_count')) is not None: - args['authn_count'] = authn_count + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'authn_count\' not present in Activity JSON') + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseClaimRulesPerGroup JSON' + ) + if (access_groups := _dict.get('access_groups')) is not None: + args['access_groups'] = [AccessGroupCount.from_dict(v) for v in access_groups] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Activity object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'last_authn') and self.last_authn is not None: - _dict['last_authn'] = self.last_authn - if hasattr(self, 'authn_count') and self.authn_count is not None: - _dict['authn_count'] = self.authn_count + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'access_groups') and self.access_groups is not None: + access_groups_list = [] + for v in self.access_groups: + if isinstance(v, dict): + access_groups_list.append(v) + else: + access_groups_list.append(v.to_dict()) + _dict['access_groups'] = access_groups_list return _dict def _to_dict(self): @@ -7999,279 +12303,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Activity object.""" + """Return a `str` version of this IdentityLimitsUsageResponseClaimRulesPerGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Activity') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Activity') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApiKey: +class IdentityLimitsUsageResponseClaimRulesPerProfile: """ - Response body format for API key V1 REST requests. + Usage count for claim rules per profile. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str id: Unique identifier of this API Key. - :param str entity_tag: (optional) Version of the API Key details object. You - need to specify this value when updating the API key to avoid stale updates. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'. - :param bool locked: The API key cannot be changed if set to true. - :param bool disabled: (optional) Defines if API key is disabled, API key cannot - be used if 'disabled' is set to true. - :param datetime created_at: (optional) If set contains a date time string of the - creation date in ISO format. - :param str created_by: IAM ID of the user or service which created the API key. - :param datetime modified_at: (optional) If set contains a date time string of - the last modification date in ISO format. - :param str name: Name of the API key. The name is not checked for uniqueness. - Therefore multiple names with the same value can exist. Access is done via the - UUID of the API key. - :param bool support_sessions: (optional) Defines whether you can manage CLI - login sessions for the API key. When `true`, sessions are created and can be - reviewed or revoked. When `false`, no sessions are tracked. To block access, - delete or rotate the API key. Available only for user API keys. - :param str action_when_leaked: (optional) Defines the action to take when API - key is leaked, valid values are 'none', 'disable' and 'delete'. - :param str expires_at: (optional) Date and time when the API key becomes - invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** An - API key will be permanently and irrevocably deleted when both the expires_at and - modified_at timestamps are more than ninety (90) days in the past, regardless of - the key’s locked status or any other state. - :param str description: (optional) The optional description of the API key. The - 'description' property is only available if a description was provided during a - create of an API key. - :param str iam_id: The iam_id that this API key authenticates. - :param str account_id: ID of the account that this API key authenticates for. - :param str apikey: The API key value. This property only contains the API key - value for the following cases: create an API key, update a service ID API key - that stores the API key value as retrievable, or get a service ID API key that - stores the API key value as retrievable. All other operations don't return the - API key value, for example all user API key related operations, except for - create, don't contain the API key value. - :param List[EnityHistoryRecord] history: (optional) History of the API key. - :param Activity activity: (optional) + :param int limit: Maximum allowed claim rules per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their claim + rules usage counts. """ def __init__( self, - id: str, - crn: str, - locked: bool, - created_by: str, - name: str, - iam_id: str, - account_id: str, - apikey: str, + limit: int, *, - context: Optional['ResponseContext'] = None, - entity_tag: Optional[str] = None, - disabled: Optional[bool] = None, - created_at: Optional[datetime] = None, - modified_at: Optional[datetime] = None, - support_sessions: Optional[bool] = None, - action_when_leaked: Optional[str] = None, - expires_at: Optional[str] = None, - description: Optional[str] = None, - history: Optional[List['EnityHistoryRecord']] = None, - activity: Optional['Activity'] = None, + profiles: Optional[List['ProfileCount']] = None, ) -> None: """ - Initialize a ApiKey object. - - :param str id: Unique identifier of this API Key. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource - Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'. - :param bool locked: The API key cannot be changed if set to true. - :param str created_by: IAM ID of the user or service which created the API - key. - :param str name: Name of the API key. The name is not checked for - uniqueness. Therefore multiple names with the same value can exist. Access - is done via the UUID of the API key. - :param str iam_id: The iam_id that this API key authenticates. - :param str account_id: ID of the account that this API key authenticates - for. - :param str apikey: The API key value. This property only contains the API - key value for the following cases: create an API key, update a service ID - API key that stores the API key value as retrievable, or get a service ID - API key that stores the API key value as retrievable. All other operations - don't return the API key value, for example all user API key related - operations, except for create, don't contain the API key value. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str entity_tag: (optional) Version of the API Key details object. - You need to specify this value when updating the API key to avoid stale - updates. - :param bool disabled: (optional) Defines if API key is disabled, API key - cannot be used if 'disabled' is set to true. - :param datetime created_at: (optional) If set contains a date time string - of the creation date in ISO format. - :param datetime modified_at: (optional) If set contains a date time string - of the last modification date in ISO format. - :param bool support_sessions: (optional) Defines whether you can manage CLI - login sessions for the API key. When `true`, sessions are created and can - be reviewed or revoked. When `false`, no sessions are tracked. To block - access, delete or rotate the API key. Available only for user API keys. - :param str action_when_leaked: (optional) Defines the action to take when - API key is leaked, valid values are 'none', 'disable' and 'delete'. - :param str expires_at: (optional) Date and time when the API key becomes - invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. - **WARNING** An API key will be permanently and irrevocably deleted when - both the expires_at and modified_at timestamps are more than ninety (90) - days in the past, regardless of the key’s locked status or any other state. - :param str description: (optional) The optional description of the API key. - The 'description' property is only available if a description was provided - during a create of an API key. - :param List[EnityHistoryRecord] history: (optional) History of the API key. - :param Activity activity: (optional) - """ - self.context = context - self.id = id - self.entity_tag = entity_tag - self.crn = crn - self.locked = locked - self.disabled = disabled - self.created_at = created_at - self.created_by = created_by - self.modified_at = modified_at - self.name = name - self.support_sessions = support_sessions - self.action_when_leaked = action_when_leaked - self.expires_at = expires_at - self.description = description - self.iam_id = iam_id - self.account_id = account_id - self.apikey = apikey - self.history = history - self.activity = activity + Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object. + + :param int limit: Maximum allowed claim rules per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their + claim rules usage counts. + """ + self.limit = limit + self.profiles = profiles @classmethod - def from_dict(cls, _dict: Dict) -> 'ApiKey': - """Initialize a ApiKey object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseClaimRulesPerProfile': + """Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ApiKey JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in ApiKey JSON') - if (locked := _dict.get('locked')) is not None: - args['locked'] = locked - else: - raise ValueError('Required property \'locked\' not present in ApiKey JSON') - if (disabled := _dict.get('disabled')) is not None: - args['disabled'] = disabled - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - if (created_by := _dict.get('created_by')) is not None: - args['created_by'] = created_by - else: - raise ValueError('Required property \'created_by\' not present in ApiKey JSON') - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = string_to_datetime(modified_at) - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in ApiKey JSON') - if (support_sessions := _dict.get('support_sessions')) is not None: - args['support_sessions'] = support_sessions - if (action_when_leaked := _dict.get('action_when_leaked')) is not None: - args['action_when_leaked'] = action_when_leaked - if (expires_at := _dict.get('expires_at')) is not None: - args['expires_at'] = expires_at - if (description := _dict.get('description')) is not None: - args['description'] = description - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - else: - raise ValueError('Required property \'iam_id\' not present in ApiKey JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in ApiKey JSON') - if (apikey := _dict.get('apikey')) is not None: - args['apikey'] = apikey + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'apikey\' not present in ApiKey JSON') - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (activity := _dict.get('activity')) is not None: - args['activity'] = Activity.from_dict(activity) + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseClaimRulesPerProfile JSON' + ) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApiKey object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'locked') and self.locked is not None: - _dict['locked'] = self.locked - if hasattr(self, 'disabled') and self.disabled is not None: - _dict['disabled'] = self.disabled - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'created_by') and self.created_by is not None: - _dict['created_by'] = self.created_by - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = datetime_to_string(self.modified_at) - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'support_sessions') and self.support_sessions is not None: - _dict['support_sessions'] = self.support_sessions - if hasattr(self, 'action_when_leaked') and self.action_when_leaked is not None: - _dict['action_when_leaked'] = self.action_when_leaked - if hasattr(self, 'expires_at') and self.expires_at is not None: - _dict['expires_at'] = self.expires_at - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'apikey') and self.apikey is not None: - _dict['apikey'] = self.apikey - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: if isinstance(v, dict): - history_list.append(v) + profiles_list.append(v) else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'activity') and self.activity is not None: - if isinstance(self.activity, dict): - _dict['activity'] = self.activity - else: - _dict['activity'] = self.activity.to_dict() + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -8279,135 +12381,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApiKey object.""" + """Return a `str` version of this IdentityLimitsUsageResponseClaimRulesPerProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApiKey') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApiKey') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApiKeyInsideCreateServiceIdRequest: +class IdentityLimitsUsageResponseCrLinksPerProfile: """ - Parameters for the API key in the Create service Id V1 REST request. + Usage count for compute resource links per profile. - :param str name: Name of the API key. The name is not checked for uniqueness. - Therefore multiple names with the same value can exist. Access is done via the - UUID of the API key. - :param str description: (optional) The optional description of the API key. The - 'description' property is only available if a description was provided during a - create of an API key. - :param str apikey: (optional) You can optionally passthrough the API key value - for this API key. If passed, a minimum length validation of 32 characters for - that apiKey value is done, i.e. the value can contain any characters and can - even be non-URL safe, but the minimum length requirement must be met. If - omitted, the API key management will create an URL safe opaque API key value. - The value of the API key is checked for uniqueness. Ensure enough variations - when passing in this value. - :param bool store_value: (optional) Send true or false to set whether the API - key value is retrievable in the future by using the Get details of an API key - request. If you create an API key for a user, you must specify `false` or omit - the value. We don't allow storing of API keys for users. - :param str action_when_leaked: (optional) Defines the action to take when API - key is leaked, valid values are 'none', 'disable' and 'delete'. - :param str expires_at: (optional) Date and time when the API key becomes - invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** An - API key will be permanently and irrevocably deleted when both the expires_at and - modified_at timestamps are more than ninety (90) days in the past, regardless of - the key’s locked status or any other state. + :param int limit: Maximum allowed compute resource links per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their + compute resource links usage counts. """ def __init__( self, - name: str, + limit: int, *, - description: Optional[str] = None, - apikey: Optional[str] = None, - store_value: Optional[bool] = None, - action_when_leaked: Optional[str] = None, - expires_at: Optional[str] = None, + profiles: Optional[List['ProfileCount']] = None, ) -> None: """ - Initialize a ApiKeyInsideCreateServiceIdRequest object. + Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object. - :param str name: Name of the API key. The name is not checked for - uniqueness. Therefore multiple names with the same value can exist. Access - is done via the UUID of the API key. - :param str description: (optional) The optional description of the API key. - The 'description' property is only available if a description was provided - during a create of an API key. - :param str apikey: (optional) You can optionally passthrough the API key - value for this API key. If passed, a minimum length validation of 32 - characters for that apiKey value is done, i.e. the value can contain any - characters and can even be non-URL safe, but the minimum length requirement - must be met. If omitted, the API key management will create an URL safe - opaque API key value. The value of the API key is checked for uniqueness. - Ensure enough variations when passing in this value. - :param bool store_value: (optional) Send true or false to set whether the - API key value is retrievable in the future by using the Get details of an - API key request. If you create an API key for a user, you must specify - `false` or omit the value. We don't allow storing of API keys for users. - :param str action_when_leaked: (optional) Defines the action to take when - API key is leaked, valid values are 'none', 'disable' and 'delete'. - :param str expires_at: (optional) Date and time when the API key becomes - invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. - **WARNING** An API key will be permanently and irrevocably deleted when - both the expires_at and modified_at timestamps are more than ninety (90) - days in the past, regardless of the key’s locked status or any other state. + :param int limit: Maximum allowed compute resource links per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their + compute resource links usage counts. + """ + self.limit = limit + self.profiles = profiles + + @classmethod + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseCrLinksPerProfile': + """Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object from a json dictionary.""" + args = {} + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseCrLinksPerProfile JSON' + ) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this IdentityLimitsUsageResponseCrLinksPerProfile object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'IdentityLimitsUsageResponseCrLinksPerProfile') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'IdentityLimitsUsageResponseCrLinksPerProfile') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class IdentityLimitsUsageResponseCrRulesPerProfile: + """ + Usage count for compute resource rules per profile. + + :param int limit: Maximum allowed compute resource rules per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their + compute resource rules usage counts. + """ + + def __init__( + self, + limit: int, + *, + profiles: Optional[List['ProfileCount']] = None, + ) -> None: """ - self.name = name - self.description = description - self.apikey = apikey - self.store_value = store_value - self.action_when_leaked = action_when_leaked - self.expires_at = expires_at + Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object. + + :param int limit: Maximum allowed compute resource rules per profile. + :param List[ProfileCount] profiles: (optional) List of profiles with their + compute resource rules usage counts. + """ + self.limit = limit + self.profiles = profiles @classmethod - def from_dict(cls, _dict: Dict) -> 'ApiKeyInsideCreateServiceIdRequest': - """Initialize a ApiKeyInsideCreateServiceIdRequest object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseCrRulesPerProfile': + """Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'name\' not present in ApiKeyInsideCreateServiceIdRequest JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (apikey := _dict.get('apikey')) is not None: - args['apikey'] = apikey - if (store_value := _dict.get('store_value')) is not None: - args['store_value'] = store_value - if (action_when_leaked := _dict.get('action_when_leaked')) is not None: - args['action_when_leaked'] = action_when_leaked - if (expires_at := _dict.get('expires_at')) is not None: - args['expires_at'] = expires_at + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseCrRulesPerProfile JSON' + ) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApiKeyInsideCreateServiceIdRequest object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'apikey') and self.apikey is not None: - _dict['apikey'] = self.apikey - if hasattr(self, 'store_value') and self.store_value is not None: - _dict['store_value'] = self.store_value - if hasattr(self, 'action_when_leaked') and self.action_when_leaked is not None: - _dict['action_when_leaked'] = self.action_when_leaked - if hasattr(self, 'expires_at') and self.expires_at is not None: - _dict['expires_at'] = self.expires_at + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -8415,129 +12537,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApiKeyInsideCreateServiceIdRequest object.""" + """Return a `str` version of this IdentityLimitsUsageResponseCrRulesPerProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApiKeyInsideCreateServiceIdRequest') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseCrRulesPerProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApiKeyInsideCreateServiceIdRequest') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseCrRulesPerProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApiKeyList: +class IdentityLimitsUsageResponseServiceidsPerGroup: """ - Response body format for the List API keys V1 REST request. + Usage count for service IDs per group. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 items - per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is available. - :param str next: (optional) Link to the next available page. If 'next' property - is not part of the response no next page is available. - :param List[ApiKey] apikeys: List of API keys based on the query paramters and - the page size. The apikeys array is always part of the response but might be - empty depending on the query parameters values provided. + :param int limit: Maximum allowed service IDs per group. + :param List[ServiceIdGroupCount] serviceid_groups: (optional) List of service ID + groups with their usage counts. """ def __init__( self, - apikeys: List['ApiKey'], + limit: int, *, - context: Optional['ResponseContext'] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, - first: Optional[str] = None, - previous: Optional[str] = None, - next: Optional[str] = None, + serviceid_groups: Optional[List['ServiceIdGroupCount']] = None, ) -> None: """ - Initialize a ApiKeyList object. + Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object. - :param List[ApiKey] apikeys: List of API keys based on the query paramters - and the page size. The apikeys array is always part of the response but - might be empty depending on the query parameters values provided. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 - items per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is - available. - :param str next: (optional) Link to the next available page. If 'next' - property is not part of the response no next page is available. + :param int limit: Maximum allowed service IDs per group. + :param List[ServiceIdGroupCount] serviceid_groups: (optional) List of + service ID groups with their usage counts. """ - self.context = context - self.offset = offset self.limit = limit - self.first = first - self.previous = previous - self.next = next - self.apikeys = apikeys + self.serviceid_groups = serviceid_groups @classmethod - def from_dict(cls, _dict: Dict) -> 'ApiKeyList': - """Initialize a ApiKeyList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseServiceidsPerGroup': + """Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (offset := _dict.get('offset')) is not None: - args['offset'] = offset if (limit := _dict.get('limit')) is not None: args['limit'] = limit - if (first := _dict.get('first')) is not None: - args['first'] = first - if (previous := _dict.get('previous')) is not None: - args['previous'] = previous - if (next := _dict.get('next')) is not None: - args['next'] = next - if (apikeys := _dict.get('apikeys')) is not None: - args['apikeys'] = [ApiKey.from_dict(v) for v in apikeys] else: - raise ValueError('Required property \'apikeys\' not present in ApiKeyList JSON') + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseServiceidsPerGroup JSON' + ) + if (serviceid_groups := _dict.get('serviceid_groups')) is not None: + args['serviceid_groups'] = [ServiceIdGroupCount.from_dict(v) for v in serviceid_groups] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApiKeyList object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'offset') and self.offset is not None: - _dict['offset'] = self.offset if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit - if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first - if hasattr(self, 'previous') and self.previous is not None: - _dict['previous'] = self.previous - if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next - if hasattr(self, 'apikeys') and self.apikeys is not None: - apikeys_list = [] - for v in self.apikeys: + if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: + serviceid_groups_list = [] + for v in self.serviceid_groups: if isinstance(v, dict): - apikeys_list.append(v) + serviceid_groups_list.append(v) else: - apikeys_list.append(v.to_dict()) - _dict['apikeys'] = apikeys_list + serviceid_groups_list.append(v.to_dict()) + _dict['serviceid_groups'] = serviceid_groups_list return _dict def _to_dict(self): @@ -8545,114 +12615,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApiKeyList object.""" + """Return a `str` version of this IdentityLimitsUsageResponseServiceidsPerGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApiKeyList') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseServiceidsPerGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApiKeyList') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseServiceidsPerGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApikeyActivity: +class IdentityLimitsUsageResponseTemplateVersionsPerTemplate: """ - Apikeys activity details. + Usage count for template versions per template. - :param str id: Unique id of the apikey. - :param str name: (optional) Name provided during creation of the apikey. - :param str type: Type of the apikey. Supported values are `serviceid` and - `user`. - :param ApikeyActivityServiceid serviceid: (optional) serviceid details will be - present if type is `serviceid`. - :param ApikeyActivityUser user: (optional) user details will be present if type - is `user`. - :param str last_authn: (optional) Time when the apikey was last authenticated. + :param int limit: Maximum allowed versions per template. + :param List[TemplateCount] templates: (optional) List of templates with their + version usage counts. """ def __init__( self, - id: str, - type: str, + limit: int, *, - name: Optional[str] = None, - serviceid: Optional['ApikeyActivityServiceid'] = None, - user: Optional['ApikeyActivityUser'] = None, - last_authn: Optional[str] = None, + templates: Optional[List['TemplateCount']] = None, ) -> None: """ - Initialize a ApikeyActivity object. + Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object. - :param str id: Unique id of the apikey. - :param str type: Type of the apikey. Supported values are `serviceid` and - `user`. - :param str name: (optional) Name provided during creation of the apikey. - :param ApikeyActivityServiceid serviceid: (optional) serviceid details will - be present if type is `serviceid`. - :param ApikeyActivityUser user: (optional) user details will be present if - type is `user`. - :param str last_authn: (optional) Time when the apikey was last - authenticated. + :param int limit: Maximum allowed versions per template. + :param List[TemplateCount] templates: (optional) List of templates with + their version usage counts. """ - self.id = id - self.name = name - self.type = type - self.serviceid = serviceid - self.user = user - self.last_authn = last_authn + self.limit = limit + self.templates = templates @classmethod - def from_dict(cls, _dict: Dict) -> 'ApikeyActivity': - """Initialize a ApikeyActivity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate': + """Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ApikeyActivity JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - if (type := _dict.get('type')) is not None: - args['type'] = type + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'type\' not present in ApikeyActivity JSON') - if (serviceid := _dict.get('serviceid')) is not None: - args['serviceid'] = ApikeyActivityServiceid.from_dict(serviceid) - if (user := _dict.get('user')) is not None: - args['user'] = ApikeyActivityUser.from_dict(user) - if (last_authn := _dict.get('last_authn')) is not None: - args['last_authn'] = last_authn + raise ValueError( + 'Required property \'limit\' not present in IdentityLimitsUsageResponseTemplateVersionsPerTemplate JSON' + ) + if (templates := _dict.get('templates')) is not None: + args['templates'] = [TemplateCount.from_dict(v) for v in templates] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApikeyActivity object from a json dictionary.""" + """Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'serviceid') and self.serviceid is not None: - if isinstance(self.serviceid, dict): - _dict['serviceid'] = self.serviceid - else: - _dict['serviceid'] = self.serviceid.to_dict() - if hasattr(self, 'user') and self.user is not None: - if isinstance(self.user, dict): - _dict['user'] = self.user - else: - _dict['user'] = self.user.to_dict() - if hasattr(self, 'last_authn') and self.last_authn is not None: - _dict['last_authn'] = self.last_authn + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'templates') and self.templates is not None: + templates_list = [] + for v in self.templates: + if isinstance(v, dict): + templates_list.append(v) + else: + templates_list.append(v.to_dict()) + _dict['templates'] = templates_list return _dict def _to_dict(self): @@ -8660,65 +12693,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApikeyActivity object.""" + """Return a `str` version of this IdentityLimitsUsageResponseTemplateVersionsPerTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApikeyActivity') -> bool: + def __eq__(self, other: 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApikeyActivity') -> bool: + def __ne__(self, other: 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApikeyActivityServiceid: +class IdentityPreferenceResponse: """ - serviceid details will be present if type is `serviceid`. + IdentityPreferenceResponse. - :param str id: (optional) Unique identifier of this Service Id. - :param str name: (optional) Name provided during creation of the serviceid. + :param str service: (optional) Service of the preference. + :param str id: (optional) Unique ID of the preference. + :param str account_id: (optional) Account ID of the preference, only present for + scope 'account'. + :param str scope: (optional) Scope of the preference, 'global' or 'account'. + :param str value_string: (optional) String value of the preference, only one + value property is set, either 'value_string' or 'value_list_of_strings' is + present. + :param List[str] value_list_of_strings: (optional) List of values of the + preference, only one value property is set, either 'value_string' or + 'value_list_of_strings' is present. """ def __init__( self, *, + service: Optional[str] = None, id: Optional[str] = None, - name: Optional[str] = None, + account_id: Optional[str] = None, + scope: Optional[str] = None, + value_string: Optional[str] = None, + value_list_of_strings: Optional[List[str]] = None, ) -> None: """ - Initialize a ApikeyActivityServiceid object. + Initialize a IdentityPreferenceResponse object. - :param str id: (optional) Unique identifier of this Service Id. - :param str name: (optional) Name provided during creation of the serviceid. + :param str service: (optional) Service of the preference. + :param str id: (optional) Unique ID of the preference. + :param str account_id: (optional) Account ID of the preference, only + present for scope 'account'. + :param str scope: (optional) Scope of the preference, 'global' or + 'account'. + :param str value_string: (optional) String value of the preference, only + one value property is set, either 'value_string' or 'value_list_of_strings' + is present. + :param List[str] value_list_of_strings: (optional) List of values of the + preference, only one value property is set, either 'value_string' or + 'value_list_of_strings' is present. """ + self.service = service self.id = id - self.name = name + self.account_id = account_id + self.scope = scope + self.value_string = value_string + self.value_list_of_strings = value_list_of_strings @classmethod - def from_dict(cls, _dict: Dict) -> 'ApikeyActivityServiceid': - """Initialize a ApikeyActivityServiceid object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityPreferenceResponse': + """Initialize a IdentityPreferenceResponse object from a json dictionary.""" args = {} + if (service := _dict.get('service')) is not None: + args['service'] = service if (id := _dict.get('id')) is not None: args['id'] = id - if (name := _dict.get('name')) is not None: - args['name'] = name + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + if (scope := _dict.get('scope')) is not None: + args['scope'] = scope + if (value_string := _dict.get('value_string')) is not None: + args['value_string'] = value_string + if (value_list_of_strings := _dict.get('value_list_of_strings')) is not None: + args['value_list_of_strings'] = value_list_of_strings return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApikeyActivityServiceid object from a json dictionary.""" + """Initialize a IdentityPreferenceResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'service') and self.service is not None: + _dict['service'] = self.service if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'scope') and self.scope is not None: + _dict['scope'] = self.scope + if hasattr(self, 'value_string') and self.value_string is not None: + _dict['value_string'] = self.value_string + if hasattr(self, 'value_list_of_strings') and self.value_list_of_strings is not None: + _dict['value_list_of_strings'] = self.value_list_of_strings return _dict def _to_dict(self): @@ -8726,81 +12802,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApikeyActivityServiceid object.""" + """Return a `str` version of this IdentityPreferenceResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApikeyActivityServiceid') -> bool: + def __eq__(self, other: 'IdentityPreferenceResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApikeyActivityServiceid') -> bool: + def __ne__(self, other: 'IdentityPreferenceResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ApikeyActivityUser: +class IdentityPreferencesResponse: """ - user details will be present if type is `user`. + IdentityPreferencesResponse. - :param str iam_id: (optional) IAMid of the user. - :param str name: (optional) Name of the user. - :param str username: (optional) Username of the user. - :param str email: (optional) Email of the user. + :param List[IdentityPreferenceResponse] preferences: List of Identity + Preferences. """ def __init__( self, - *, - iam_id: Optional[str] = None, - name: Optional[str] = None, - username: Optional[str] = None, - email: Optional[str] = None, + preferences: List['IdentityPreferenceResponse'], ) -> None: """ - Initialize a ApikeyActivityUser object. + Initialize a IdentityPreferencesResponse object. - :param str iam_id: (optional) IAMid of the user. - :param str name: (optional) Name of the user. - :param str username: (optional) Username of the user. - :param str email: (optional) Email of the user. + :param List[IdentityPreferenceResponse] preferences: List of Identity + Preferences. """ - self.iam_id = iam_id - self.name = name - self.username = username - self.email = email + self.preferences = preferences @classmethod - def from_dict(cls, _dict: Dict) -> 'ApikeyActivityUser': - """Initialize a ApikeyActivityUser object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IdentityPreferencesResponse': + """Initialize a IdentityPreferencesResponse object from a json dictionary.""" args = {} - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - if (name := _dict.get('name')) is not None: - args['name'] = name - if (username := _dict.get('username')) is not None: - args['username'] = username - if (email := _dict.get('email')) is not None: - args['email'] = email + if (preferences := _dict.get('preferences')) is not None: + args['preferences'] = [IdentityPreferenceResponse.from_dict(v) for v in preferences] + else: + raise ValueError('Required property \'preferences\' not present in IdentityPreferencesResponse JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ApikeyActivityUser object from a json dictionary.""" + """Initialize a IdentityPreferencesResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'username') and self.username is not None: - _dict['username'] = self.username - if hasattr(self, 'email') and self.email is not None: - _dict['email'] = self.email + if hasattr(self, 'preferences') and self.preferences is not None: + preferences_list = [] + for v in self.preferences: + if isinstance(v, dict): + preferences_list.append(v) + else: + preferences_list.append(v.to_dict()) + _dict['preferences'] = preferences_list return _dict def _to_dict(self): @@ -8808,77 +12869,143 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ApikeyActivityUser object.""" + """Return a `str` version of this IdentityPreferencesResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ApikeyActivityUser') -> bool: + def __eq__(self, other: 'IdentityPreferencesResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ApikeyActivityUser') -> bool: + def __ne__(self, other: 'IdentityPreferencesResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AssignedTemplatesAccountSettingsRestrictUserDomains: +class Idp: """ - AssignedTemplatesAccountSettingsRestrictUserDomains. - - :param bool account_sufficient: (optional) - :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) - Defines if account invitations are restricted to specified domains. To remove an - entry for a realm_id, perform an update (PUT) request with only the realm_id - set. + Idp. + + :param str idp_id: (optional) + :param str entity_tag: (optional) + :param str account_id: (optional) + :param str name: (optional) + :param str type: (optional) + :param dict properties: (optional) + :param dict secrets: (optional) + :param List[ShareScope] share_scope: (optional) + :param bool active: (optional) + :param datetime created_at: (optional) + :param datetime modified_at: (optional) """ def __init__( self, *, - account_sufficient: Optional[bool] = None, - restrictions: Optional[List['AccountSettingsUserDomainRestriction']] = None, + idp_id: Optional[str] = None, + entity_tag: Optional[str] = None, + account_id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + properties: Optional[dict] = None, + secrets: Optional[dict] = None, + share_scope: Optional[List['ShareScope']] = None, + active: Optional[bool] = None, + created_at: Optional[datetime] = None, + modified_at: Optional[datetime] = None, ) -> None: """ - Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object. - - :param bool account_sufficient: (optional) - :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) - Defines if account invitations are restricted to specified domains. To - remove an entry for a realm_id, perform an update (PUT) request with only - the realm_id set. - """ - self.account_sufficient = account_sufficient - self.restrictions = restrictions + Initialize a Idp object. + + :param str idp_id: (optional) + :param str entity_tag: (optional) + :param str account_id: (optional) + :param str name: (optional) + :param str type: (optional) + :param dict properties: (optional) + :param dict secrets: (optional) + :param List[ShareScope] share_scope: (optional) + :param bool active: (optional) + :param datetime created_at: (optional) + :param datetime modified_at: (optional) + """ + self.idp_id = idp_id + self.entity_tag = entity_tag + self.account_id = account_id + self.name = name + self.type = type + self.properties = properties + self.secrets = secrets + self.share_scope = share_scope + self.active = active + self.created_at = created_at + self.modified_at = modified_at @classmethod - def from_dict(cls, _dict: Dict) -> 'AssignedTemplatesAccountSettingsRestrictUserDomains': - """Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Idp': + """Initialize a Idp object from a json dictionary.""" args = {} - if (account_sufficient := _dict.get('account_sufficient')) is not None: - args['account_sufficient'] = account_sufficient - if (restrictions := _dict.get('restrictions')) is not None: - args['restrictions'] = [AccountSettingsUserDomainRestriction.from_dict(v) for v in restrictions] + if (idp_id := _dict.get('idp_id')) is not None: + args['idp_id'] = idp_id + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + if (name := _dict.get('name')) is not None: + args['name'] = name + if (type := _dict.get('type')) is not None: + args['type'] = type + if (properties := _dict.get('properties')) is not None: + args['properties'] = properties + if (secrets := _dict.get('secrets')) is not None: + args['secrets'] = secrets + if (share_scope := _dict.get('share_scope')) is not None: + args['share_scope'] = [ShareScope.from_dict(v) for v in share_scope] + if (active := _dict.get('active')) is not None: + args['active'] = active + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AssignedTemplatesAccountSettingsRestrictUserDomains object from a json dictionary.""" + """Initialize a Idp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'account_sufficient') and self.account_sufficient is not None: - _dict['account_sufficient'] = self.account_sufficient - if hasattr(self, 'restrictions') and self.restrictions is not None: - restrictions_list = [] - for v in self.restrictions: + if hasattr(self, 'idp_id') and self.idp_id is not None: + _dict['idp_id'] = self.idp_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'properties') and self.properties is not None: + _dict['properties'] = self.properties + if hasattr(self, 'secrets') and self.secrets is not None: + _dict['secrets'] = self.secrets + if hasattr(self, 'share_scope') and self.share_scope is not None: + share_scope_list = [] + for v in self.share_scope: if isinstance(v, dict): - restrictions_list.append(v) + share_scope_list.append(v) else: - restrictions_list.append(v.to_dict()) - _dict['restrictions'] = restrictions_list + share_scope_list.append(v.to_dict()) + _dict['share_scope'] = share_scope_list + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) return _dict def _to_dict(self): @@ -8886,99 +13013,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AssignedTemplatesAccountSettingsRestrictUserDomains object.""" + """Return a `str` version of this Idp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AssignedTemplatesAccountSettingsRestrictUserDomains') -> bool: + def __eq__(self, other: 'Idp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AssignedTemplatesAccountSettingsRestrictUserDomains') -> bool: + def __ne__(self, other: 'Idp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CreateProfileLinkRequestLink: +class LimitCount: """ - Link details. + Limit and current usage count for a resource. - :param str crn: The CRN of the compute resource. - :param str namespace: (optional) The compute resource namespace, only required - if cr_type is IKS_SA or ROKS_SA. - :param str name: (optional) Name of the compute resource, only required if - cr_type is IKS_SA or ROKS_SA. - :param str component_type: (optional) Component type of the compute resource, - only required if cr_type is CE. - :param str component_name: (optional) Component name of the compute resource, - only required if cr_type is CE. + :param int limit: Maximum allowed value for the resource. + :param int count: (optional) Current usage count for the resource. """ def __init__( self, - crn: str, + limit: int, *, - namespace: Optional[str] = None, - name: Optional[str] = None, - component_type: Optional[str] = None, - component_name: Optional[str] = None, + count: Optional[int] = None, ) -> None: """ - Initialize a CreateProfileLinkRequestLink object. + Initialize a LimitCount object. - :param str crn: The CRN of the compute resource. - :param str namespace: (optional) The compute resource namespace, only - required if cr_type is IKS_SA or ROKS_SA. - :param str name: (optional) Name of the compute resource, only required if - cr_type is IKS_SA or ROKS_SA. - :param str component_type: (optional) Component type of the compute - resource, only required if cr_type is CE. - :param str component_name: (optional) Component name of the compute - resource, only required if cr_type is CE. + :param int limit: Maximum allowed value for the resource. + :param int count: (optional) Current usage count for the resource. """ - self.crn = crn - self.namespace = namespace - self.name = name - self.component_type = component_type - self.component_name = component_name + self.limit = limit + self.count = count @classmethod - def from_dict(cls, _dict: Dict) -> 'CreateProfileLinkRequestLink': - """Initialize a CreateProfileLinkRequestLink object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LimitCount': + """Initialize a LimitCount object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'crn\' not present in CreateProfileLinkRequestLink JSON') - if (namespace := _dict.get('namespace')) is not None: - args['namespace'] = namespace - if (name := _dict.get('name')) is not None: - args['name'] = name - if (component_type := _dict.get('component_type')) is not None: - args['component_type'] = component_type - if (component_name := _dict.get('component_name')) is not None: - args['component_name'] = component_name + raise ValueError('Required property \'limit\' not present in LimitCount JSON') + if (count := _dict.get('count')) is not None: + args['count'] = count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CreateProfileLinkRequestLink object from a json dictionary.""" + """Initialize a LimitCount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'namespace') and self.namespace is not None: - _dict['namespace'] = self.namespace - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'component_type') and self.component_type is not None: - _dict['component_type'] = self.component_type - if hasattr(self, 'component_name') and self.component_name is not None: - _dict['component_name'] = self.component_name + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count return _dict def _to_dict(self): @@ -8986,118 +13081,63 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CreateProfileLinkRequestLink object.""" + """Return a `str` version of this LimitCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CreateProfileLinkRequestLink') -> bool: + def __eq__(self, other: 'LimitCount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CreateProfileLinkRequestLink') -> bool: + def __ne__(self, other: 'LimitCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EffectiveAccountSettingsResponse: +class ListIdPSettingsResponse: """ - Response body format for Account Settings REST requests. + ListIdPSettingsResponse. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str account_id: Unique ID of the account. - :param AccountSettingsEffectiveSection effective: - :param AccountSettingsResponse account: Input body parameters for the Account - Settings REST request. - :param List[AccountSettingsAssignedTemplatesSection] assigned_templates: - (optional) assigned template section. + :param List[AccountIdpSettings] idps: (optional) """ def __init__( self, - account_id: str, - effective: 'AccountSettingsEffectiveSection', - account: 'AccountSettingsResponse', *, - context: Optional['ResponseContext'] = None, - assigned_templates: Optional[List['AccountSettingsAssignedTemplatesSection']] = None, + idps: Optional[List['AccountIdpSettings']] = None, ) -> None: """ - Initialize a EffectiveAccountSettingsResponse object. + Initialize a ListIdPSettingsResponse object. - :param str account_id: Unique ID of the account. - :param AccountSettingsEffectiveSection effective: - :param AccountSettingsResponse account: Input body parameters for the - Account Settings REST request. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param List[AccountSettingsAssignedTemplatesSection] assigned_templates: - (optional) assigned template section. + :param List[AccountIdpSettings] idps: (optional) """ - self.context = context - self.account_id = account_id - self.effective = effective - self.account = account - self.assigned_templates = assigned_templates + self.idps = idps @classmethod - def from_dict(cls, _dict: Dict) -> 'EffectiveAccountSettingsResponse': - """Initialize a EffectiveAccountSettingsResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ListIdPSettingsResponse': + """Initialize a ListIdPSettingsResponse object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in EffectiveAccountSettingsResponse JSON') - if (effective := _dict.get('effective')) is not None: - args['effective'] = AccountSettingsEffectiveSection.from_dict(effective) - else: - raise ValueError('Required property \'effective\' not present in EffectiveAccountSettingsResponse JSON') - if (account := _dict.get('account')) is not None: - args['account'] = AccountSettingsResponse.from_dict(account) - else: - raise ValueError('Required property \'account\' not present in EffectiveAccountSettingsResponse JSON') - if (assigned_templates := _dict.get('assigned_templates')) is not None: - args['assigned_templates'] = [ - AccountSettingsAssignedTemplatesSection.from_dict(v) for v in assigned_templates - ] + if (idps := _dict.get('idps')) is not None: + args['idps'] = [AccountIdpSettings.from_dict(v) for v in idps] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EffectiveAccountSettingsResponse object from a json dictionary.""" + """Initialize a ListIdPSettingsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'effective') and self.effective is not None: - if isinstance(self.effective, dict): - _dict['effective'] = self.effective - else: - _dict['effective'] = self.effective.to_dict() - if hasattr(self, 'account') and self.account is not None: - if isinstance(self.account, dict): - _dict['account'] = self.account - else: - _dict['account'] = self.account.to_dict() - if hasattr(self, 'assigned_templates') and self.assigned_templates is not None: - assigned_templates_list = [] - for v in self.assigned_templates: + if hasattr(self, 'idps') and self.idps is not None: + idps_list = [] + for v in self.idps: if isinstance(v, dict): - assigned_templates_list.append(v) + idps_list.append(v) else: - assigned_templates_list.append(v.to_dict()) - _dict['assigned_templates'] = assigned_templates_list + idps_list.append(v.to_dict()) + _dict['idps'] = idps_list return _dict def _to_dict(self): @@ -9105,109 +13145,63 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EffectiveAccountSettingsResponse object.""" + """Return a `str` version of this ListIdPSettingsResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EffectiveAccountSettingsResponse') -> bool: + def __eq__(self, other: 'ListIdPSettingsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EffectiveAccountSettingsResponse') -> bool: + def __ne__(self, other: 'ListIdPSettingsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EnityHistoryRecord: +class ListIdpsResponse: """ - Response body format for an entity history record. + ListIdpsResponse. - :param str timestamp: Timestamp when the action was triggered. - :param str iam_id: IAM ID of the identity which triggered the action. - :param str iam_id_account: Account of the identity which triggered the action. - :param str action: Action of the history entry. - :param List[str] params: Params of the history entry. - :param str message: Message which summarizes the executed action. + :param List[Idp] idps: (optional) """ def __init__( self, - timestamp: str, - iam_id: str, - iam_id_account: str, - action: str, - params: List[str], - message: str, + *, + idps: Optional[List['Idp']] = None, ) -> None: """ - Initialize a EnityHistoryRecord object. + Initialize a ListIdpsResponse object. - :param str timestamp: Timestamp when the action was triggered. - :param str iam_id: IAM ID of the identity which triggered the action. - :param str iam_id_account: Account of the identity which triggered the - action. - :param str action: Action of the history entry. - :param List[str] params: Params of the history entry. - :param str message: Message which summarizes the executed action. + :param List[Idp] idps: (optional) """ - self.timestamp = timestamp - self.iam_id = iam_id - self.iam_id_account = iam_id_account - self.action = action - self.params = params - self.message = message + self.idps = idps @classmethod - def from_dict(cls, _dict: Dict) -> 'EnityHistoryRecord': - """Initialize a EnityHistoryRecord object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ListIdpsResponse': + """Initialize a ListIdpsResponse object from a json dictionary.""" args = {} - if (timestamp := _dict.get('timestamp')) is not None: - args['timestamp'] = timestamp - else: - raise ValueError('Required property \'timestamp\' not present in EnityHistoryRecord JSON') - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - else: - raise ValueError('Required property \'iam_id\' not present in EnityHistoryRecord JSON') - if (iam_id_account := _dict.get('iam_id_account')) is not None: - args['iam_id_account'] = iam_id_account - else: - raise ValueError('Required property \'iam_id_account\' not present in EnityHistoryRecord JSON') - if (action := _dict.get('action')) is not None: - args['action'] = action - else: - raise ValueError('Required property \'action\' not present in EnityHistoryRecord JSON') - if (params := _dict.get('params')) is not None: - args['params'] = params - else: - raise ValueError('Required property \'params\' not present in EnityHistoryRecord JSON') - if (message := _dict.get('message')) is not None: - args['message'] = message - else: - raise ValueError('Required property \'message\' not present in EnityHistoryRecord JSON') + if (idps := _dict.get('idps')) is not None: + args['idps'] = [Idp.from_dict(v) for v in idps] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EnityHistoryRecord object from a json dictionary.""" + """Initialize a ListIdpsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'timestamp') and self.timestamp is not None: - _dict['timestamp'] = self.timestamp - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'iam_id_account') and self.iam_id_account is not None: - _dict['iam_id_account'] = self.iam_id_account - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'params') and self.params is not None: - _dict['params'] = self.params - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message + if hasattr(self, 'idps') and self.idps is not None: + idps_list = [] + for v in self.idps: + if isinstance(v, dict): + idps_list.append(v) + else: + idps_list.append(v.to_dict()) + _dict['idps'] = idps_list return _dict def _to_dict(self): @@ -9215,76 +13209,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EnityHistoryRecord object.""" + """Return a `str` version of this ListIdpsResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EnityHistoryRecord') -> bool: + def __eq__(self, other: 'ListIdpsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EnityHistoryRecord') -> bool: + def __ne__(self, other: 'ListIdpsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EntityActivity: +class MfaEnrollmentTypeStatus: """ - EntityActivity. + MfaEnrollmentTypeStatus. - :param str id: Unique id of the entity. - :param str name: (optional) Name provided during creation of the entity. - :param str last_authn: (optional) Time when the entity was last authenticated. + :param bool required: Describes whether the enrollment type is required. + :param bool enrolled: Describes whether the enrollment type is enrolled. """ def __init__( self, - id: str, - *, - name: Optional[str] = None, - last_authn: Optional[str] = None, + required: bool, + enrolled: bool, ) -> None: """ - Initialize a EntityActivity object. + Initialize a MfaEnrollmentTypeStatus object. - :param str id: Unique id of the entity. - :param str name: (optional) Name provided during creation of the entity. - :param str last_authn: (optional) Time when the entity was last - authenticated. + :param bool required: Describes whether the enrollment type is required. + :param bool enrolled: Describes whether the enrollment type is enrolled. """ - self.id = id - self.name = name - self.last_authn = last_authn + self.required = required + self.enrolled = enrolled @classmethod - def from_dict(cls, _dict: Dict) -> 'EntityActivity': - """Initialize a EntityActivity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'MfaEnrollmentTypeStatus': + """Initialize a MfaEnrollmentTypeStatus object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id + if (required := _dict.get('required')) is not None: + args['required'] = required else: - raise ValueError('Required property \'id\' not present in EntityActivity JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - if (last_authn := _dict.get('last_authn')) is not None: - args['last_authn'] = last_authn + raise ValueError('Required property \'required\' not present in MfaEnrollmentTypeStatus JSON') + if (enrolled := _dict.get('enrolled')) is not None: + args['enrolled'] = enrolled + else: + raise ValueError('Required property \'enrolled\' not present in MfaEnrollmentTypeStatus JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EntityActivity object from a json dictionary.""" + """Initialize a MfaEnrollmentTypeStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'last_authn') and self.last_authn is not None: - _dict['last_authn'] = self.last_authn + if hasattr(self, 'required') and self.required is not None: + _dict['required'] = self.required + if hasattr(self, 'enrolled') and self.enrolled is not None: + _dict['enrolled'] = self.enrolled return _dict def _to_dict(self): @@ -9292,93 +13278,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EntityActivity object.""" + """Return a `str` version of this MfaEnrollmentTypeStatus object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EntityActivity') -> bool: + def __eq__(self, other: 'MfaEnrollmentTypeStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EntityActivity') -> bool: + def __ne__(self, other: 'MfaEnrollmentTypeStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Error: +class PolicyTemplateReference: """ - Error information. + Metadata for external access policy. - :param str code: Error code of the REST Exception. - :param str message_code: Error message code of the REST Exception. - :param str message: Error message of the REST Exception. Error messages are - derived base on the input locale of the REST request and the available Message - catalogs. Dynamic fallback to 'us-english' is happening if no message catalog is - available for the provided input locale. - :param str details: (optional) Error details of the REST Exception. + :param str id: ID of Access Policy Template. + :param str version: Version of Access Policy Template. """ def __init__( self, - code: str, - message_code: str, - message: str, - *, - details: Optional[str] = None, + id: str, + version: str, ) -> None: """ - Initialize a Error object. + Initialize a PolicyTemplateReference object. - :param str code: Error code of the REST Exception. - :param str message_code: Error message code of the REST Exception. - :param str message: Error message of the REST Exception. Error messages are - derived base on the input locale of the REST request and the available - Message catalogs. Dynamic fallback to 'us-english' is happening if no - message catalog is available for the provided input locale. - :param str details: (optional) Error details of the REST Exception. + :param str id: ID of Access Policy Template. + :param str version: Version of Access Policy Template. """ - self.code = code - self.message_code = message_code - self.message = message - self.details = details + self.id = id + self.version = version @classmethod - def from_dict(cls, _dict: Dict) -> 'Error': - """Initialize a Error object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PolicyTemplateReference': + """Initialize a PolicyTemplateReference object from a json dictionary.""" args = {} - if (code := _dict.get('code')) is not None: - args['code'] = code - else: - raise ValueError('Required property \'code\' not present in Error JSON') - if (message_code := _dict.get('message_code')) is not None: - args['message_code'] = message_code + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'message_code\' not present in Error JSON') - if (message := _dict.get('message')) is not None: - args['message'] = message + raise ValueError('Required property \'id\' not present in PolicyTemplateReference JSON') + if (version := _dict.get('version')) is not None: + args['version'] = version else: - raise ValueError('Required property \'message\' not present in Error JSON') - if (details := _dict.get('details')) is not None: - args['details'] = details + raise ValueError('Required property \'version\' not present in PolicyTemplateReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Error object from a json dictionary.""" + """Initialize a PolicyTemplateReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message_code') and self.message_code is not None: - _dict['message_code'] = self.message_code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'details') and self.details is not None: - _dict['details'] = self.details + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version return _dict def _to_dict(self): @@ -9386,96 +13347,158 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Error object.""" + """Return a `str` version of this PolicyTemplateReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Error') -> bool: + def __eq__(self, other: 'PolicyTemplateReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Error') -> bool: + def __ne__(self, other: 'PolicyTemplateReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ExceptionResponse: +class ProfileClaimRule: """ - Response body parameters in case of error situations. + ProfileClaimRule. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str status_code: Error message code of the REST Exception. - :param List[Error] errors: List of errors that occured. - :param str trace: (optional) Unique ID of the requst. + :param str id: the unique identifier of the claim rule. + :param str entity_tag: version of the claim rule. + :param datetime created_at: If set contains a date time string of the creation + date in ISO format. + :param datetime modified_at: (optional) If set contains a date time string of + the last modification date in ISO format. + :param str name: (optional) The optional claim rule name. + :param str type: Type of the claim rule, either 'Profile-SAML' or 'Profile-CR'. + :param str realm_name: (optional) The realm name of the Idp this claim rule + applies to. + :param int expiration: Session expiration in seconds. + :param str cr_type: (optional) The compute resource type. Not required if type + is Profile-SAML. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. + :param List[ProfileClaimRuleConditions] conditions: Conditions of this claim + rule. """ def __init__( self, - status_code: str, - errors: List['Error'], + id: str, + entity_tag: str, + created_at: datetime, + type: str, + expiration: int, + conditions: List['ProfileClaimRuleConditions'], *, - context: Optional['ResponseContext'] = None, - trace: Optional[str] = None, + modified_at: Optional[datetime] = None, + name: Optional[str] = None, + realm_name: Optional[str] = None, + cr_type: Optional[str] = None, ) -> None: """ - Initialize a ExceptionResponse object. + Initialize a ProfileClaimRule object. - :param str status_code: Error message code of the REST Exception. - :param List[Error] errors: List of errors that occured. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str trace: (optional) Unique ID of the requst. + :param str id: the unique identifier of the claim rule. + :param str entity_tag: version of the claim rule. + :param datetime created_at: If set contains a date time string of the + creation date in ISO format. + :param str type: Type of the claim rule, either 'Profile-SAML' or + 'Profile-CR'. + :param int expiration: Session expiration in seconds. + :param List[ProfileClaimRuleConditions] conditions: Conditions of this + claim rule. + :param datetime modified_at: (optional) If set contains a date time string + of the last modification date in ISO format. + :param str name: (optional) The optional claim rule name. + :param str realm_name: (optional) The realm name of the Idp this claim rule + applies to. + :param str cr_type: (optional) The compute resource type. Not required if + type is Profile-SAML. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. """ - self.context = context - self.status_code = status_code - self.errors = errors - self.trace = trace + self.id = id + self.entity_tag = entity_tag + self.created_at = created_at + self.modified_at = modified_at + self.name = name + self.type = type + self.realm_name = realm_name + self.expiration = expiration + self.cr_type = cr_type + self.conditions = conditions @classmethod - def from_dict(cls, _dict: Dict) -> 'ExceptionResponse': - """Initialize a ExceptionResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileClaimRule': + """Initialize a ProfileClaimRule object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (status_code := _dict.get('status_code')) is not None: - args['status_code'] = status_code + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'status_code\' not present in ExceptionResponse JSON') - if (errors := _dict.get('errors')) is not None: - args['errors'] = [Error.from_dict(v) for v in errors] + raise ValueError('Required property \'id\' not present in ProfileClaimRule JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in ProfileClaimRule JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ProfileClaimRule JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + if (name := _dict.get('name')) is not None: + args['name'] = name + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in ProfileClaimRule JSON') + if (realm_name := _dict.get('realm_name')) is not None: + args['realm_name'] = realm_name + if (expiration := _dict.get('expiration')) is not None: + args['expiration'] = expiration + else: + raise ValueError('Required property \'expiration\' not present in ProfileClaimRule JSON') + if (cr_type := _dict.get('cr_type')) is not None: + args['cr_type'] = cr_type + if (conditions := _dict.get('conditions')) is not None: + args['conditions'] = [ProfileClaimRuleConditions.from_dict(v) for v in conditions] else: - raise ValueError('Required property \'errors\' not present in ExceptionResponse JSON') - if (trace := _dict.get('trace')) is not None: - args['trace'] = trace + raise ValueError('Required property \'conditions\' not present in ProfileClaimRule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ExceptionResponse object from a json dictionary.""" + """Initialize a ProfileClaimRule object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'status_code') and self.status_code is not None: - _dict['status_code'] = self.status_code - if hasattr(self, 'errors') and self.errors is not None: - errors_list = [] - for v in self.errors: + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'realm_name') and self.realm_name is not None: + _dict['realm_name'] = self.realm_name + if hasattr(self, 'expiration') and self.expiration is not None: + _dict['expiration'] = self.expiration + if hasattr(self, 'cr_type') and self.cr_type is not None: + _dict['cr_type'] = self.cr_type + if hasattr(self, 'conditions') and self.conditions is not None: + conditions_list = [] + for v in self.conditions: if isinstance(v, dict): - errors_list.append(v) + conditions_list.append(v) else: - errors_list.append(v.to_dict()) - _dict['errors'] = errors_list - if hasattr(self, 'trace') and self.trace is not None: - _dict['trace'] = self.trace + conditions_list.append(v.to_dict()) + _dict['conditions'] = conditions_list return _dict def _to_dict(self): @@ -9483,290 +13506,164 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ExceptionResponse object.""" + """Return a `str` version of this ProfileClaimRule object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ExceptionResponse') -> bool: + def __eq__(self, other: 'ProfileClaimRule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ExceptionResponse') -> bool: + def __ne__(self, other: 'ProfileClaimRule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdBasedMfaEnrollment: +class ProfileClaimRuleConditions: """ - IdBasedMfaEnrollment. + ProfileClaimRuleConditions. - :param str trait_account_default: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str trait_user_specific: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str trait_effective: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param bool complies: The enrollment complies to the effective requirement. - :param str comply_state: (optional) Defines comply state for the account. Valid - values: - * NO - User does not comply in the given account. - * ACCOUNT- User complies in the given account, but does not comply in at least - one of the other account memberships. - * CROSS_ACCOUNT - User complies in the given account and across all other - account memberships. + :param str claim: The claim to evaluate against. [Learn + more](/docs/account?topic=account-iam-condition-properties&interface=ui#cr-attribute-names). + :param str operator: The operation to perform on the claim. valid values are + EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, CONTAINS, IN. + :param str value: The stringified JSON value that the claim is compared to using + the operator. """ def __init__( self, - trait_account_default: str, - trait_effective: str, - complies: bool, - *, - trait_user_specific: Optional[str] = None, - comply_state: Optional[str] = None, + claim: str, + operator: str, + value: str, ) -> None: """ - Initialize a IdBasedMfaEnrollment object. + Initialize a ProfileClaimRuleConditions object. - :param str trait_account_default: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str trait_effective: MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param bool complies: The enrollment complies to the effective requirement. - :param str trait_user_specific: (optional) MFA trait definitions as - follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param str comply_state: (optional) Defines comply state for the account. - Valid values: - * NO - User does not comply in the given account. - * ACCOUNT- User complies in the given account, but does not comply in at - least one of the other account memberships. - * CROSS_ACCOUNT - User complies in the given account and across all other - account memberships. + :param str claim: The claim to evaluate against. [Learn + more](/docs/account?topic=account-iam-condition-properties&interface=ui#cr-attribute-names). + :param str operator: The operation to perform on the claim. valid values + are EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, + CONTAINS, IN. + :param str value: The stringified JSON value that the claim is compared to + using the operator. """ - self.trait_account_default = trait_account_default - self.trait_user_specific = trait_user_specific - self.trait_effective = trait_effective - self.complies = complies - self.comply_state = comply_state + self.claim = claim + self.operator = operator + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'IdBasedMfaEnrollment': - """Initialize a IdBasedMfaEnrollment object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileClaimRuleConditions': + """Initialize a ProfileClaimRuleConditions object from a json dictionary.""" args = {} - if (trait_account_default := _dict.get('trait_account_default')) is not None: - args['trait_account_default'] = trait_account_default + if (claim := _dict.get('claim')) is not None: + args['claim'] = claim else: - raise ValueError('Required property \'trait_account_default\' not present in IdBasedMfaEnrollment JSON') - if (trait_user_specific := _dict.get('trait_user_specific')) is not None: - args['trait_user_specific'] = trait_user_specific - if (trait_effective := _dict.get('trait_effective')) is not None: - args['trait_effective'] = trait_effective + raise ValueError('Required property \'claim\' not present in ProfileClaimRuleConditions JSON') + if (operator := _dict.get('operator')) is not None: + args['operator'] = operator else: - raise ValueError('Required property \'trait_effective\' not present in IdBasedMfaEnrollment JSON') - if (complies := _dict.get('complies')) is not None: - args['complies'] = complies + raise ValueError('Required property \'operator\' not present in ProfileClaimRuleConditions JSON') + if (value := _dict.get('value')) is not None: + args['value'] = value else: - raise ValueError('Required property \'complies\' not present in IdBasedMfaEnrollment JSON') - if (comply_state := _dict.get('comply_state')) is not None: - args['comply_state'] = comply_state + raise ValueError('Required property \'value\' not present in ProfileClaimRuleConditions JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdBasedMfaEnrollment object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'trait_account_default') and self.trait_account_default is not None: - _dict['trait_account_default'] = self.trait_account_default - if hasattr(self, 'trait_user_specific') and self.trait_user_specific is not None: - _dict['trait_user_specific'] = self.trait_user_specific - if hasattr(self, 'trait_effective') and self.trait_effective is not None: - _dict['trait_effective'] = self.trait_effective - if hasattr(self, 'complies') and self.complies is not None: - _dict['complies'] = self.complies - if hasattr(self, 'comply_state') and self.comply_state is not None: - _dict['comply_state'] = self.comply_state - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this IdBasedMfaEnrollment object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IdBasedMfaEnrollment') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'IdBasedMfaEnrollment') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TraitAccountDefaultEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ - - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' - - class TraitUserSpecificEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ - - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' + """Initialize a ProfileClaimRuleConditions object from a json dictionary.""" + return cls.from_dict(_dict) - class TraitEffectiveEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'claim') and self.claim is not None: + _dict['claim'] = self.claim + if hasattr(self, 'operator') and self.operator is not None: + _dict['operator'] = self.operator + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + return _dict - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class ComplyStateEnum(str, Enum): - """ - Defines comply state for the account. Valid values: - * NO - User does not comply in the given account. - * ACCOUNT- User complies in the given account, but does not comply in at least - one of the other account memberships. - * CROSS_ACCOUNT - User complies in the given account and across all other - account memberships. - """ + def __str__(self) -> str: + """Return a `str` version of this ProfileClaimRuleConditions object.""" + return json.dumps(self.to_dict(), indent=2) - NO = 'NO' - ACCOUNT = 'ACCOUNT' - CROSS_ACCOUNT = 'CROSS_ACCOUNT' + def __eq__(self, other: 'ProfileClaimRuleConditions') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ProfileClaimRuleConditions') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class IdentityCount: +class ProfileClaimRuleList: """ - API key count for a specific identity. + ProfileClaimRuleList. - :param str iam_id: (optional) IAM identifier of the identity. - :param int count: (optional) Number of API keys for the identity. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param List[ProfileClaimRule] rules: List of claim rules. """ def __init__( self, + rules: List['ProfileClaimRule'], *, - iam_id: Optional[str] = None, - count: Optional[int] = None, + context: Optional['ResponseContext'] = None, ) -> None: """ - Initialize a IdentityCount object. + Initialize a ProfileClaimRuleList object. - :param str iam_id: (optional) IAM identifier of the identity. - :param int count: (optional) Number of API keys for the identity. + :param List[ProfileClaimRule] rules: List of claim rules. + :param ResponseContext context: (optional) Context with key properties for + problem determination. """ - self.iam_id = iam_id - self.count = count + self.context = context + self.rules = rules @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityCount': - """Initialize a IdentityCount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileClaimRuleList': + """Initialize a ProfileClaimRuleList object from a json dictionary.""" args = {} - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - if (count := _dict.get('count')) is not None: - args['count'] = count + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (rules := _dict.get('rules')) is not None: + args['rules'] = [ProfileClaimRule.from_dict(v) for v in rules] + else: + raise ValueError('Required property \'rules\' not present in ProfileClaimRuleList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityCount object from a json dictionary.""" + """Initialize a ProfileClaimRuleList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list return _dict def _to_dict(self): @@ -9774,239 +13671,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityCount object.""" + """Return a `str` version of this ProfileClaimRuleList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityCount') -> bool: + def __eq__(self, other: 'ProfileClaimRuleList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityCount') -> bool: + def __ne__(self, other: 'ProfileClaimRuleList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponse: +class ProfileCount: """ - Response body format for identity limits usage. + Resource count for a specific profile. - :param LimitCount serviceid_groups: (optional) Limit and current usage count for - a resource. - :param IdentityLimitsUsageResponseServiceidsPerGroup serviceids_per_group: - (optional) Usage count for service IDs per group. - :param LimitCount profiles: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseApikeysPerIdentity apikeys_per_identity: - (optional) Usage count for API keys per identity. - :param LimitCount profile_templates: (optional) Limit and current usage count - for a resource. - :param LimitCount account_settings_templates: (optional) Limit and current usage - count for a resource. - :param IdentityLimitsUsageResponseTemplateVersionsPerTemplate - template_versions_per_template: (optional) Usage count for template versions per - template. - :param LimitCount idps: (optional) Limit and current usage count for a resource. - :param IdentityLimitsUsageResponseClaimRulesPerGroup claim_rules_per_group: - (optional) Usage count for claim rules per access group. - :param IdentityLimitsUsageResponseClaimRulesPerProfile claim_rules_per_profile: - (optional) Usage count for claim rules per profile. - :param LimitCount cr_links: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseCrLinksPerProfile cr_links_per_profile: - (optional) Usage count for compute resource links per profile. - :param LimitCount cr_rules: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseCrRulesPerProfile cr_rules_per_profile: - (optional) Usage count for compute resource rules per profile. + :param str profile_id: (optional) Profile identifier. + :param int count: (optional) Number of resources associated with the profile. """ def __init__( self, *, - serviceid_groups: Optional['LimitCount'] = None, - serviceids_per_group: Optional['IdentityLimitsUsageResponseServiceidsPerGroup'] = None, - profiles: Optional['LimitCount'] = None, - apikeys_per_identity: Optional['IdentityLimitsUsageResponseApikeysPerIdentity'] = None, - profile_templates: Optional['LimitCount'] = None, - account_settings_templates: Optional['LimitCount'] = None, - template_versions_per_template: Optional['IdentityLimitsUsageResponseTemplateVersionsPerTemplate'] = None, - idps: Optional['LimitCount'] = None, - claim_rules_per_group: Optional['IdentityLimitsUsageResponseClaimRulesPerGroup'] = None, - claim_rules_per_profile: Optional['IdentityLimitsUsageResponseClaimRulesPerProfile'] = None, - cr_links: Optional['LimitCount'] = None, - cr_links_per_profile: Optional['IdentityLimitsUsageResponseCrLinksPerProfile'] = None, - cr_rules: Optional['LimitCount'] = None, - cr_rules_per_profile: Optional['IdentityLimitsUsageResponseCrRulesPerProfile'] = None, - ) -> None: - """ - Initialize a IdentityLimitsUsageResponse object. - - :param LimitCount serviceid_groups: (optional) Limit and current usage - count for a resource. - :param IdentityLimitsUsageResponseServiceidsPerGroup serviceids_per_group: - (optional) Usage count for service IDs per group. - :param LimitCount profiles: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseApikeysPerIdentity apikeys_per_identity: - (optional) Usage count for API keys per identity. - :param LimitCount profile_templates: (optional) Limit and current usage - count for a resource. - :param LimitCount account_settings_templates: (optional) Limit and current - usage count for a resource. - :param IdentityLimitsUsageResponseTemplateVersionsPerTemplate - template_versions_per_template: (optional) Usage count for template - versions per template. - :param LimitCount idps: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseClaimRulesPerGroup claim_rules_per_group: - (optional) Usage count for claim rules per access group. - :param IdentityLimitsUsageResponseClaimRulesPerProfile - claim_rules_per_profile: (optional) Usage count for claim rules per - profile. - :param LimitCount cr_links: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseCrLinksPerProfile cr_links_per_profile: - (optional) Usage count for compute resource links per profile. - :param LimitCount cr_rules: (optional) Limit and current usage count for a - resource. - :param IdentityLimitsUsageResponseCrRulesPerProfile cr_rules_per_profile: - (optional) Usage count for compute resource rules per profile. - """ - self.serviceid_groups = serviceid_groups - self.serviceids_per_group = serviceids_per_group - self.profiles = profiles - self.apikeys_per_identity = apikeys_per_identity - self.profile_templates = profile_templates - self.account_settings_templates = account_settings_templates - self.template_versions_per_template = template_versions_per_template - self.idps = idps - self.claim_rules_per_group = claim_rules_per_group - self.claim_rules_per_profile = claim_rules_per_profile - self.cr_links = cr_links - self.cr_links_per_profile = cr_links_per_profile - self.cr_rules = cr_rules - self.cr_rules_per_profile = cr_rules_per_profile - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponse': - """Initialize a IdentityLimitsUsageResponse object from a json dictionary.""" - args = {} - if (serviceid_groups := _dict.get('serviceid_groups')) is not None: - args['serviceid_groups'] = LimitCount.from_dict(serviceid_groups) - if (serviceids_per_group := _dict.get('serviceids_per_group')) is not None: - args['serviceids_per_group'] = IdentityLimitsUsageResponseServiceidsPerGroup.from_dict(serviceids_per_group) - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = LimitCount.from_dict(profiles) - if (apikeys_per_identity := _dict.get('apikeys_per_identity')) is not None: - args['apikeys_per_identity'] = IdentityLimitsUsageResponseApikeysPerIdentity.from_dict(apikeys_per_identity) - if (profile_templates := _dict.get('profile_templates')) is not None: - args['profile_templates'] = LimitCount.from_dict(profile_templates) - if (account_settings_templates := _dict.get('account_settings_templates')) is not None: - args['account_settings_templates'] = LimitCount.from_dict(account_settings_templates) - if (template_versions_per_template := _dict.get('template_versions_per_template')) is not None: - args['template_versions_per_template'] = IdentityLimitsUsageResponseTemplateVersionsPerTemplate.from_dict( - template_versions_per_template - ) - if (idps := _dict.get('idps')) is not None: - args['idps'] = LimitCount.from_dict(idps) - if (claim_rules_per_group := _dict.get('claim_rules_per_group')) is not None: - args['claim_rules_per_group'] = IdentityLimitsUsageResponseClaimRulesPerGroup.from_dict( - claim_rules_per_group - ) - if (claim_rules_per_profile := _dict.get('claim_rules_per_profile')) is not None: - args['claim_rules_per_profile'] = IdentityLimitsUsageResponseClaimRulesPerProfile.from_dict( - claim_rules_per_profile - ) - if (cr_links := _dict.get('cr_links')) is not None: - args['cr_links'] = LimitCount.from_dict(cr_links) - if (cr_links_per_profile := _dict.get('cr_links_per_profile')) is not None: - args['cr_links_per_profile'] = IdentityLimitsUsageResponseCrLinksPerProfile.from_dict(cr_links_per_profile) - if (cr_rules := _dict.get('cr_rules')) is not None: - args['cr_rules'] = LimitCount.from_dict(cr_rules) - if (cr_rules_per_profile := _dict.get('cr_rules_per_profile')) is not None: - args['cr_rules_per_profile'] = IdentityLimitsUsageResponseCrRulesPerProfile.from_dict(cr_rules_per_profile) + profile_id: Optional[str] = None, + count: Optional[int] = None, + ) -> None: + """ + Initialize a ProfileCount object. + + :param str profile_id: (optional) Profile identifier. + :param int count: (optional) Number of resources associated with the + profile. + """ + self.profile_id = profile_id + self.count = count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ProfileCount': + """Initialize a ProfileCount object from a json dictionary.""" + args = {} + if (profile_id := _dict.get('profile_id')) is not None: + args['profile_id'] = profile_id + if (count := _dict.get('count')) is not None: + args['count'] = count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponse object from a json dictionary.""" + """Initialize a ProfileCount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: - if isinstance(self.serviceid_groups, dict): - _dict['serviceid_groups'] = self.serviceid_groups - else: - _dict['serviceid_groups'] = self.serviceid_groups.to_dict() - if hasattr(self, 'serviceids_per_group') and self.serviceids_per_group is not None: - if isinstance(self.serviceids_per_group, dict): - _dict['serviceids_per_group'] = self.serviceids_per_group - else: - _dict['serviceids_per_group'] = self.serviceids_per_group.to_dict() - if hasattr(self, 'profiles') and self.profiles is not None: - if isinstance(self.profiles, dict): - _dict['profiles'] = self.profiles - else: - _dict['profiles'] = self.profiles.to_dict() - if hasattr(self, 'apikeys_per_identity') and self.apikeys_per_identity is not None: - if isinstance(self.apikeys_per_identity, dict): - _dict['apikeys_per_identity'] = self.apikeys_per_identity - else: - _dict['apikeys_per_identity'] = self.apikeys_per_identity.to_dict() - if hasattr(self, 'profile_templates') and self.profile_templates is not None: - if isinstance(self.profile_templates, dict): - _dict['profile_templates'] = self.profile_templates - else: - _dict['profile_templates'] = self.profile_templates.to_dict() - if hasattr(self, 'account_settings_templates') and self.account_settings_templates is not None: - if isinstance(self.account_settings_templates, dict): - _dict['account_settings_templates'] = self.account_settings_templates - else: - _dict['account_settings_templates'] = self.account_settings_templates.to_dict() - if hasattr(self, 'template_versions_per_template') and self.template_versions_per_template is not None: - if isinstance(self.template_versions_per_template, dict): - _dict['template_versions_per_template'] = self.template_versions_per_template - else: - _dict['template_versions_per_template'] = self.template_versions_per_template.to_dict() - if hasattr(self, 'idps') and self.idps is not None: - if isinstance(self.idps, dict): - _dict['idps'] = self.idps - else: - _dict['idps'] = self.idps.to_dict() - if hasattr(self, 'claim_rules_per_group') and self.claim_rules_per_group is not None: - if isinstance(self.claim_rules_per_group, dict): - _dict['claim_rules_per_group'] = self.claim_rules_per_group - else: - _dict['claim_rules_per_group'] = self.claim_rules_per_group.to_dict() - if hasattr(self, 'claim_rules_per_profile') and self.claim_rules_per_profile is not None: - if isinstance(self.claim_rules_per_profile, dict): - _dict['claim_rules_per_profile'] = self.claim_rules_per_profile - else: - _dict['claim_rules_per_profile'] = self.claim_rules_per_profile.to_dict() - if hasattr(self, 'cr_links') and self.cr_links is not None: - if isinstance(self.cr_links, dict): - _dict['cr_links'] = self.cr_links - else: - _dict['cr_links'] = self.cr_links.to_dict() - if hasattr(self, 'cr_links_per_profile') and self.cr_links_per_profile is not None: - if isinstance(self.cr_links_per_profile, dict): - _dict['cr_links_per_profile'] = self.cr_links_per_profile - else: - _dict['cr_links_per_profile'] = self.cr_links_per_profile.to_dict() - if hasattr(self, 'cr_rules') and self.cr_rules is not None: - if isinstance(self.cr_rules, dict): - _dict['cr_rules'] = self.cr_rules - else: - _dict['cr_rules'] = self.cr_rules.to_dict() - if hasattr(self, 'cr_rules_per_profile') and self.cr_rules_per_profile is not None: - if isinstance(self.cr_rules_per_profile, dict): - _dict['cr_rules_per_profile'] = self.cr_rules_per_profile - else: - _dict['cr_rules_per_profile'] = self.cr_rules_per_profile.to_dict() + if hasattr(self, 'profile_id') and self.profile_id is not None: + _dict['profile_id'] = self.profile_id + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count return _dict def _to_dict(self): @@ -10014,69 +13738,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponse object.""" + """Return a `str` version of this ProfileCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponse') -> bool: + def __eq__(self, other: 'ProfileCount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponse') -> bool: + def __ne__(self, other: 'ProfileCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponseApikeysPerIdentity: +class ProfileIdentitiesResponse: """ - Usage count for API keys per identity. + ProfileIdentitiesResponse. - :param int limit: Maximum allowed API keys per identity. - :param List[IdentityCount] identities: (optional) List of identities with their - API key usage counts. + :param str entity_tag: (optional) Entity tag of the profile identities response. + :param List[ProfileIdentityResponse] identities: (optional) List of identities. """ def __init__( self, - limit: int, *, - identities: Optional[List['IdentityCount']] = None, + entity_tag: Optional[str] = None, + identities: Optional[List['ProfileIdentityResponse']] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object. + Initialize a ProfileIdentitiesResponse object. - :param int limit: Maximum allowed API keys per identity. - :param List[IdentityCount] identities: (optional) List of identities with - their API key usage counts. + :param str entity_tag: (optional) Entity tag of the profile identities + response. + :param List[ProfileIdentityResponse] identities: (optional) List of + identities. """ - self.limit = limit + self.entity_tag = entity_tag self.identities = identities @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseApikeysPerIdentity': - """Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileIdentitiesResponse': + """Initialize a ProfileIdentitiesResponse object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseApikeysPerIdentity JSON' - ) + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag if (identities := _dict.get('identities')) is not None: - args['identities'] = [IdentityCount.from_dict(v) for v in identities] + args['identities'] = [ProfileIdentityResponse.from_dict(v) for v in identities] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseApikeysPerIdentity object from a json dictionary.""" + """Initialize a ProfileIdentitiesResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag if hasattr(self, 'identities') and self.identities is not None: identities_list = [] for v in self.identities: @@ -10092,77 +13812,226 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseApikeysPerIdentity object.""" + """Return a `str` version of this ProfileIdentitiesResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseApikeysPerIdentity') -> bool: + def __eq__(self, other: 'ProfileIdentitiesResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseApikeysPerIdentity') -> bool: + def __ne__(self, other: 'ProfileIdentitiesResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ProfileIdentityRequest: + """ + ProfileIdentityRequest. + + :param str identifier: Identifier of the identity that can assume the trusted + profiles. This can be a user identifier (IAM id), serviceid or crn. Internally + it uses account id of the service id for the identifier 'serviceid' and for the + identifier 'crn' it uses account id contained in the CRN. + :param str type: Type of the identity. + :param List[str] accounts: (optional) Only valid for the type user. Accounts + from which a user can assume the trusted profile. + :param str description: (optional) Description of the identity that can assume + the trusted profile. This is optional field for all the types of identities. + When this field is not set for the identity type 'serviceid' then the + description of the service id is used. Description is recommended for the + identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'. + """ + + def __init__( + self, + identifier: str, + type: str, + *, + accounts: Optional[List[str]] = None, + description: Optional[str] = None, + ) -> None: + """ + Initialize a ProfileIdentityRequest object. + + :param str identifier: Identifier of the identity that can assume the + trusted profiles. This can be a user identifier (IAM id), serviceid or crn. + Internally it uses account id of the service id for the identifier + 'serviceid' and for the identifier 'crn' it uses account id contained in + the CRN. + :param str type: Type of the identity. + :param List[str] accounts: (optional) Only valid for the type user. + Accounts from which a user can assume the trusted profile. + :param str description: (optional) Description of the identity that can + assume the trusted profile. This is optional field for all the types of + identities. When this field is not set for the identity type 'serviceid' + then the description of the service id is used. Description is recommended + for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service + project'. + """ + self.identifier = identifier + self.type = type + self.accounts = accounts + self.description = description + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ProfileIdentityRequest': + """Initialize a ProfileIdentityRequest object from a json dictionary.""" + args = {} + if (identifier := _dict.get('identifier')) is not None: + args['identifier'] = identifier + else: + raise ValueError('Required property \'identifier\' not present in ProfileIdentityRequest JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in ProfileIdentityRequest JSON') + if (accounts := _dict.get('accounts')) is not None: + args['accounts'] = accounts + if (description := _dict.get('description')) is not None: + args['description'] = description + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ProfileIdentityRequest object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'identifier') and self.identifier is not None: + _dict['identifier'] = self.identifier + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'accounts') and self.accounts is not None: + _dict['accounts'] = self.accounts + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ProfileIdentityRequest object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ProfileIdentityRequest') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ProfileIdentityRequest') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + Type of the identity. + """ -class IdentityLimitsUsageResponseClaimRulesPerGroup: + USER = 'user' + SERVICEID = 'serviceid' + CRN = 'crn' + + +class ProfileIdentityResponse: """ - Usage count for claim rules per access group. + ProfileIdentityResponse. - :param int limit: Maximum allowed claim rules per access group. - :param List[AccessGroupCount] access_groups: (optional) List of access groups - with their claim rules usage counts. + :param str iam_id: IAM ID of the identity. + :param str identifier: Identifier of the identity that can assume the trusted + profiles. This can be a user identifier (IAM id), serviceid or crn. Internally + it uses account id of the service id for the identifier 'serviceid' and for the + identifier 'crn' it uses account id contained in the CRN. + :param str type: Type of the identity. + :param List[str] accounts: (optional) Only valid for the type user. Accounts + from which a user can assume the trusted profile. + :param str description: (optional) Description of the identity that can assume + the trusted profile. This is optional field for all the types of identities. + When this field is not set for the identity type 'serviceid' then the + description of the service id is used. Description is recommended for the + identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'. """ def __init__( self, - limit: int, + iam_id: str, + identifier: str, + type: str, *, - access_groups: Optional[List['AccessGroupCount']] = None, + accounts: Optional[List[str]] = None, + description: Optional[str] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object. + Initialize a ProfileIdentityResponse object. - :param int limit: Maximum allowed claim rules per access group. - :param List[AccessGroupCount] access_groups: (optional) List of access - groups with their claim rules usage counts. + :param str iam_id: IAM ID of the identity. + :param str identifier: Identifier of the identity that can assume the + trusted profiles. This can be a user identifier (IAM id), serviceid or crn. + Internally it uses account id of the service id for the identifier + 'serviceid' and for the identifier 'crn' it uses account id contained in + the CRN. + :param str type: Type of the identity. + :param List[str] accounts: (optional) Only valid for the type user. + Accounts from which a user can assume the trusted profile. + :param str description: (optional) Description of the identity that can + assume the trusted profile. This is optional field for all the types of + identities. When this field is not set for the identity type 'serviceid' + then the description of the service id is used. Description is recommended + for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service + project'. """ - self.limit = limit - self.access_groups = access_groups + self.iam_id = iam_id + self.identifier = identifier + self.type = type + self.accounts = accounts + self.description = description @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseClaimRulesPerGroup': - """Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileIdentityResponse': + """Initialize a ProfileIdentityResponse object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseClaimRulesPerGroup JSON' - ) - if (access_groups := _dict.get('access_groups')) is not None: - args['access_groups'] = [AccessGroupCount.from_dict(v) for v in access_groups] + raise ValueError('Required property \'iam_id\' not present in ProfileIdentityResponse JSON') + if (identifier := _dict.get('identifier')) is not None: + args['identifier'] = identifier + else: + raise ValueError('Required property \'identifier\' not present in ProfileIdentityResponse JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in ProfileIdentityResponse JSON') + if (accounts := _dict.get('accounts')) is not None: + args['accounts'] = accounts + if (description := _dict.get('description')) is not None: + args['description'] = description return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseClaimRulesPerGroup object from a json dictionary.""" + """Initialize a ProfileIdentityResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'access_groups') and self.access_groups is not None: - access_groups_list = [] - for v in self.access_groups: - if isinstance(v, dict): - access_groups_list.append(v) - else: - access_groups_list.append(v.to_dict()) - _dict['access_groups'] = access_groups_list + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'identifier') and self.identifier is not None: + _dict['identifier'] = self.identifier + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'accounts') and self.accounts is not None: + _dict['accounts'] = self.accounts + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description return _dict def _to_dict(self): @@ -10170,77 +14039,147 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseClaimRulesPerGroup object.""" + """Return a `str` version of this ProfileIdentityResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerGroup') -> bool: + def __eq__(self, other: 'ProfileIdentityResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerGroup') -> bool: + def __ne__(self, other: 'ProfileIdentityResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + Type of the identity. + """ + + USER = 'user' + SERVICEID = 'serviceid' + CRN = 'crn' + -class IdentityLimitsUsageResponseClaimRulesPerProfile: +class ProfileLink: """ - Usage count for claim rules per profile. + Link details. - :param int limit: Maximum allowed claim rules per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their claim - rules usage counts. + :param str id: the unique identifier of the link. + :param str entity_tag: version of the link. + :param datetime created_at: If set contains a date time string of the creation + date in ISO format. + :param datetime modified_at: If set contains a date time string of the last + modification date in ISO format. + :param str name: (optional) Optional name of the Link. + :param str cr_type: The compute resource type. Valid values are VSI, PVS, BMS, + IKS_SA, ROKS_SA, CE. + :param bool is_cross_account: (optional) Flag to indicate that the link provides + cross account access. If not provided then the account scope of the CRN must + match the Profile's account. + :param ProfileLinkLink link: """ def __init__( self, - limit: int, + id: str, + entity_tag: str, + created_at: datetime, + modified_at: datetime, + cr_type: str, + link: 'ProfileLinkLink', *, - profiles: Optional[List['ProfileCount']] = None, + name: Optional[str] = None, + is_cross_account: Optional[bool] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object. + Initialize a ProfileLink object. - :param int limit: Maximum allowed claim rules per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their - claim rules usage counts. + :param str id: the unique identifier of the link. + :param str entity_tag: version of the link. + :param datetime created_at: If set contains a date time string of the + creation date in ISO format. + :param datetime modified_at: If set contains a date time string of the last + modification date in ISO format. + :param str cr_type: The compute resource type. Valid values are VSI, PVS, + BMS, IKS_SA, ROKS_SA, CE. + :param ProfileLinkLink link: + :param str name: (optional) Optional name of the Link. + :param bool is_cross_account: (optional) Flag to indicate that the link + provides cross account access. If not provided then the account scope of + the CRN must match the Profile's account. """ - self.limit = limit - self.profiles = profiles + self.id = id + self.entity_tag = entity_tag + self.created_at = created_at + self.modified_at = modified_at + self.name = name + self.cr_type = cr_type + self.is_cross_account = is_cross_account + self.link = link @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseClaimRulesPerProfile': - """Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileLink': + """Initialize a ProfileLink object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseClaimRulesPerProfile JSON' - ) - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] + raise ValueError('Required property \'id\' not present in ProfileLink JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in ProfileLink JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ProfileLink JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + else: + raise ValueError('Required property \'modified_at\' not present in ProfileLink JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (cr_type := _dict.get('cr_type')) is not None: + args['cr_type'] = cr_type + else: + raise ValueError('Required property \'cr_type\' not present in ProfileLink JSON') + if (is_cross_account := _dict.get('is_cross_account')) is not None: + args['is_cross_account'] = is_cross_account + if (link := _dict.get('link')) is not None: + args['link'] = ProfileLinkLink.from_dict(link) + else: + raise ValueError('Required property \'link\' not present in ProfileLink JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseClaimRulesPerProfile object from a json dictionary.""" + """Initialize a ProfileLink object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'cr_type') and self.cr_type is not None: + _dict['cr_type'] = self.cr_type + if hasattr(self, 'is_cross_account') and self.is_cross_account is not None: + _dict['is_cross_account'] = self.is_cross_account + if hasattr(self, 'link') and self.link is not None: + if isinstance(self.link, dict): + _dict['link'] = self.link + else: + _dict['link'] = self.link.to_dict() return _dict def _to_dict(self): @@ -10248,77 +14187,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseClaimRulesPerProfile object.""" + """Return a `str` version of this ProfileLink object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerProfile') -> bool: + def __eq__(self, other: 'ProfileLink') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseClaimRulesPerProfile') -> bool: + def __ne__(self, other: 'ProfileLink') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponseCrLinksPerProfile: +class ProfileLinkLink: """ - Usage count for compute resource links per profile. + ProfileLinkLink. - :param int limit: Maximum allowed compute resource links per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their - compute resource links usage counts. + :param str crn: (optional) The CRN of the compute resource. + :param str namespace: (optional) The compute resource namespace, only required + if cr_type is IKS_SA or ROKS_SA. + :param str name: (optional) Name of the compute resource, only required if + cr_type is IKS_SA or ROKS_SA. + :param str component_type: (optional) Component type of the compute resource, + only required if cr_type is CE. + :param str component_name: (optional) Component name of the compute resource, + only required if cr_type is CE. """ def __init__( self, - limit: int, *, - profiles: Optional[List['ProfileCount']] = None, + crn: Optional[str] = None, + namespace: Optional[str] = None, + name: Optional[str] = None, + component_type: Optional[str] = None, + component_name: Optional[str] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object. + Initialize a ProfileLinkLink object. - :param int limit: Maximum allowed compute resource links per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their - compute resource links usage counts. + :param str crn: (optional) The CRN of the compute resource. + :param str namespace: (optional) The compute resource namespace, only + required if cr_type is IKS_SA or ROKS_SA. + :param str name: (optional) Name of the compute resource, only required if + cr_type is IKS_SA or ROKS_SA. + :param str component_type: (optional) Component type of the compute + resource, only required if cr_type is CE. + :param str component_name: (optional) Component name of the compute + resource, only required if cr_type is CE. """ - self.limit = limit - self.profiles = profiles + self.crn = crn + self.namespace = namespace + self.name = name + self.component_type = component_type + self.component_name = component_name @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseCrLinksPerProfile': - """Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileLinkLink': + """Initialize a ProfileLinkLink object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseCrLinksPerProfile JSON' - ) - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + if (namespace := _dict.get('namespace')) is not None: + args['namespace'] = namespace + if (name := _dict.get('name')) is not None: + args['name'] = name + if (component_type := _dict.get('component_type')) is not None: + args['component_type'] = component_type + if (component_name := _dict.get('component_name')) is not None: + args['component_name'] = component_name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseCrLinksPerProfile object from a json dictionary.""" + """Initialize a ProfileLinkLink object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'namespace') and self.namespace is not None: + _dict['namespace'] = self.namespace + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'component_type') and self.component_type is not None: + _dict['component_type'] = self.component_type + if hasattr(self, 'component_name') and self.component_name is not None: + _dict['component_name'] = self.component_name return _dict def _to_dict(self): @@ -10326,77 +14285,64 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseCrLinksPerProfile object.""" + """Return a `str` version of this ProfileLinkLink object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseCrLinksPerProfile') -> bool: + def __eq__(self, other: 'ProfileLinkLink') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseCrLinksPerProfile') -> bool: + def __ne__(self, other: 'ProfileLinkLink') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponseCrRulesPerProfile: +class ProfileLinkList: """ - Usage count for compute resource rules per profile. + ProfileLinkList. - :param int limit: Maximum allowed compute resource rules per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their - compute resource rules usage counts. + :param List[ProfileLink] links: List of links to a trusted profile. """ def __init__( self, - limit: int, - *, - profiles: Optional[List['ProfileCount']] = None, + links: List['ProfileLink'], ) -> None: """ - Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object. + Initialize a ProfileLinkList object. - :param int limit: Maximum allowed compute resource rules per profile. - :param List[ProfileCount] profiles: (optional) List of profiles with their - compute resource rules usage counts. + :param List[ProfileLink] links: List of links to a trusted profile. """ - self.limit = limit - self.profiles = profiles + self.links = links @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseCrRulesPerProfile': - """Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ProfileLinkList': + """Initialize a ProfileLinkList object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (links := _dict.get('links')) is not None: + args['links'] = [ProfileLink.from_dict(v) for v in links] else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseCrRulesPerProfile JSON' - ) - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [ProfileCount.from_dict(v) for v in profiles] + raise ValueError('Required property \'links\' not present in ProfileLinkList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseCrRulesPerProfile object from a json dictionary.""" + """Initialize a ProfileLinkList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: + if hasattr(self, 'links') and self.links is not None: + links_list = [] + for v in self.links: if isinstance(v, dict): - profiles_list.append(v) + links_list.append(v) else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + links_list.append(v.to_dict()) + _dict['links'] = links_list return _dict def _to_dict(self): @@ -10404,77 +14350,156 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseCrRulesPerProfile object.""" + """Return a `str` version of this ProfileLinkList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseCrRulesPerProfile') -> bool: + def __eq__(self, other: 'ProfileLinkList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseCrRulesPerProfile') -> bool: + def __ne__(self, other: 'ProfileLinkList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponseServiceidsPerGroup: +class Report: """ - Usage count for service IDs per group. + Report. - :param int limit: Maximum allowed service IDs per group. - :param List[ServiceIdGroupCount] serviceid_groups: (optional) List of service ID - groups with their usage counts. + :param str created_by: IAMid of the user who triggered the report. + :param str reference: Unique reference used to generate the report. + :param str report_duration: Duration in hours for which the report is generated. + :param str report_start_time: Start time of the report. + :param str report_end_time: End time of the report. + :param List[UserActivity] users: (optional) List of users. + :param List[ApikeyActivity] apikeys: (optional) List of apikeys. + :param List[EntityActivity] serviceids: (optional) List of serviceids. + :param List[EntityActivity] profiles: (optional) List of profiles. """ def __init__( self, - limit: int, + created_by: str, + reference: str, + report_duration: str, + report_start_time: str, + report_end_time: str, *, - serviceid_groups: Optional[List['ServiceIdGroupCount']] = None, + users: Optional[List['UserActivity']] = None, + apikeys: Optional[List['ApikeyActivity']] = None, + serviceids: Optional[List['EntityActivity']] = None, + profiles: Optional[List['EntityActivity']] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object. + Initialize a Report object. - :param int limit: Maximum allowed service IDs per group. - :param List[ServiceIdGroupCount] serviceid_groups: (optional) List of - service ID groups with their usage counts. + :param str created_by: IAMid of the user who triggered the report. + :param str reference: Unique reference used to generate the report. + :param str report_duration: Duration in hours for which the report is + generated. + :param str report_start_time: Start time of the report. + :param str report_end_time: End time of the report. + :param List[UserActivity] users: (optional) List of users. + :param List[ApikeyActivity] apikeys: (optional) List of apikeys. + :param List[EntityActivity] serviceids: (optional) List of serviceids. + :param List[EntityActivity] profiles: (optional) List of profiles. """ - self.limit = limit - self.serviceid_groups = serviceid_groups + self.created_by = created_by + self.reference = reference + self.report_duration = report_duration + self.report_start_time = report_start_time + self.report_end_time = report_end_time + self.users = users + self.apikeys = apikeys + self.serviceids = serviceids + self.profiles = profiles @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseServiceidsPerGroup': - """Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Report': + """Initialize a Report object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (created_by := _dict.get('created_by')) is not None: + args['created_by'] = created_by else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseServiceidsPerGroup JSON' - ) - if (serviceid_groups := _dict.get('serviceid_groups')) is not None: - args['serviceid_groups'] = [ServiceIdGroupCount.from_dict(v) for v in serviceid_groups] + raise ValueError('Required property \'created_by\' not present in Report JSON') + if (reference := _dict.get('reference')) is not None: + args['reference'] = reference + else: + raise ValueError('Required property \'reference\' not present in Report JSON') + if (report_duration := _dict.get('report_duration')) is not None: + args['report_duration'] = report_duration + else: + raise ValueError('Required property \'report_duration\' not present in Report JSON') + if (report_start_time := _dict.get('report_start_time')) is not None: + args['report_start_time'] = report_start_time + else: + raise ValueError('Required property \'report_start_time\' not present in Report JSON') + if (report_end_time := _dict.get('report_end_time')) is not None: + args['report_end_time'] = report_end_time + else: + raise ValueError('Required property \'report_end_time\' not present in Report JSON') + if (users := _dict.get('users')) is not None: + args['users'] = [UserActivity.from_dict(v) for v in users] + if (apikeys := _dict.get('apikeys')) is not None: + args['apikeys'] = [ApikeyActivity.from_dict(v) for v in apikeys] + if (serviceids := _dict.get('serviceids')) is not None: + args['serviceids'] = [EntityActivity.from_dict(v) for v in serviceids] + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [EntityActivity.from_dict(v) for v in profiles] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseServiceidsPerGroup object from a json dictionary.""" + """Initialize a Report object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: - serviceid_groups_list = [] - for v in self.serviceid_groups: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'created_by') and self.created_by is not None: + _dict['created_by'] = self.created_by + if hasattr(self, 'reference') and self.reference is not None: + _dict['reference'] = self.reference + if hasattr(self, 'report_duration') and self.report_duration is not None: + _dict['report_duration'] = self.report_duration + if hasattr(self, 'report_start_time') and self.report_start_time is not None: + _dict['report_start_time'] = self.report_start_time + if hasattr(self, 'report_end_time') and self.report_end_time is not None: + _dict['report_end_time'] = self.report_end_time + if hasattr(self, 'users') and self.users is not None: + users_list = [] + for v in self.users: if isinstance(v, dict): - serviceid_groups_list.append(v) + users_list.append(v) else: - serviceid_groups_list.append(v.to_dict()) - _dict['serviceid_groups'] = serviceid_groups_list + users_list.append(v.to_dict()) + _dict['users'] = users_list + if hasattr(self, 'apikeys') and self.apikeys is not None: + apikeys_list = [] + for v in self.apikeys: + if isinstance(v, dict): + apikeys_list.append(v) + else: + apikeys_list.append(v.to_dict()) + _dict['apikeys'] = apikeys_list + if hasattr(self, 'serviceids') and self.serviceids is not None: + serviceids_list = [] + for v in self.serviceids: + if isinstance(v, dict): + serviceids_list.append(v) + else: + serviceids_list.append(v.to_dict()) + _dict['serviceids'] = serviceids_list + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -10482,77 +14507,115 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseServiceidsPerGroup object.""" + """Return a `str` version of this Report object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseServiceidsPerGroup') -> bool: + def __eq__(self, other: 'Report') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseServiceidsPerGroup') -> bool: + def __ne__(self, other: 'Report') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityLimitsUsageResponseTemplateVersionsPerTemplate: +class ReportMfaEnrollmentStatus: """ - Usage count for template versions per template. + ReportMfaEnrollmentStatus. - :param int limit: Maximum allowed versions per template. - :param List[TemplateCount] templates: (optional) List of templates with their - version usage counts. + :param str created_by: IAMid of the user who triggered the report. + :param str reference: Unique reference used to generate the report. + :param str report_time: Date time at which report is generated. Date is in ISO + format. + :param str account_id: BSS account id of the user who triggered the report. + :param str ims_account_id: (optional) IMS account id of the user who triggered + the report. + :param List[UserReportMfaEnrollmentStatus] users: (optional) List of users. """ def __init__( self, - limit: int, + created_by: str, + reference: str, + report_time: str, + account_id: str, *, - templates: Optional[List['TemplateCount']] = None, + ims_account_id: Optional[str] = None, + users: Optional[List['UserReportMfaEnrollmentStatus']] = None, ) -> None: """ - Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object. + Initialize a ReportMfaEnrollmentStatus object. - :param int limit: Maximum allowed versions per template. - :param List[TemplateCount] templates: (optional) List of templates with - their version usage counts. + :param str created_by: IAMid of the user who triggered the report. + :param str reference: Unique reference used to generate the report. + :param str report_time: Date time at which report is generated. Date is in + ISO format. + :param str account_id: BSS account id of the user who triggered the report. + :param str ims_account_id: (optional) IMS account id of the user who + triggered the report. + :param List[UserReportMfaEnrollmentStatus] users: (optional) List of users. """ - self.limit = limit - self.templates = templates + self.created_by = created_by + self.reference = reference + self.report_time = report_time + self.account_id = account_id + self.ims_account_id = ims_account_id + self.users = users @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate': - """Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReportMfaEnrollmentStatus': + """Initialize a ReportMfaEnrollmentStatus object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (created_by := _dict.get('created_by')) is not None: + args['created_by'] = created_by else: - raise ValueError( - 'Required property \'limit\' not present in IdentityLimitsUsageResponseTemplateVersionsPerTemplate JSON' - ) - if (templates := _dict.get('templates')) is not None: - args['templates'] = [TemplateCount.from_dict(v) for v in templates] + raise ValueError('Required property \'created_by\' not present in ReportMfaEnrollmentStatus JSON') + if (reference := _dict.get('reference')) is not None: + args['reference'] = reference + else: + raise ValueError('Required property \'reference\' not present in ReportMfaEnrollmentStatus JSON') + if (report_time := _dict.get('report_time')) is not None: + args['report_time'] = report_time + else: + raise ValueError('Required property \'report_time\' not present in ReportMfaEnrollmentStatus JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in ReportMfaEnrollmentStatus JSON') + if (ims_account_id := _dict.get('ims_account_id')) is not None: + args['ims_account_id'] = ims_account_id + if (users := _dict.get('users')) is not None: + args['users'] = [UserReportMfaEnrollmentStatus.from_dict(v) for v in users] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityLimitsUsageResponseTemplateVersionsPerTemplate object from a json dictionary.""" + """Initialize a ReportMfaEnrollmentStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'templates') and self.templates is not None: - templates_list = [] - for v in self.templates: + if hasattr(self, 'created_by') and self.created_by is not None: + _dict['created_by'] = self.created_by + if hasattr(self, 'reference') and self.reference is not None: + _dict['reference'] = self.reference + if hasattr(self, 'report_time') and self.report_time is not None: + _dict['report_time'] = self.report_time + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'ims_account_id') and self.ims_account_id is not None: + _dict['ims_account_id'] = self.ims_account_id + if hasattr(self, 'users') and self.users is not None: + users_list = [] + for v in self.users: if isinstance(v, dict): - templates_list.append(v) + users_list.append(v) else: - templates_list.append(v.to_dict()) - _dict['templates'] = templates_list + users_list.append(v.to_dict()) + _dict['users'] = users_list return _dict def _to_dict(self): @@ -10560,108 +14623,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityLimitsUsageResponseTemplateVersionsPerTemplate object.""" + """Return a `str` version of this ReportMfaEnrollmentStatus object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate') -> bool: + def __eq__(self, other: 'ReportMfaEnrollmentStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityLimitsUsageResponseTemplateVersionsPerTemplate') -> bool: + def __ne__(self, other: 'ReportMfaEnrollmentStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityPreferenceResponse: +class ReportReference: """ - IdentityPreferenceResponse. + ReportReference. - :param str service: (optional) Service of the preference. - :param str id: (optional) Unique ID of the preference. - :param str account_id: (optional) Account ID of the preference, only present for - scope 'account'. - :param str scope: (optional) Scope of the preference, 'global' or 'account'. - :param str value_string: (optional) String value of the preference, only one - value property is set, either 'value_string' or 'value_list_of_strings' is - present. - :param List[str] value_list_of_strings: (optional) List of values of the - preference, only one value property is set, either 'value_string' or - 'value_list_of_strings' is present. + :param str reference: Reference for the report to be generated. """ def __init__( self, - *, - service: Optional[str] = None, - id: Optional[str] = None, - account_id: Optional[str] = None, - scope: Optional[str] = None, - value_string: Optional[str] = None, - value_list_of_strings: Optional[List[str]] = None, + reference: str, ) -> None: """ - Initialize a IdentityPreferenceResponse object. + Initialize a ReportReference object. - :param str service: (optional) Service of the preference. - :param str id: (optional) Unique ID of the preference. - :param str account_id: (optional) Account ID of the preference, only - present for scope 'account'. - :param str scope: (optional) Scope of the preference, 'global' or - 'account'. - :param str value_string: (optional) String value of the preference, only - one value property is set, either 'value_string' or 'value_list_of_strings' - is present. - :param List[str] value_list_of_strings: (optional) List of values of the - preference, only one value property is set, either 'value_string' or - 'value_list_of_strings' is present. + :param str reference: Reference for the report to be generated. """ - self.service = service - self.id = id - self.account_id = account_id - self.scope = scope - self.value_string = value_string - self.value_list_of_strings = value_list_of_strings + self.reference = reference @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityPreferenceResponse': - """Initialize a IdentityPreferenceResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReportReference': + """Initialize a ReportReference object from a json dictionary.""" args = {} - if (service := _dict.get('service')) is not None: - args['service'] = service - if (id := _dict.get('id')) is not None: - args['id'] = id - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - if (scope := _dict.get('scope')) is not None: - args['scope'] = scope - if (value_string := _dict.get('value_string')) is not None: - args['value_string'] = value_string - if (value_list_of_strings := _dict.get('value_list_of_strings')) is not None: - args['value_list_of_strings'] = value_list_of_strings + if (reference := _dict.get('reference')) is not None: + args['reference'] = reference + else: + raise ValueError('Required property \'reference\' not present in ReportReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityPreferenceResponse object from a json dictionary.""" + """Initialize a ReportReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'service') and self.service is not None: - _dict['service'] = self.service - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'scope') and self.scope is not None: - _dict['scope'] = self.scope - if hasattr(self, 'value_string') and self.value_string is not None: - _dict['value_string'] = self.value_string - if hasattr(self, 'value_list_of_strings') and self.value_list_of_strings is not None: - _dict['value_list_of_strings'] = self.value_list_of_strings + if hasattr(self, 'reference') and self.reference is not None: + _dict['reference'] = self.reference return _dict def _to_dict(self): @@ -10669,66 +14682,146 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityPreferenceResponse object.""" + """Return a `str` version of this ReportReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityPreferenceResponse') -> bool: + def __eq__(self, other: 'ReportReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityPreferenceResponse') -> bool: + def __ne__(self, other: 'ReportReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IdentityPreferencesResponse: +class ResponseContext: """ - IdentityPreferencesResponse. + Context with key properties for problem determination. - :param List[IdentityPreferenceResponse] preferences: List of Identity - Preferences. + :param str transaction_id: (optional) The transaction ID of the inbound REST + request. + :param str operation: (optional) The operation of the inbound REST request. + :param str user_agent: (optional) The user agent of the inbound REST request. + :param str url: (optional) The URL of that cluster. + :param str instance_id: (optional) The instance ID of the server instance + processing the request. + :param str thread_id: (optional) The thread ID of the server instance processing + the request. + :param str host: (optional) The host of the server instance processing the + request. + :param str start_time: (optional) The start time of the request. + :param str end_time: (optional) The finish time of the request. + :param str elapsed_time: (optional) The elapsed time in msec. + :param str cluster_name: (optional) The cluster name. """ def __init__( self, - preferences: List['IdentityPreferenceResponse'], + *, + transaction_id: Optional[str] = None, + operation: Optional[str] = None, + user_agent: Optional[str] = None, + url: Optional[str] = None, + instance_id: Optional[str] = None, + thread_id: Optional[str] = None, + host: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + elapsed_time: Optional[str] = None, + cluster_name: Optional[str] = None, ) -> None: """ - Initialize a IdentityPreferencesResponse object. + Initialize a ResponseContext object. - :param List[IdentityPreferenceResponse] preferences: List of Identity - Preferences. + :param str transaction_id: (optional) The transaction ID of the inbound + REST request. + :param str operation: (optional) The operation of the inbound REST request. + :param str user_agent: (optional) The user agent of the inbound REST + request. + :param str url: (optional) The URL of that cluster. + :param str instance_id: (optional) The instance ID of the server instance + processing the request. + :param str thread_id: (optional) The thread ID of the server instance + processing the request. + :param str host: (optional) The host of the server instance processing the + request. + :param str start_time: (optional) The start time of the request. + :param str end_time: (optional) The finish time of the request. + :param str elapsed_time: (optional) The elapsed time in msec. + :param str cluster_name: (optional) The cluster name. """ - self.preferences = preferences + self.transaction_id = transaction_id + self.operation = operation + self.user_agent = user_agent + self.url = url + self.instance_id = instance_id + self.thread_id = thread_id + self.host = host + self.start_time = start_time + self.end_time = end_time + self.elapsed_time = elapsed_time + self.cluster_name = cluster_name @classmethod - def from_dict(cls, _dict: Dict) -> 'IdentityPreferencesResponse': - """Initialize a IdentityPreferencesResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ResponseContext': + """Initialize a ResponseContext object from a json dictionary.""" args = {} - if (preferences := _dict.get('preferences')) is not None: - args['preferences'] = [IdentityPreferenceResponse.from_dict(v) for v in preferences] - else: - raise ValueError('Required property \'preferences\' not present in IdentityPreferencesResponse JSON') + if (transaction_id := _dict.get('transaction_id')) is not None: + args['transaction_id'] = transaction_id + if (operation := _dict.get('operation')) is not None: + args['operation'] = operation + if (user_agent := _dict.get('user_agent')) is not None: + args['user_agent'] = user_agent + if (url := _dict.get('url')) is not None: + args['url'] = url + if (instance_id := _dict.get('instance_id')) is not None: + args['instance_id'] = instance_id + if (thread_id := _dict.get('thread_id')) is not None: + args['thread_id'] = thread_id + if (host := _dict.get('host')) is not None: + args['host'] = host + if (start_time := _dict.get('start_time')) is not None: + args['start_time'] = start_time + if (end_time := _dict.get('end_time')) is not None: + args['end_time'] = end_time + if (elapsed_time := _dict.get('elapsed_time')) is not None: + args['elapsed_time'] = elapsed_time + if (cluster_name := _dict.get('cluster_name')) is not None: + args['cluster_name'] = cluster_name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IdentityPreferencesResponse object from a json dictionary.""" + """Initialize a ResponseContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'preferences') and self.preferences is not None: - preferences_list = [] - for v in self.preferences: - if isinstance(v, dict): - preferences_list.append(v) - else: - preferences_list.append(v.to_dict()) - _dict['preferences'] = preferences_list + if hasattr(self, 'transaction_id') and self.transaction_id is not None: + _dict['transaction_id'] = self.transaction_id + if hasattr(self, 'operation') and self.operation is not None: + _dict['operation'] = self.operation + if hasattr(self, 'user_agent') and self.user_agent is not None: + _dict['user_agent'] = self.user_agent + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url + if hasattr(self, 'instance_id') and self.instance_id is not None: + _dict['instance_id'] = self.instance_id + if hasattr(self, 'thread_id') and self.thread_id is not None: + _dict['thread_id'] = self.thread_id + if hasattr(self, 'host') and self.host is not None: + _dict['host'] = self.host + if hasattr(self, 'start_time') and self.start_time is not None: + _dict['start_time'] = self.start_time + if hasattr(self, 'end_time') and self.end_time is not None: + _dict['end_time'] = self.end_time + if hasattr(self, 'elapsed_time') and self.elapsed_time is not None: + _dict['elapsed_time'] = self.elapsed_time + if hasattr(self, 'cluster_name') and self.cluster_name is not None: + _dict['cluster_name'] = self.cluster_name return _dict def _to_dict(self): @@ -10736,67 +14829,189 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IdentityPreferencesResponse object.""" + """Return a `str` version of this ResponseContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IdentityPreferencesResponse') -> bool: + def __eq__(self, other: 'ResponseContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IdentityPreferencesResponse') -> bool: + def __ne__(self, other: 'ResponseContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LimitCount: +class SamlMetadataImportResponse: """ - Limit and current usage count for a resource. - - :param int limit: Maximum allowed value for the resource. - :param int count: (optional) Current usage count for the resource. + SamlMetadataImportResponse. + + :param str idp_id: Realm ID of the Identity Provider. + :param str entity_tag: Version information used for optimistic locking. + :param datetime created_at: Creation timestamp. + :param datetime modified_at: Last modification timestamp. + :param str account_id: Account that owns the Identity Provider. + :param str name: User-friendly name of the Identity Provider. + :param str type: + :param dict properties: Type-specific Identity Provider configuration. + :param dict secrets: Type-specific secret configuration. + :param List[dict] history: (optional) History entries for the Identity Provider. + :param List[ShareScope] share_scope: (optional) Accounts, enterprises, or + account groups allowed to consume the IdP. + :param bool active: Indicates whether the Identity Provider is enabled. If + disabled, the IdP cannot be used by the owner account or any consumer accounts. + :param bool ui_setup_completed: (optional) Internal flag used by the UI to + determine whether the Identity Provider should be opened in the setup wizard or + the edit dialog. """ def __init__( self, - limit: int, + idp_id: str, + entity_tag: str, + created_at: datetime, + modified_at: datetime, + account_id: str, + name: str, + type: str, + properties: dict, + secrets: dict, + active: bool, *, - count: Optional[int] = None, + history: Optional[List[dict]] = None, + share_scope: Optional[List['ShareScope']] = None, + ui_setup_completed: Optional[bool] = None, ) -> None: """ - Initialize a LimitCount object. - - :param int limit: Maximum allowed value for the resource. - :param int count: (optional) Current usage count for the resource. - """ - self.limit = limit - self.count = count + Initialize a SamlMetadataImportResponse object. + + :param str idp_id: Realm ID of the Identity Provider. + :param str entity_tag: Version information used for optimistic locking. + :param datetime created_at: Creation timestamp. + :param datetime modified_at: Last modification timestamp. + :param str account_id: Account that owns the Identity Provider. + :param str name: User-friendly name of the Identity Provider. + :param str type: + :param dict properties: Type-specific Identity Provider configuration. + :param dict secrets: Type-specific secret configuration. + :param bool active: Indicates whether the Identity Provider is enabled. If + disabled, the IdP cannot be used by the owner account or any consumer + accounts. + :param List[dict] history: (optional) History entries for the Identity + Provider. + :param List[ShareScope] share_scope: (optional) Accounts, enterprises, or + account groups allowed to consume the IdP. + :param bool ui_setup_completed: (optional) Internal flag used by the UI to + determine whether the Identity Provider should be opened in the setup + wizard or the edit dialog. + """ + self.idp_id = idp_id + self.entity_tag = entity_tag + self.created_at = created_at + self.modified_at = modified_at + self.account_id = account_id + self.name = name + self.type = type + self.properties = properties + self.secrets = secrets + self.history = history + self.share_scope = share_scope + self.active = active + self.ui_setup_completed = ui_setup_completed @classmethod - def from_dict(cls, _dict: Dict) -> 'LimitCount': - """Initialize a LimitCount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SamlMetadataImportResponse': + """Initialize a SamlMetadataImportResponse object from a json dictionary.""" args = {} - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (idp_id := _dict.get('idp_id')) is not None: + args['idp_id'] = idp_id else: - raise ValueError('Required property \'limit\' not present in LimitCount JSON') - if (count := _dict.get('count')) is not None: - args['count'] = count + raise ValueError('Required property \'idp_id\' not present in SamlMetadataImportResponse JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in SamlMetadataImportResponse JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in SamlMetadataImportResponse JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + else: + raise ValueError('Required property \'modified_at\' not present in SamlMetadataImportResponse JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in SamlMetadataImportResponse JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in SamlMetadataImportResponse JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in SamlMetadataImportResponse JSON') + if (properties := _dict.get('properties')) is not None: + args['properties'] = properties + else: + raise ValueError('Required property \'properties\' not present in SamlMetadataImportResponse JSON') + if (secrets := _dict.get('secrets')) is not None: + args['secrets'] = secrets + else: + raise ValueError('Required property \'secrets\' not present in SamlMetadataImportResponse JSON') + if (history := _dict.get('history')) is not None: + args['history'] = history + if (share_scope := _dict.get('share_scope')) is not None: + args['share_scope'] = [ShareScope.from_dict(v) for v in share_scope] + if (active := _dict.get('active')) is not None: + args['active'] = active + else: + raise ValueError('Required property \'active\' not present in SamlMetadataImportResponse JSON') + if (ui_setup_completed := _dict.get('ui_setup_completed')) is not None: + args['ui_setup_completed'] = ui_setup_completed return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LimitCount object from a json dictionary.""" + """Initialize a SamlMetadataImportResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count + if hasattr(self, 'idp_id') and self.idp_id is not None: + _dict['idp_id'] = self.idp_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'properties') and self.properties is not None: + _dict['properties'] = self.properties + if hasattr(self, 'secrets') and self.secrets is not None: + _dict['secrets'] = self.secrets + if hasattr(self, 'history') and self.history is not None: + _dict['history'] = self.history + if hasattr(self, 'share_scope') and self.share_scope is not None: + share_scope_list = [] + for v in self.share_scope: + if isinstance(v, dict): + share_scope_list.append(v) + else: + share_scope_list.append(v.to_dict()) + _dict['share_scope'] = share_scope_list + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'ui_setup_completed') and self.ui_setup_completed is not None: + _dict['ui_setup_completed'] = self.ui_setup_completed return _dict def _to_dict(self): @@ -10804,68 +15019,243 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LimitCount object.""" + """Return a `str` version of this SamlMetadataImportResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LimitCount') -> bool: + def __eq__(self, other: 'SamlMetadataImportResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LimitCount') -> bool: + def __ne__(self, other: 'SamlMetadataImportResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + type. + """ + + SAML = 'saml' -class MfaEnrollmentTypeStatus: + +class ServiceId: """ - MfaEnrollmentTypeStatus. + Response body format for service ID V1 REST requests. - :param bool required: Describes whether the enrollment type is required. - :param bool enrolled: Describes whether the enrollment type is enrolled. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str id: Unique identifier of this Service Id. + :param str iam_id: Cloud wide identifier for identities of this service ID. + :param str entity_tag: Version of the service ID details object. You need to + specify this value when updating the service ID to avoid stale updates. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012'. + :param bool locked: The service ID cannot be changed if set to true. + :param datetime created_at: If set contains a date time string of the creation + date in ISO format. + :param datetime modified_at: If set contains a date time string of the last + modification date in ISO format. + :param str account_id: ID of the account the service ID belongs to. + :param str group_id: (optional) ID of the group to which the service ID belongs + to. Only set if requested via parameter `show_group_id`. + :param str name: Name of the Service Id. The name is not checked for uniqueness. + Therefore multiple names with the same value can exist. Access is done via the + UUID of the Service Id. + :param str description: (optional) The optional description of the Service Id. + The 'description' property is only available if a description was provided + during a create of a Service Id. + :param List[str] unique_instance_crns: (optional) Optional list of CRNs (string + array) which point to the services connected to the service ID. + :param List[EnityHistoryRecord] history: (optional) History of the Service ID. + :param ApiKey apikey: (optional) Response body format for API key V1 REST + requests. + :param Activity activity: (optional) """ def __init__( self, - required: bool, - enrolled: bool, + id: str, + iam_id: str, + entity_tag: str, + crn: str, + locked: bool, + created_at: datetime, + modified_at: datetime, + account_id: str, + name: str, + *, + context: Optional['ResponseContext'] = None, + group_id: Optional[str] = None, + description: Optional[str] = None, + unique_instance_crns: Optional[List[str]] = None, + history: Optional[List['EnityHistoryRecord']] = None, + apikey: Optional['ApiKey'] = None, + activity: Optional['Activity'] = None, ) -> None: """ - Initialize a MfaEnrollmentTypeStatus object. + Initialize a ServiceId object. - :param bool required: Describes whether the enrollment type is required. - :param bool enrolled: Describes whether the enrollment type is enrolled. + :param str id: Unique identifier of this Service Id. + :param str iam_id: Cloud wide identifier for identities of this service ID. + :param str entity_tag: Version of the service ID details object. You need + to specify this value when updating the service ID to avoid stale updates. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource + Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012'. + :param bool locked: The service ID cannot be changed if set to true. + :param datetime created_at: If set contains a date time string of the + creation date in ISO format. + :param datetime modified_at: If set contains a date time string of the last + modification date in ISO format. + :param str account_id: ID of the account the service ID belongs to. + :param str name: Name of the Service Id. The name is not checked for + uniqueness. Therefore multiple names with the same value can exist. Access + is done via the UUID of the Service Id. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str group_id: (optional) ID of the group to which the service ID + belongs to. Only set if requested via parameter `show_group_id`. + :param str description: (optional) The optional description of the Service + Id. The 'description' property is only available if a description was + provided during a create of a Service Id. + :param List[str] unique_instance_crns: (optional) Optional list of CRNs + (string array) which point to the services connected to the service ID. + :param List[EnityHistoryRecord] history: (optional) History of the Service + ID. + :param ApiKey apikey: (optional) Response body format for API key V1 REST + requests. + :param Activity activity: (optional) """ - self.required = required - self.enrolled = enrolled + self.context = context + self.id = id + self.iam_id = iam_id + self.entity_tag = entity_tag + self.crn = crn + self.locked = locked + self.created_at = created_at + self.modified_at = modified_at + self.account_id = account_id + self.group_id = group_id + self.name = name + self.description = description + self.unique_instance_crns = unique_instance_crns + self.history = history + self.apikey = apikey + self.activity = activity @classmethod - def from_dict(cls, _dict: Dict) -> 'MfaEnrollmentTypeStatus': - """Initialize a MfaEnrollmentTypeStatus object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ServiceId': + """Initialize a ServiceId object from a json dictionary.""" args = {} - if (required := _dict.get('required')) is not None: - args['required'] = required + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'required\' not present in MfaEnrollmentTypeStatus JSON') - if (enrolled := _dict.get('enrolled')) is not None: - args['enrolled'] = enrolled + raise ValueError('Required property \'id\' not present in ServiceId JSON') + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id else: - raise ValueError('Required property \'enrolled\' not present in MfaEnrollmentTypeStatus JSON') + raise ValueError('Required property \'iam_id\' not present in ServiceId JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in ServiceId JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in ServiceId JSON') + if (locked := _dict.get('locked')) is not None: + args['locked'] = locked + else: + raise ValueError('Required property \'locked\' not present in ServiceId JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ServiceId JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + else: + raise ValueError('Required property \'modified_at\' not present in ServiceId JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in ServiceId JSON') + if (group_id := _dict.get('group_id')) is not None: + args['group_id'] = group_id + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ServiceId JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (unique_instance_crns := _dict.get('unique_instance_crns')) is not None: + args['unique_instance_crns'] = unique_instance_crns + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (apikey := _dict.get('apikey')) is not None: + args['apikey'] = ApiKey.from_dict(apikey) + if (activity := _dict.get('activity')) is not None: + args['activity'] = Activity.from_dict(activity) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a MfaEnrollmentTypeStatus object from a json dictionary.""" + """Initialize a ServiceId object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'required') and self.required is not None: - _dict['required'] = self.required - if hasattr(self, 'enrolled') and self.enrolled is not None: - _dict['enrolled'] = self.enrolled + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'locked') and self.locked is not None: + _dict['locked'] = self.locked + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'group_id') and self.group_id is not None: + _dict['group_id'] = self.group_id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'unique_instance_crns') and self.unique_instance_crns is not None: + _dict['unique_instance_crns'] = self.unique_instance_crns + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'apikey') and self.apikey is not None: + if isinstance(self.apikey, dict): + _dict['apikey'] = self.apikey + else: + _dict['apikey'] = self.apikey.to_dict() + if hasattr(self, 'activity') and self.activity is not None: + if isinstance(self.activity, dict): + _dict['activity'] = self.activity + else: + _dict['activity'] = self.activity.to_dict() return _dict def _to_dict(self): @@ -10873,59 +15263,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this MfaEnrollmentTypeStatus object.""" + """Return a `str` version of this ServiceId object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'MfaEnrollmentTypeStatus') -> bool: + def __eq__(self, other: 'ServiceId') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'MfaEnrollmentTypeStatus') -> bool: + def __ne__(self, other: 'ServiceId') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PolicyTemplateReference: +class ServiceIdGroup: """ - Metadata for external access policy. + ServiceIdGroup. - :param str id: ID of Access Policy Template. - :param str version: Version of Access Policy Template. + :param str id: ID of the the service ID group. + :param str entity_tag: (optional) Version of the service ID group details + object. You need to specify this value when updating the service ID group to + avoid stale updates. + :param str account_id: ID of the account the service ID group belongs to. + :param str crn: Cloud Resource Name of the item. + :param str name: Name of the service ID group. Unique in the account. + :param str description: (optional) Description of the service ID group. + :param str created_at: (optional) Timestamp of when the service ID group was + created. + :param str created_by: IAM ID of the user or service which created the Service + Id group. + :param str modified_at: (optional) Timestamp of when the service ID group was + modified. """ def __init__( self, id: str, - version: str, + account_id: str, + crn: str, + name: str, + created_by: str, + *, + entity_tag: Optional[str] = None, + description: Optional[str] = None, + created_at: Optional[str] = None, + modified_at: Optional[str] = None, ) -> None: """ - Initialize a PolicyTemplateReference object. + Initialize a ServiceIdGroup object. - :param str id: ID of Access Policy Template. - :param str version: Version of Access Policy Template. + :param str id: ID of the the service ID group. + :param str account_id: ID of the account the service ID group belongs to. + :param str crn: Cloud Resource Name of the item. + :param str name: Name of the service ID group. Unique in the account. + :param str created_by: IAM ID of the user or service which created the + Service Id group. + :param str entity_tag: (optional) Version of the service ID group details + object. You need to specify this value when updating the service ID group + to avoid stale updates. + :param str description: (optional) Description of the service ID group. + :param str created_at: (optional) Timestamp of when the service ID group + was created. + :param str modified_at: (optional) Timestamp of when the service ID group + was modified. """ self.id = id - self.version = version + self.entity_tag = entity_tag + self.account_id = account_id + self.crn = crn + self.name = name + self.description = description + self.created_at = created_at + self.created_by = created_by + self.modified_at = modified_at @classmethod - def from_dict(cls, _dict: Dict) -> 'PolicyTemplateReference': - """Initialize a PolicyTemplateReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ServiceIdGroup': + """Initialize a ServiceIdGroup object from a json dictionary.""" args = {} if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in PolicyTemplateReference JSON') - if (version := _dict.get('version')) is not None: - args['version'] = version + raise ValueError('Required property \'id\' not present in ServiceIdGroup JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in ServiceIdGroup JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in ServiceIdGroup JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ServiceIdGroup JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = created_at + if (created_by := _dict.get('created_by')) is not None: + args['created_by'] = created_by else: - raise ValueError('Required property \'version\' not present in PolicyTemplateReference JSON') + raise ValueError('Required property \'created_by\' not present in ServiceIdGroup JSON') + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = modified_at return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PolicyTemplateReference object from a json dictionary.""" + """Initialize a ServiceIdGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -10933,8 +15382,22 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'version') and self.version is not None: - _dict['version'] = self.version + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = self.created_at + if hasattr(self, 'created_by') and self.created_by is not None: + _dict['created_by'] = self.created_by + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = self.modified_at return _dict def _to_dict(self): @@ -10942,158 +15405,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PolicyTemplateReference object.""" + """Return a `str` version of this ServiceIdGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PolicyTemplateReference') -> bool: + def __eq__(self, other: 'ServiceIdGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PolicyTemplateReference') -> bool: + def __ne__(self, other: 'ServiceIdGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileClaimRule: +class ServiceIdGroupCount: """ - ProfileClaimRule. + Service ID count for a specific group. - :param str id: the unique identifier of the claim rule. - :param str entity_tag: version of the claim rule. - :param datetime created_at: If set contains a date time string of the creation - date in ISO format. - :param datetime modified_at: (optional) If set contains a date time string of - the last modification date in ISO format. - :param str name: (optional) The optional claim rule name. - :param str type: Type of the claim rule, either 'Profile-SAML' or 'Profile-CR'. - :param str realm_name: (optional) The realm name of the Idp this claim rule - applies to. - :param int expiration: Session expiration in seconds. - :param str cr_type: (optional) The compute resource type. Not required if type - is Profile-SAML. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. - :param List[ProfileClaimRuleConditions] conditions: Conditions of this claim - rule. + :param str group_id: (optional) Service ID group identifier. + :param int count: (optional) Number of service IDs in the group. """ def __init__( self, - id: str, - entity_tag: str, - created_at: datetime, - type: str, - expiration: int, - conditions: List['ProfileClaimRuleConditions'], *, - modified_at: Optional[datetime] = None, - name: Optional[str] = None, - realm_name: Optional[str] = None, - cr_type: Optional[str] = None, + group_id: Optional[str] = None, + count: Optional[int] = None, ) -> None: """ - Initialize a ProfileClaimRule object. + Initialize a ServiceIdGroupCount object. - :param str id: the unique identifier of the claim rule. - :param str entity_tag: version of the claim rule. - :param datetime created_at: If set contains a date time string of the - creation date in ISO format. - :param str type: Type of the claim rule, either 'Profile-SAML' or - 'Profile-CR'. - :param int expiration: Session expiration in seconds. - :param List[ProfileClaimRuleConditions] conditions: Conditions of this - claim rule. - :param datetime modified_at: (optional) If set contains a date time string - of the last modification date in ISO format. - :param str name: (optional) The optional claim rule name. - :param str realm_name: (optional) The realm name of the Idp this claim rule - applies to. - :param str cr_type: (optional) The compute resource type. Not required if - type is Profile-SAML. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. + :param str group_id: (optional) Service ID group identifier. + :param int count: (optional) Number of service IDs in the group. """ - self.id = id - self.entity_tag = entity_tag - self.created_at = created_at - self.modified_at = modified_at - self.name = name - self.type = type - self.realm_name = realm_name - self.expiration = expiration - self.cr_type = cr_type - self.conditions = conditions + self.group_id = group_id + self.count = count @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileClaimRule': - """Initialize a ProfileClaimRule object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ServiceIdGroupCount': + """Initialize a ServiceIdGroupCount object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ProfileClaimRule JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - else: - raise ValueError('Required property \'entity_tag\' not present in ProfileClaimRule JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in ProfileClaimRule JSON') - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = string_to_datetime(modified_at) - if (name := _dict.get('name')) is not None: - args['name'] = name - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError('Required property \'type\' not present in ProfileClaimRule JSON') - if (realm_name := _dict.get('realm_name')) is not None: - args['realm_name'] = realm_name - if (expiration := _dict.get('expiration')) is not None: - args['expiration'] = expiration - else: - raise ValueError('Required property \'expiration\' not present in ProfileClaimRule JSON') - if (cr_type := _dict.get('cr_type')) is not None: - args['cr_type'] = cr_type - if (conditions := _dict.get('conditions')) is not None: - args['conditions'] = [ProfileClaimRuleConditions.from_dict(v) for v in conditions] - else: - raise ValueError('Required property \'conditions\' not present in ProfileClaimRule JSON') + if (group_id := _dict.get('group_id')) is not None: + args['group_id'] = group_id + if (count := _dict.get('count')) is not None: + args['count'] = count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileClaimRule object from a json dictionary.""" + """Initialize a ServiceIdGroupCount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = datetime_to_string(self.modified_at) - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'realm_name') and self.realm_name is not None: - _dict['realm_name'] = self.realm_name - if hasattr(self, 'expiration') and self.expiration is not None: - _dict['expiration'] = self.expiration - if hasattr(self, 'cr_type') and self.cr_type is not None: - _dict['cr_type'] = self.cr_type - if hasattr(self, 'conditions') and self.conditions is not None: - conditions_list = [] - for v in self.conditions: - if isinstance(v, dict): - conditions_list.append(v) - else: - conditions_list.append(v.to_dict()) - _dict['conditions'] = conditions_list + if hasattr(self, 'group_id') and self.group_id is not None: + _dict['group_id'] = self.group_id + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count return _dict def _to_dict(self): @@ -11101,85 +15471,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileClaimRule object.""" + """Return a `str` version of this ServiceIdGroupCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileClaimRule') -> bool: + def __eq__(self, other: 'ServiceIdGroupCount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileClaimRule') -> bool: + def __ne__(self, other: 'ServiceIdGroupCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileClaimRuleConditions: +class ServiceIdGroupList: """ - ProfileClaimRuleConditions. + ServiceIdGroupList. - :param str claim: The claim to evaluate against. [Learn - more](/docs/account?topic=account-iam-condition-properties&interface=ui#cr-attribute-names). - :param str operator: The operation to perform on the claim. valid values are - EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, CONTAINS, IN. - :param str value: The stringified JSON value that the claim is compared to using - the operator. + :param List[ServiceIdGroup] serviceid_groups: List of Service ID groups based on + the query parameter. """ def __init__( self, - claim: str, - operator: str, - value: str, + serviceid_groups: List['ServiceIdGroup'], ) -> None: """ - Initialize a ProfileClaimRuleConditions object. + Initialize a ServiceIdGroupList object. - :param str claim: The claim to evaluate against. [Learn - more](/docs/account?topic=account-iam-condition-properties&interface=ui#cr-attribute-names). - :param str operator: The operation to perform on the claim. valid values - are EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, - CONTAINS, IN. - :param str value: The stringified JSON value that the claim is compared to - using the operator. + :param List[ServiceIdGroup] serviceid_groups: List of Service ID groups + based on the query parameter. """ - self.claim = claim - self.operator = operator - self.value = value + self.serviceid_groups = serviceid_groups @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileClaimRuleConditions': - """Initialize a ProfileClaimRuleConditions object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ServiceIdGroupList': + """Initialize a ServiceIdGroupList object from a json dictionary.""" args = {} - if (claim := _dict.get('claim')) is not None: - args['claim'] = claim - else: - raise ValueError('Required property \'claim\' not present in ProfileClaimRuleConditions JSON') - if (operator := _dict.get('operator')) is not None: - args['operator'] = operator - else: - raise ValueError('Required property \'operator\' not present in ProfileClaimRuleConditions JSON') - if (value := _dict.get('value')) is not None: - args['value'] = value + if (serviceid_groups := _dict.get('serviceid_groups')) is not None: + args['serviceid_groups'] = [ServiceIdGroup.from_dict(v) for v in serviceid_groups] else: - raise ValueError('Required property \'value\' not present in ProfileClaimRuleConditions JSON') + raise ValueError('Required property \'serviceid_groups\' not present in ServiceIdGroupList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileClaimRuleConditions object from a json dictionary.""" + """Initialize a ServiceIdGroupList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'claim') and self.claim is not None: - _dict['claim'] = self.claim - if hasattr(self, 'operator') and self.operator is not None: - _dict['operator'] = self.operator - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: + serviceid_groups_list = [] + for v in self.serviceid_groups: + if isinstance(v, dict): + serviceid_groups_list.append(v) + else: + serviceid_groups_list.append(v.to_dict()) + _dict['serviceid_groups'] = serviceid_groups_list return _dict def _to_dict(self): @@ -11187,60 +15538,102 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileClaimRuleConditions object.""" + """Return a `str` version of this ServiceIdGroupList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileClaimRuleConditions') -> bool: + def __eq__(self, other: 'ServiceIdGroupList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileClaimRuleConditions') -> bool: + def __ne__(self, other: 'ServiceIdGroupList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileClaimRuleList: +class ServiceIdList: """ - ProfileClaimRuleList. + Response body format for the list service ID V1 REST request. :param ResponseContext context: (optional) Context with key properties for problem determination. - :param List[ProfileClaimRule] rules: List of claim rules. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 items + per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is available. + :param str next: (optional) Link to the next available page. If 'next' property + is not part of the response no next page is available. + :param List[ServiceId] serviceids: List of service IDs based on the query + paramters and the page size. The service IDs array is always part of the + response but might be empty depending on the query parameter values provided. """ def __init__( self, - rules: List['ProfileClaimRule'], + serviceids: List['ServiceId'], *, context: Optional['ResponseContext'] = None, + offset: Optional[int] = None, + limit: Optional[int] = None, + first: Optional[str] = None, + previous: Optional[str] = None, + next: Optional[str] = None, ) -> None: """ - Initialize a ProfileClaimRuleList object. + Initialize a ServiceIdList object. - :param List[ProfileClaimRule] rules: List of claim rules. + :param List[ServiceId] serviceids: List of service IDs based on the query + paramters and the page size. The service IDs array is always part of the + response but might be empty depending on the query parameter values + provided. :param ResponseContext context: (optional) Context with key properties for problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 + items per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is + available. + :param str next: (optional) Link to the next available page. If 'next' + property is not part of the response no next page is available. """ self.context = context - self.rules = rules + self.offset = offset + self.limit = limit + self.first = first + self.previous = previous + self.next = next + self.serviceids = serviceids @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileClaimRuleList': - """Initialize a ProfileClaimRuleList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ServiceIdList': + """Initialize a ServiceIdList object from a json dictionary.""" args = {} if (context := _dict.get('context')) is not None: args['context'] = ResponseContext.from_dict(context) - if (rules := _dict.get('rules')) is not None: - args['rules'] = [ProfileClaimRule.from_dict(v) for v in rules] + if (offset := _dict.get('offset')) is not None: + args['offset'] = offset + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (first := _dict.get('first')) is not None: + args['first'] = first + if (previous := _dict.get('previous')) is not None: + args['previous'] = previous + if (next := _dict.get('next')) is not None: + args['next'] = next + if (serviceids := _dict.get('serviceids')) is not None: + args['serviceids'] = [ServiceId.from_dict(v) for v in serviceids] else: - raise ValueError('Required property \'rules\' not present in ProfileClaimRuleList JSON') + raise ValueError('Required property \'serviceids\' not present in ServiceIdList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileClaimRuleList object from a json dictionary.""" + """Initialize a ServiceIdList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -11251,14 +15644,24 @@ def to_dict(self) -> Dict: _dict['context'] = self.context else: _dict['context'] = self.context.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - rules_list = [] - for v in self.rules: + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first + if hasattr(self, 'previous') and self.previous is not None: + _dict['previous'] = self.previous + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next + if hasattr(self, 'serviceids') and self.serviceids is not None: + serviceids_list = [] + for v in self.serviceids: if isinstance(v, dict): - rules_list.append(v) + serviceids_list.append(v) else: - rules_list.append(v.to_dict()) - _dict['rules'] = rules_list + serviceids_list.append(v.to_dict()) + _dict['serviceids'] = serviceids_list return _dict def _to_dict(self): @@ -11266,66 +15669,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileClaimRuleList object.""" + """Return a `str` version of this ServiceIdList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileClaimRuleList') -> bool: + def __eq__(self, other: 'ServiceIdList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileClaimRuleList') -> bool: + def __ne__(self, other: 'ServiceIdList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileCount: +class ShareScope: """ - Resource count for a specific profile. + ShareScope. - :param str profile_id: (optional) Profile identifier. - :param int count: (optional) Number of resources associated with the profile. + :param str id: (optional) + :param str type: (optional) """ def __init__( self, *, - profile_id: Optional[str] = None, - count: Optional[int] = None, + id: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a ProfileCount object. + Initialize a ShareScope object. - :param str profile_id: (optional) Profile identifier. - :param int count: (optional) Number of resources associated with the - profile. + :param str id: (optional) + :param str type: (optional) """ - self.profile_id = profile_id - self.count = count + self.id = id + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileCount': - """Initialize a ProfileCount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareScope': + """Initialize a ShareScope object from a json dictionary.""" args = {} - if (profile_id := _dict.get('profile_id')) is not None: - args['profile_id'] = profile_id - if (count := _dict.get('count')) is not None: - args['count'] = count + if (id := _dict.get('id')) is not None: + args['id'] = id + if (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileCount object from a json dictionary.""" + """Initialize a ShareScope object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'profile_id') and self.profile_id is not None: - _dict['profile_id'] = self.profile_id - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -11333,73 +15735,258 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileCount object.""" + """Return a `str` version of this ShareScope object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileCount') -> bool: + def __eq__(self, other: 'ShareScope') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileCount') -> bool: + def __ne__(self, other: 'ShareScope') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + type. + """ + + ACCOUNT = 'account' + ENTERPRISE = 'enterprise' + -class ProfileIdentitiesResponse: +class TemplateAccountSettings: """ - ProfileIdentitiesResponse. + Input body parameters for the Account Settings REST request. - :param str entity_tag: (optional) Entity tag of the profile identities response. - :param List[ProfileIdentityResponse] identities: (optional) List of identities. + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets + from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param List[UserMfa] user_mfa: (optional) List of users that are exempted from + the MFA requirement of the account. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period of + time in seconds in which a session will be invalidated due to inactivity. Valid + values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines the + access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines the + refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: (optional) Defines whether or not user + visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, + such as those the user has invited to the account, or descendants of those users + based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. + :param TemplateAccountSettingsRestrictUserDomains restrict_user_domains: + (optional) """ def __init__( self, *, - entity_tag: Optional[str] = None, - identities: Optional[List['ProfileIdentityResponse']] = None, + restrict_create_service_id: Optional[str] = None, + restrict_create_platform_apikey: Optional[str] = None, + allowed_ip_addresses: Optional[str] = None, + mfa: Optional[str] = None, + user_mfa: Optional[List['UserMfa']] = None, + session_expiration_in_seconds: Optional[str] = None, + session_invalidation_in_seconds: Optional[str] = None, + max_sessions_per_identity: Optional[str] = None, + system_access_token_expiration_in_seconds: Optional[str] = None, + system_refresh_token_expiration_in_seconds: Optional[str] = None, + restrict_user_list_visibility: Optional[str] = None, + restrict_user_domains: Optional['TemplateAccountSettingsRestrictUserDomains'] = None, ) -> None: """ - Initialize a ProfileIdentitiesResponse object. + Initialize a TemplateAccountSettings object. - :param str entity_tag: (optional) Entity tag of the profile identities - response. - :param List[ProfileIdentityResponse] identities: (optional) List of - identities. + :param str restrict_create_service_id: (optional) Defines whether or not + creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str restrict_create_platform_apikey: (optional) Defines whether or + not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the + IAM Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + :param str allowed_ip_addresses: (optional) Defines the IP addresses and + subnets from which IAM tokens can be created for the account. + :param str mfa: (optional) MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + :param List[UserMfa] user_mfa: (optional) List of users that are exempted + from the MFA requirement of the account. + :param str session_expiration_in_seconds: (optional) Defines the session + expiration in seconds for the account. Valid values: + * Any whole number between between '900' and '86400' + * NOT_SET - To unset account setting and use service default. + :param str session_invalidation_in_seconds: (optional) Defines the period + of time in seconds in which a session will be invalidated due to + inactivity. Valid values: + * Any whole number between '900' and '7200' + * NOT_SET - To unset account setting and use service default. + :param str max_sessions_per_identity: (optional) Defines the max allowed + sessions per identity required by the account. Valid values: + * Any whole number greater than 0 + * NOT_SET - To unset account setting and use service default. + :param str system_access_token_expiration_in_seconds: (optional) Defines + the access token expiration in seconds. Valid values: + * Any whole number between '900' and '3600' + * NOT_SET - To unset account setting and use service default. + :param str system_refresh_token_expiration_in_seconds: (optional) Defines + the refresh token expiration in seconds. Valid values: + * Any whole number between '900' and '259200' + * NOT_SET - To unset account setting and use service default. + :param str restrict_user_list_visibility: (optional) Defines whether or not + user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the + account, such as those the user has invited to the account, or descendants + of those users based on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the + Users page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. + :param TemplateAccountSettingsRestrictUserDomains restrict_user_domains: + (optional) """ - self.entity_tag = entity_tag - self.identities = identities + self.restrict_create_service_id = restrict_create_service_id + self.restrict_create_platform_apikey = restrict_create_platform_apikey + self.allowed_ip_addresses = allowed_ip_addresses + self.mfa = mfa + self.user_mfa = user_mfa + self.session_expiration_in_seconds = session_expiration_in_seconds + self.session_invalidation_in_seconds = session_invalidation_in_seconds + self.max_sessions_per_identity = max_sessions_per_identity + self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds + self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds + self.restrict_user_list_visibility = restrict_user_list_visibility + self.restrict_user_domains = restrict_user_domains @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileIdentitiesResponse': - """Initialize a ProfileIdentitiesResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAccountSettings': + """Initialize a TemplateAccountSettings object from a json dictionary.""" args = {} - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - if (identities := _dict.get('identities')) is not None: - args['identities'] = [ProfileIdentityResponse.from_dict(v) for v in identities] + if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: + args['restrict_create_service_id'] = restrict_create_service_id + if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: + args['restrict_create_platform_apikey'] = restrict_create_platform_apikey + if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: + args['allowed_ip_addresses'] = allowed_ip_addresses + if (mfa := _dict.get('mfa')) is not None: + args['mfa'] = mfa + if (user_mfa := _dict.get('user_mfa')) is not None: + args['user_mfa'] = [UserMfa.from_dict(v) for v in user_mfa] + if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: + args['session_expiration_in_seconds'] = session_expiration_in_seconds + if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: + args['session_invalidation_in_seconds'] = session_invalidation_in_seconds + if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: + args['max_sessions_per_identity'] = max_sessions_per_identity + if ( + system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') + ) is not None: + args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds + if ( + system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') + ) is not None: + args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds + if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: + args['restrict_user_list_visibility'] = restrict_user_list_visibility + if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: + args['restrict_user_domains'] = TemplateAccountSettingsRestrictUserDomains.from_dict(restrict_user_domains) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileIdentitiesResponse object from a json dictionary.""" + """Initialize a TemplateAccountSettings object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'identities') and self.identities is not None: - identities_list = [] - for v in self.identities: + if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: + _dict['restrict_create_service_id'] = self.restrict_create_service_id + if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: + _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey + if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: + _dict['allowed_ip_addresses'] = self.allowed_ip_addresses + if hasattr(self, 'mfa') and self.mfa is not None: + _dict['mfa'] = self.mfa + if hasattr(self, 'user_mfa') and self.user_mfa is not None: + user_mfa_list = [] + for v in self.user_mfa: if isinstance(v, dict): - identities_list.append(v) + user_mfa_list.append(v) else: - identities_list.append(v.to_dict()) - _dict['identities'] = identities_list + user_mfa_list.append(v.to_dict()) + _dict['user_mfa'] = user_mfa_list + if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: + _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds + if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: + _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds + if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: + _dict['max_sessions_per_identity'] = self.max_sessions_per_identity + if ( + hasattr(self, 'system_access_token_expiration_in_seconds') + and self.system_access_token_expiration_in_seconds is not None + ): + _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds + if ( + hasattr(self, 'system_refresh_token_expiration_in_seconds') + and self.system_refresh_token_expiration_in_seconds is not None + ): + _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds + if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: + _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility + if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: + if isinstance(self.restrict_user_domains, dict): + _dict['restrict_user_domains'] = self.restrict_user_domains + else: + _dict['restrict_user_domains'] = self.restrict_user_domains.to_dict() return _dict def _to_dict(self): @@ -11407,226 +15994,138 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileIdentitiesResponse object.""" + """Return a `str` version of this TemplateAccountSettings object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileIdentitiesResponse') -> bool: + def __eq__(self, other: 'TemplateAccountSettings') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileIdentitiesResponse') -> bool: + def __ne__(self, other: 'TemplateAccountSettings') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class ProfileIdentityRequest: - """ - ProfileIdentityRequest. - - :param str identifier: Identifier of the identity that can assume the trusted - profiles. This can be a user identifier (IAM id), serviceid or crn. Internally - it uses account id of the service id for the identifier 'serviceid' and for the - identifier 'crn' it uses account id contained in the CRN. - :param str type: Type of the identity. - :param List[str] accounts: (optional) Only valid for the type user. Accounts - from which a user can assume the trusted profile. - :param str description: (optional) Description of the identity that can assume - the trusted profile. This is optional field for all the types of identities. - When this field is not set for the identity type 'serviceid' then the - description of the service id is used. Description is recommended for the - identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'. - """ - - def __init__( - self, - identifier: str, - type: str, - *, - accounts: Optional[List[str]] = None, - description: Optional[str] = None, - ) -> None: + class RestrictCreateServiceIdEnum(str, Enum): """ - Initialize a ProfileIdentityRequest object. - - :param str identifier: Identifier of the identity that can assume the - trusted profiles. This can be a user identifier (IAM id), serviceid or crn. - Internally it uses account id of the service id for the identifier - 'serviceid' and for the identifier 'crn' it uses account id contained in - the CRN. - :param str type: Type of the identity. - :param List[str] accounts: (optional) Only valid for the type user. - Accounts from which a user can assume the trusted profile. - :param str description: (optional) Description of the identity that can - assume the trusted profile. This is optional field for all the types of - identities. When this field is not set for the identity type 'serviceid' - then the description of the service id is used. Description is recommended - for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service - project'. + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. """ - self.identifier = identifier - self.type = type - self.accounts = accounts - self.description = description - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileIdentityRequest': - """Initialize a ProfileIdentityRequest object from a json dictionary.""" - args = {} - if (identifier := _dict.get('identifier')) is not None: - args['identifier'] = identifier - else: - raise ValueError('Required property \'identifier\' not present in ProfileIdentityRequest JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError('Required property \'type\' not present in ProfileIdentityRequest JSON') - if (accounts := _dict.get('accounts')) is not None: - args['accounts'] = accounts - if (description := _dict.get('description')) is not None: - args['description'] = description - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ProfileIdentityRequest object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'identifier') and self.identifier is not None: - _dict['identifier'] = self.identifier - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'accounts') and self.accounts is not None: - _dict['accounts'] = self.accounts - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - return _dict + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + class RestrictCreatePlatformApikeyEnum(str, Enum): + """ + Defines whether or not creating the resource is access controlled. Valid values: + * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM + Identity Service can create service IDs, including the account owner + * NOT_RESTRICTED - all members of an account can create service IDs + * NOT_SET - to 'unset' a previous set value. + """ - def __str__(self) -> str: - """Return a `str` version of this ProfileIdentityRequest object.""" - return json.dumps(self.to_dict(), indent=2) + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' - def __eq__(self, other: 'ProfileIdentityRequest') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + class MfaEnum(str, Enum): + """ + MFA trait definitions as follows: + * NONE - No MFA trait set + * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + * TOTP - For all non-federated IBMId users + * TOTP4ALL - For all users + * LEVEL1 - Email-based MFA for all users + * LEVEL2 - TOTP-based MFA for all users + * LEVEL3 - Security Key MFA for all users. + """ - def __ne__(self, other: 'ProfileIdentityRequest') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + NONE = 'NONE' + NONE_NO_ROPC = 'NONE_NO_ROPC' + TOTP = 'TOTP' + TOTP4ALL = 'TOTP4ALL' + LEVEL1 = 'LEVEL1' + LEVEL2 = 'LEVEL2' + LEVEL3 = 'LEVEL3' - class TypeEnum(str, Enum): + class RestrictUserListVisibilityEnum(str, Enum): """ - Type of the identity. + Defines whether or not user visibility is access controlled. Valid values: + * RESTRICTED - users can view only specific types of users in the account, such + as those the user has invited to the account, or descendants of those users based + on the classic infrastructure hierarchy + * NOT_RESTRICTED - any user in the account can view other users from the Users + page in IBM Cloud console + * NOT_SET - to 'unset' a previous set value. """ - USER = 'user' - SERVICEID = 'serviceid' - CRN = 'crn' + RESTRICTED = 'RESTRICTED' + NOT_RESTRICTED = 'NOT_RESTRICTED' + NOT_SET = 'NOT_SET' -class ProfileIdentityResponse: +class TemplateAccountSettingsRestrictUserDomains: """ - ProfileIdentityResponse. + TemplateAccountSettingsRestrictUserDomains. - :param str iam_id: IAM ID of the identity. - :param str identifier: Identifier of the identity that can assume the trusted - profiles. This can be a user identifier (IAM id), serviceid or crn. Internally - it uses account id of the service id for the identifier 'serviceid' and for the - identifier 'crn' it uses account id contained in the CRN. - :param str type: Type of the identity. - :param List[str] accounts: (optional) Only valid for the type user. Accounts - from which a user can assume the trusted profile. - :param str description: (optional) Description of the identity that can assume - the trusted profile. This is optional field for all the types of identities. - When this field is not set for the identity type 'serviceid' then the - description of the service id is used. Description is recommended for the - identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'. + :param bool account_sufficient: (optional) + :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) + Defines if account invitations are restricted to specified domains. To remove an + entry for a realm_id, perform an update (PUT) request with only the realm_id + set. """ def __init__( self, - iam_id: str, - identifier: str, - type: str, *, - accounts: Optional[List[str]] = None, - description: Optional[str] = None, + account_sufficient: Optional[bool] = None, + restrictions: Optional[List['AccountSettingsUserDomainRestriction']] = None, ) -> None: """ - Initialize a ProfileIdentityResponse object. + Initialize a TemplateAccountSettingsRestrictUserDomains object. - :param str iam_id: IAM ID of the identity. - :param str identifier: Identifier of the identity that can assume the - trusted profiles. This can be a user identifier (IAM id), serviceid or crn. - Internally it uses account id of the service id for the identifier - 'serviceid' and for the identifier 'crn' it uses account id contained in - the CRN. - :param str type: Type of the identity. - :param List[str] accounts: (optional) Only valid for the type user. - Accounts from which a user can assume the trusted profile. - :param str description: (optional) Description of the identity that can - assume the trusted profile. This is optional field for all the types of - identities. When this field is not set for the identity type 'serviceid' - then the description of the service id is used. Description is recommended - for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service - project'. + :param bool account_sufficient: (optional) + :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) + Defines if account invitations are restricted to specified domains. To + remove an entry for a realm_id, perform an update (PUT) request with only + the realm_id set. """ - self.iam_id = iam_id - self.identifier = identifier - self.type = type - self.accounts = accounts - self.description = description + self.account_sufficient = account_sufficient + self.restrictions = restrictions @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileIdentityResponse': - """Initialize a ProfileIdentityResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAccountSettingsRestrictUserDomains': + """Initialize a TemplateAccountSettingsRestrictUserDomains object from a json dictionary.""" args = {} - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - else: - raise ValueError('Required property \'iam_id\' not present in ProfileIdentityResponse JSON') - if (identifier := _dict.get('identifier')) is not None: - args['identifier'] = identifier - else: - raise ValueError('Required property \'identifier\' not present in ProfileIdentityResponse JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type - else: - raise ValueError('Required property \'type\' not present in ProfileIdentityResponse JSON') - if (accounts := _dict.get('accounts')) is not None: - args['accounts'] = accounts - if (description := _dict.get('description')) is not None: - args['description'] = description + if (account_sufficient := _dict.get('account_sufficient')) is not None: + args['account_sufficient'] = account_sufficient + if (restrictions := _dict.get('restrictions')) is not None: + args['restrictions'] = [AccountSettingsUserDomainRestriction.from_dict(v) for v in restrictions] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileIdentityResponse object from a json dictionary.""" + """Initialize a TemplateAccountSettingsRestrictUserDomains object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'identifier') and self.identifier is not None: - _dict['identifier'] = self.identifier - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'accounts') and self.accounts is not None: - _dict['accounts'] = self.accounts - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description + if hasattr(self, 'account_sufficient') and self.account_sufficient is not None: + _dict['account_sufficient'] = self.account_sufficient + if hasattr(self, 'restrictions') and self.restrictions is not None: + restrictions_list = [] + for v in self.restrictions: + if isinstance(v, dict): + restrictions_list.append(v) + else: + restrictions_list.append(v.to_dict()) + _dict['restrictions'] = restrictions_list return _dict def _to_dict(self): @@ -11634,147 +16133,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileIdentityResponse object.""" + """Return a `str` version of this TemplateAccountSettingsRestrictUserDomains object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileIdentityResponse') -> bool: + def __eq__(self, other: 'TemplateAccountSettingsRestrictUserDomains') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileIdentityResponse') -> bool: + def __ne__(self, other: 'TemplateAccountSettingsRestrictUserDomains') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - Type of the identity. - """ - - USER = 'user' - SERVICEID = 'serviceid' - CRN = 'crn' - -class ProfileLink: +class TemplateAssignmentListResponse: """ - Link details. + List Response body format for Template Assignments Records. - :param str id: the unique identifier of the link. - :param str entity_tag: version of the link. - :param datetime created_at: If set contains a date time string of the creation - date in ISO format. - :param datetime modified_at: If set contains a date time string of the last - modification date in ISO format. - :param str name: (optional) Optional name of the Link. - :param str cr_type: The compute resource type. Valid values are VSI, PVS, BMS, - IKS_SA, ROKS_SA, CE. - :param bool is_cross_account: (optional) Flag to indicate that the link provides - cross account access. If not provided then the account scope of the CRN must - match the Profile's account. - :param ProfileLinkLink link: + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 items + per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is available. + :param str next: (optional) Link to the next available page. If 'next' property + is not part of the response no next page is available. + :param List[TemplateAssignmentResponse] assignments: List of Assignments based + on the query paramters and the page size. The assignments array is always part + of the response but might be empty depending on the query parameter values + provided. """ def __init__( self, - id: str, - entity_tag: str, - created_at: datetime, - modified_at: datetime, - cr_type: str, - link: 'ProfileLinkLink', + assignments: List['TemplateAssignmentResponse'], *, - name: Optional[str] = None, - is_cross_account: Optional[bool] = None, + context: Optional['ResponseContext'] = None, + offset: Optional[int] = None, + limit: Optional[int] = None, + first: Optional[str] = None, + previous: Optional[str] = None, + next: Optional[str] = None, ) -> None: """ - Initialize a ProfileLink object. + Initialize a TemplateAssignmentListResponse object. - :param str id: the unique identifier of the link. - :param str entity_tag: version of the link. - :param datetime created_at: If set contains a date time string of the - creation date in ISO format. - :param datetime modified_at: If set contains a date time string of the last - modification date in ISO format. - :param str cr_type: The compute resource type. Valid values are VSI, PVS, - BMS, IKS_SA, ROKS_SA, CE. - :param ProfileLinkLink link: - :param str name: (optional) Optional name of the Link. - :param bool is_cross_account: (optional) Flag to indicate that the link - provides cross account access. If not provided then the account scope of - the CRN must match the Profile's account. + :param List[TemplateAssignmentResponse] assignments: List of Assignments + based on the query paramters and the page size. The assignments array is + always part of the response but might be empty depending on the query + parameter values provided. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 + items per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is + available. + :param str next: (optional) Link to the next available page. If 'next' + property is not part of the response no next page is available. """ - self.id = id - self.entity_tag = entity_tag - self.created_at = created_at - self.modified_at = modified_at - self.name = name - self.cr_type = cr_type - self.is_cross_account = is_cross_account - self.link = link + self.context = context + self.offset = offset + self.limit = limit + self.first = first + self.previous = previous + self.next = next + self.assignments = assignments @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileLink': - """Initialize a ProfileLink object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentListResponse': + """Initialize a TemplateAssignmentListResponse object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ProfileLink JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - else: - raise ValueError('Required property \'entity_tag\' not present in ProfileLink JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in ProfileLink JSON') - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = string_to_datetime(modified_at) - else: - raise ValueError('Required property \'modified_at\' not present in ProfileLink JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - if (cr_type := _dict.get('cr_type')) is not None: - args['cr_type'] = cr_type - else: - raise ValueError('Required property \'cr_type\' not present in ProfileLink JSON') - if (is_cross_account := _dict.get('is_cross_account')) is not None: - args['is_cross_account'] = is_cross_account - if (link := _dict.get('link')) is not None: - args['link'] = ProfileLinkLink.from_dict(link) + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (offset := _dict.get('offset')) is not None: + args['offset'] = offset + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (first := _dict.get('first')) is not None: + args['first'] = first + if (previous := _dict.get('previous')) is not None: + args['previous'] = previous + if (next := _dict.get('next')) is not None: + args['next'] = next + if (assignments := _dict.get('assignments')) is not None: + args['assignments'] = [TemplateAssignmentResponse.from_dict(v) for v in assignments] else: - raise ValueError('Required property \'link\' not present in ProfileLink JSON') + raise ValueError('Required property \'assignments\' not present in TemplateAssignmentListResponse JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileLink object from a json dictionary.""" + """Initialize a TemplateAssignmentListResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = datetime_to_string(self.modified_at) - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'cr_type') and self.cr_type is not None: - _dict['cr_type'] = self.cr_type - if hasattr(self, 'is_cross_account') and self.is_cross_account is not None: - _dict['is_cross_account'] = self.is_cross_account - if hasattr(self, 'link') and self.link is not None: - if isinstance(self.link, dict): - _dict['link'] = self.link + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context else: - _dict['link'] = self.link.to_dict() + _dict['context'] = self.context.to_dict() + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first + if hasattr(self, 'previous') and self.previous is not None: + _dict['previous'] = self.previous + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next + if hasattr(self, 'assignments') and self.assignments is not None: + assignments_list = [] + for v in self.assignments: + if isinstance(v, dict): + assignments_list.append(v) + else: + assignments_list.append(v.to_dict()) + _dict['assignments'] = assignments_list return _dict def _to_dict(self): @@ -11782,97 +16265,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileLink object.""" + """Return a `str` version of this TemplateAssignmentListResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileLink') -> bool: + def __eq__(self, other: 'TemplateAssignmentListResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileLink') -> bool: + def __ne__(self, other: 'TemplateAssignmentListResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileLinkLink: +class TemplateAssignmentResource: """ - ProfileLinkLink. + Body parameters for created resource. - :param str crn: (optional) The CRN of the compute resource. - :param str namespace: (optional) The compute resource namespace, only required - if cr_type is IKS_SA or ROKS_SA. - :param str name: (optional) Name of the compute resource, only required if - cr_type is IKS_SA or ROKS_SA. - :param str component_type: (optional) Component type of the compute resource, - only required if cr_type is CE. - :param str component_name: (optional) Component name of the compute resource, - only required if cr_type is CE. + :param str id: (optional) Id of the created resource. """ def __init__( self, *, - crn: Optional[str] = None, - namespace: Optional[str] = None, - name: Optional[str] = None, - component_type: Optional[str] = None, - component_name: Optional[str] = None, + id: Optional[str] = None, ) -> None: """ - Initialize a ProfileLinkLink object. + Initialize a TemplateAssignmentResource object. - :param str crn: (optional) The CRN of the compute resource. - :param str namespace: (optional) The compute resource namespace, only - required if cr_type is IKS_SA or ROKS_SA. - :param str name: (optional) Name of the compute resource, only required if - cr_type is IKS_SA or ROKS_SA. - :param str component_type: (optional) Component type of the compute - resource, only required if cr_type is CE. - :param str component_name: (optional) Component name of the compute - resource, only required if cr_type is CE. + :param str id: (optional) Id of the created resource. """ - self.crn = crn - self.namespace = namespace - self.name = name - self.component_type = component_type - self.component_name = component_name + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileLinkLink': - """Initialize a ProfileLinkLink object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResource': + """Initialize a TemplateAssignmentResource object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - if (namespace := _dict.get('namespace')) is not None: - args['namespace'] = namespace - if (name := _dict.get('name')) is not None: - args['name'] = name - if (component_type := _dict.get('component_type')) is not None: - args['component_type'] = component_type - if (component_name := _dict.get('component_name')) is not None: - args['component_name'] = component_name + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileLinkLink object from a json dictionary.""" + """Initialize a TemplateAssignmentResource object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'namespace') and self.namespace is not None: - _dict['namespace'] = self.namespace - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'component_type') and self.component_type is not None: - _dict['component_type'] = self.component_type - if hasattr(self, 'component_name') and self.component_name is not None: - _dict['component_name'] = self.component_name + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -11880,64 +16323,82 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileLinkLink object.""" + """Return a `str` version of this TemplateAssignmentResource object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileLinkLink') -> bool: + def __eq__(self, other: 'TemplateAssignmentResource') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileLinkLink') -> bool: + def __ne__(self, other: 'TemplateAssignmentResource') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProfileLinkList: +class TemplateAssignmentResourceError: """ - ProfileLinkList. + Body parameters for assignment error. - :param List[ProfileLink] links: List of links to a trusted profile. + :param str name: (optional) Name of the error. + :param str error_code: (optional) Internal error code. + :param str message: (optional) Error message detailing the nature of the error. + :param str status_code: (optional) Internal status code for the error. """ def __init__( self, - links: List['ProfileLink'], + *, + name: Optional[str] = None, + error_code: Optional[str] = None, + message: Optional[str] = None, + status_code: Optional[str] = None, ) -> None: """ - Initialize a ProfileLinkList object. + Initialize a TemplateAssignmentResourceError object. - :param List[ProfileLink] links: List of links to a trusted profile. + :param str name: (optional) Name of the error. + :param str error_code: (optional) Internal error code. + :param str message: (optional) Error message detailing the nature of the + error. + :param str status_code: (optional) Internal status code for the error. """ - self.links = links + self.name = name + self.error_code = error_code + self.message = message + self.status_code = status_code @classmethod - def from_dict(cls, _dict: Dict) -> 'ProfileLinkList': - """Initialize a ProfileLinkList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResourceError': + """Initialize a TemplateAssignmentResourceError object from a json dictionary.""" args = {} - if (links := _dict.get('links')) is not None: - args['links'] = [ProfileLink.from_dict(v) for v in links] - else: - raise ValueError('Required property \'links\' not present in ProfileLinkList JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (error_code := _dict.get('errorCode')) is not None: + args['error_code'] = error_code + if (message := _dict.get('message')) is not None: + args['message'] = message + if (status_code := _dict.get('statusCode')) is not None: + args['status_code'] = status_code return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ProfileLinkList object from a json dictionary.""" + """Initialize a TemplateAssignmentResourceError object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'links') and self.links is not None: - links_list = [] - for v in self.links: - if isinstance(v, dict): - links_list.append(v) - else: - links_list.append(v.to_dict()) - _dict['links'] = links_list + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'error_code') and self.error_code is not None: + _dict['errorCode'] = self.error_code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'status_code') and self.status_code is not None: + _dict['statusCode'] = self.status_code return _dict def _to_dict(self): @@ -11945,156 +16406,230 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ProfileLinkList object.""" + """Return a `str` version of this TemplateAssignmentResourceError object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ProfileLinkList') -> bool: + def __eq__(self, other: 'TemplateAssignmentResourceError') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ProfileLinkList') -> bool: + def __ne__(self, other: 'TemplateAssignmentResourceError') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Report: +class TemplateAssignmentResponse: """ - Report. + Response body format for Template Assignment Record. - :param str created_by: IAMid of the user who triggered the report. - :param str reference: Unique reference used to generate the report. - :param str report_duration: Duration in hours for which the report is generated. - :param str report_start_time: Start time of the report. - :param str report_end_time: End time of the report. - :param List[UserActivity] users: (optional) List of users. - :param List[ApikeyActivity] apikeys: (optional) List of apikeys. - :param List[EntityActivity] serviceids: (optional) List of serviceids. - :param List[EntityActivity] profiles: (optional) List of profiles. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str id: Assignment record Id. + :param str account_id: Enterprise account Id. + :param str template_id: Template Id. + :param int template_version: Template version. + :param str target_type: Assignment target type. + :param str target: Assignment target. + :param str status: Assignment status. + :param List[TemplateAssignmentResponseResource] resources: (optional) Status + breakdown per target account of IAM resources created or errors encountered in + attempting to create those IAM resources. IAM resources are only included in the + response providing the assignment is not in progress. IAM resources are also + only included when getting a single assignment, and excluded by list APIs. + :param List[EnityHistoryRecord] history: (optional) Assignment history. + :param str href: (optional) Href. + :param str created_at: Assignment created at. + :param str created_by_id: IAMid of the identity that created the assignment. + :param str last_modified_at: Assignment modified at. + :param str last_modified_by_id: IAMid of the identity that last modified the + assignment. + :param str entity_tag: Entity tag for this assignment record. """ def __init__( self, - created_by: str, - reference: str, - report_duration: str, - report_start_time: str, - report_end_time: str, + id: str, + account_id: str, + template_id: str, + template_version: int, + target_type: str, + target: str, + status: str, + created_at: str, + created_by_id: str, + last_modified_at: str, + last_modified_by_id: str, + entity_tag: str, *, - users: Optional[List['UserActivity']] = None, - apikeys: Optional[List['ApikeyActivity']] = None, - serviceids: Optional[List['EntityActivity']] = None, - profiles: Optional[List['EntityActivity']] = None, + context: Optional['ResponseContext'] = None, + resources: Optional[List['TemplateAssignmentResponseResource']] = None, + history: Optional[List['EnityHistoryRecord']] = None, + href: Optional[str] = None, ) -> None: """ - Initialize a Report object. + Initialize a TemplateAssignmentResponse object. - :param str created_by: IAMid of the user who triggered the report. - :param str reference: Unique reference used to generate the report. - :param str report_duration: Duration in hours for which the report is - generated. - :param str report_start_time: Start time of the report. - :param str report_end_time: End time of the report. - :param List[UserActivity] users: (optional) List of users. - :param List[ApikeyActivity] apikeys: (optional) List of apikeys. - :param List[EntityActivity] serviceids: (optional) List of serviceids. - :param List[EntityActivity] profiles: (optional) List of profiles. + :param str id: Assignment record Id. + :param str account_id: Enterprise account Id. + :param str template_id: Template Id. + :param int template_version: Template version. + :param str target_type: Assignment target type. + :param str target: Assignment target. + :param str status: Assignment status. + :param str created_at: Assignment created at. + :param str created_by_id: IAMid of the identity that created the + assignment. + :param str last_modified_at: Assignment modified at. + :param str last_modified_by_id: IAMid of the identity that last modified + the assignment. + :param str entity_tag: Entity tag for this assignment record. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param List[TemplateAssignmentResponseResource] resources: (optional) + Status breakdown per target account of IAM resources created or errors + encountered in attempting to create those IAM resources. IAM resources are + only included in the response providing the assignment is not in progress. + IAM resources are also only included when getting a single assignment, and + excluded by list APIs. + :param List[EnityHistoryRecord] history: (optional) Assignment history. + :param str href: (optional) Href. """ - self.created_by = created_by - self.reference = reference - self.report_duration = report_duration - self.report_start_time = report_start_time - self.report_end_time = report_end_time - self.users = users - self.apikeys = apikeys - self.serviceids = serviceids - self.profiles = profiles + self.context = context + self.id = id + self.account_id = account_id + self.template_id = template_id + self.template_version = template_version + self.target_type = target_type + self.target = target + self.status = status + self.resources = resources + self.history = history + self.href = href + self.created_at = created_at + self.created_by_id = created_by_id + self.last_modified_at = last_modified_at + self.last_modified_by_id = last_modified_by_id + self.entity_tag = entity_tag @classmethod - def from_dict(cls, _dict: Dict) -> 'Report': - """Initialize a Report object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponse': + """Initialize a TemplateAssignmentResponse object from a json dictionary.""" args = {} - if (created_by := _dict.get('created_by')) is not None: - args['created_by'] = created_by + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'created_by\' not present in Report JSON') - if (reference := _dict.get('reference')) is not None: - args['reference'] = reference + raise ValueError('Required property \'id\' not present in TemplateAssignmentResponse JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id else: - raise ValueError('Required property \'reference\' not present in Report JSON') - if (report_duration := _dict.get('report_duration')) is not None: - args['report_duration'] = report_duration + raise ValueError('Required property \'account_id\' not present in TemplateAssignmentResponse JSON') + if (template_id := _dict.get('template_id')) is not None: + args['template_id'] = template_id else: - raise ValueError('Required property \'report_duration\' not present in Report JSON') - if (report_start_time := _dict.get('report_start_time')) is not None: - args['report_start_time'] = report_start_time + raise ValueError('Required property \'template_id\' not present in TemplateAssignmentResponse JSON') + if (template_version := _dict.get('template_version')) is not None: + args['template_version'] = template_version else: - raise ValueError('Required property \'report_start_time\' not present in Report JSON') - if (report_end_time := _dict.get('report_end_time')) is not None: - args['report_end_time'] = report_end_time + raise ValueError('Required property \'template_version\' not present in TemplateAssignmentResponse JSON') + if (target_type := _dict.get('target_type')) is not None: + args['target_type'] = target_type else: - raise ValueError('Required property \'report_end_time\' not present in Report JSON') - if (users := _dict.get('users')) is not None: - args['users'] = [UserActivity.from_dict(v) for v in users] - if (apikeys := _dict.get('apikeys')) is not None: - args['apikeys'] = [ApikeyActivity.from_dict(v) for v in apikeys] - if (serviceids := _dict.get('serviceids')) is not None: - args['serviceids'] = [EntityActivity.from_dict(v) for v in serviceids] - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [EntityActivity.from_dict(v) for v in profiles] + raise ValueError('Required property \'target_type\' not present in TemplateAssignmentResponse JSON') + if (target := _dict.get('target')) is not None: + args['target'] = target + else: + raise ValueError('Required property \'target\' not present in TemplateAssignmentResponse JSON') + if (status := _dict.get('status')) is not None: + args['status'] = status + else: + raise ValueError('Required property \'status\' not present in TemplateAssignmentResponse JSON') + if (resources := _dict.get('resources')) is not None: + args['resources'] = [TemplateAssignmentResponseResource.from_dict(v) for v in resources] + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (href := _dict.get('href')) is not None: + args['href'] = href + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = created_at + else: + raise ValueError('Required property \'created_at\' not present in TemplateAssignmentResponse JSON') + if (created_by_id := _dict.get('created_by_id')) is not None: + args['created_by_id'] = created_by_id + else: + raise ValueError('Required property \'created_by_id\' not present in TemplateAssignmentResponse JSON') + if (last_modified_at := _dict.get('last_modified_at')) is not None: + args['last_modified_at'] = last_modified_at + else: + raise ValueError('Required property \'last_modified_at\' not present in TemplateAssignmentResponse JSON') + if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: + args['last_modified_by_id'] = last_modified_by_id + else: + raise ValueError('Required property \'last_modified_by_id\' not present in TemplateAssignmentResponse JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in TemplateAssignmentResponse JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Report object from a json dictionary.""" + """Initialize a TemplateAssignmentResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_by') and self.created_by is not None: - _dict['created_by'] = self.created_by - if hasattr(self, 'reference') and self.reference is not None: - _dict['reference'] = self.reference - if hasattr(self, 'report_duration') and self.report_duration is not None: - _dict['report_duration'] = self.report_duration - if hasattr(self, 'report_start_time') and self.report_start_time is not None: - _dict['report_start_time'] = self.report_start_time - if hasattr(self, 'report_end_time') and self.report_end_time is not None: - _dict['report_end_time'] = self.report_end_time - if hasattr(self, 'users') and self.users is not None: - users_list = [] - for v in self.users: - if isinstance(v, dict): - users_list.append(v) - else: - users_list.append(v.to_dict()) - _dict['users'] = users_list - if hasattr(self, 'apikeys') and self.apikeys is not None: - apikeys_list = [] - for v in self.apikeys: - if isinstance(v, dict): - apikeys_list.append(v) - else: - apikeys_list.append(v.to_dict()) - _dict['apikeys'] = apikeys_list - if hasattr(self, 'serviceids') and self.serviceids is not None: - serviceids_list = [] - for v in self.serviceids: + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'template_id') and self.template_id is not None: + _dict['template_id'] = self.template_id + if hasattr(self, 'template_version') and self.template_version is not None: + _dict['template_version'] = self.template_version + if hasattr(self, 'target_type') and self.target_type is not None: + _dict['target_type'] = self.target_type + if hasattr(self, 'target') and self.target is not None: + _dict['target'] = self.target + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'resources') and self.resources is not None: + resources_list = [] + for v in self.resources: if isinstance(v, dict): - serviceids_list.append(v) + resources_list.append(v) else: - serviceids_list.append(v.to_dict()) - _dict['serviceids'] = serviceids_list - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: + resources_list.append(v.to_dict()) + _dict['resources'] = resources_list + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: if isinstance(v, dict): - profiles_list.append(v) + history_list.append(v) else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = self.created_at + if hasattr(self, 'created_by_id') and self.created_by_id is not None: + _dict['created_by_id'] = self.created_by_id + if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: + _dict['last_modified_at'] = self.last_modified_at + if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: + _dict['last_modified_by_id'] = self.last_modified_by_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag return _dict def _to_dict(self): @@ -12102,115 +16637,102 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Report object.""" + """Return a `str` version of this TemplateAssignmentResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Report') -> bool: + def __eq__(self, other: 'TemplateAssignmentResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Report') -> bool: + def __ne__(self, other: 'TemplateAssignmentResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReportMfaEnrollmentStatus: +class TemplateAssignmentResponseResource: """ - ReportMfaEnrollmentStatus. + Overview of resources assignment per target account. - :param str created_by: IAMid of the user who triggered the report. - :param str reference: Unique reference used to generate the report. - :param str report_time: Date time at which report is generated. Date is in ISO - format. - :param str account_id: BSS account id of the user who triggered the report. - :param str ims_account_id: (optional) IMS account id of the user who triggered - the report. - :param List[UserReportMfaEnrollmentStatus] users: (optional) List of users. + :param str target: Target account where the IAM resource is created. + :param TemplateAssignmentResponseResourceDetail profile: (optional) + :param TemplateAssignmentResponseResourceDetail account_settings: (optional) + :param List[TemplateAssignmentResponseResourceDetail] + policy_template_references: (optional) Policy resource(s) included only for + trusted profile assignments with policy references. """ def __init__( self, - created_by: str, - reference: str, - report_time: str, - account_id: str, - *, - ims_account_id: Optional[str] = None, - users: Optional[List['UserReportMfaEnrollmentStatus']] = None, + target: str, + *, + profile: Optional['TemplateAssignmentResponseResourceDetail'] = None, + account_settings: Optional['TemplateAssignmentResponseResourceDetail'] = None, + policy_template_references: Optional[List['TemplateAssignmentResponseResourceDetail']] = None, ) -> None: """ - Initialize a ReportMfaEnrollmentStatus object. + Initialize a TemplateAssignmentResponseResource object. - :param str created_by: IAMid of the user who triggered the report. - :param str reference: Unique reference used to generate the report. - :param str report_time: Date time at which report is generated. Date is in - ISO format. - :param str account_id: BSS account id of the user who triggered the report. - :param str ims_account_id: (optional) IMS account id of the user who - triggered the report. - :param List[UserReportMfaEnrollmentStatus] users: (optional) List of users. + :param str target: Target account where the IAM resource is created. + :param TemplateAssignmentResponseResourceDetail profile: (optional) + :param TemplateAssignmentResponseResourceDetail account_settings: + (optional) + :param List[TemplateAssignmentResponseResourceDetail] + policy_template_references: (optional) Policy resource(s) included only for + trusted profile assignments with policy references. """ - self.created_by = created_by - self.reference = reference - self.report_time = report_time - self.account_id = account_id - self.ims_account_id = ims_account_id - self.users = users + self.target = target + self.profile = profile + self.account_settings = account_settings + self.policy_template_references = policy_template_references @classmethod - def from_dict(cls, _dict: Dict) -> 'ReportMfaEnrollmentStatus': - """Initialize a ReportMfaEnrollmentStatus object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponseResource': + """Initialize a TemplateAssignmentResponseResource object from a json dictionary.""" args = {} - if (created_by := _dict.get('created_by')) is not None: - args['created_by'] = created_by - else: - raise ValueError('Required property \'created_by\' not present in ReportMfaEnrollmentStatus JSON') - if (reference := _dict.get('reference')) is not None: - args['reference'] = reference - else: - raise ValueError('Required property \'reference\' not present in ReportMfaEnrollmentStatus JSON') - if (report_time := _dict.get('report_time')) is not None: - args['report_time'] = report_time - else: - raise ValueError('Required property \'report_time\' not present in ReportMfaEnrollmentStatus JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id + if (target := _dict.get('target')) is not None: + args['target'] = target else: - raise ValueError('Required property \'account_id\' not present in ReportMfaEnrollmentStatus JSON') - if (ims_account_id := _dict.get('ims_account_id')) is not None: - args['ims_account_id'] = ims_account_id - if (users := _dict.get('users')) is not None: - args['users'] = [UserReportMfaEnrollmentStatus.from_dict(v) for v in users] + raise ValueError('Required property \'target\' not present in TemplateAssignmentResponseResource JSON') + if (profile := _dict.get('profile')) is not None: + args['profile'] = TemplateAssignmentResponseResourceDetail.from_dict(profile) + if (account_settings := _dict.get('account_settings')) is not None: + args['account_settings'] = TemplateAssignmentResponseResourceDetail.from_dict(account_settings) + if (policy_template_references := _dict.get('policy_template_references')) is not None: + args['policy_template_references'] = [ + TemplateAssignmentResponseResourceDetail.from_dict(v) for v in policy_template_references + ] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReportMfaEnrollmentStatus object from a json dictionary.""" + """Initialize a TemplateAssignmentResponseResource object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_by') and self.created_by is not None: - _dict['created_by'] = self.created_by - if hasattr(self, 'reference') and self.reference is not None: - _dict['reference'] = self.reference - if hasattr(self, 'report_time') and self.report_time is not None: - _dict['report_time'] = self.report_time - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'ims_account_id') and self.ims_account_id is not None: - _dict['ims_account_id'] = self.ims_account_id - if hasattr(self, 'users') and self.users is not None: - users_list = [] - for v in self.users: + if hasattr(self, 'target') and self.target is not None: + _dict['target'] = self.target + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'account_settings') and self.account_settings is not None: + if isinstance(self.account_settings, dict): + _dict['account_settings'] = self.account_settings + else: + _dict['account_settings'] = self.account_settings.to_dict() + if hasattr(self, 'policy_template_references') and self.policy_template_references is not None: + policy_template_references_list = [] + for v in self.policy_template_references: if isinstance(v, dict): - users_list.append(v) + policy_template_references_list.append(v) else: - users_list.append(v.to_dict()) - _dict['users'] = users_list + policy_template_references_list.append(v.to_dict()) + _dict['policy_template_references'] = policy_template_references_list return _dict def _to_dict(self): @@ -12218,58 +16740,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReportMfaEnrollmentStatus object.""" + """Return a `str` version of this TemplateAssignmentResponseResource object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReportMfaEnrollmentStatus') -> bool: + def __eq__(self, other: 'TemplateAssignmentResponseResource') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReportMfaEnrollmentStatus') -> bool: + def __ne__(self, other: 'TemplateAssignmentResponseResource') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReportReference: +class TemplateAssignmentResponseResourceDetail: """ - ReportReference. + TemplateAssignmentResponseResourceDetail. - :param str reference: Reference for the report to be generated. + :param str id: (optional) Policy Template Id, only returned for a profile + assignment with policy references. + :param str version: (optional) Policy version, only returned for a profile + assignment with policy references. + :param TemplateAssignmentResource resource_created: (optional) Body parameters + for created resource. + :param TemplateAssignmentResourceError error_message: (optional) Body parameters + for assignment error. + :param str status: Status for the target account's assignment. """ def __init__( self, - reference: str, + status: str, + *, + id: Optional[str] = None, + version: Optional[str] = None, + resource_created: Optional['TemplateAssignmentResource'] = None, + error_message: Optional['TemplateAssignmentResourceError'] = None, ) -> None: """ - Initialize a ReportReference object. + Initialize a TemplateAssignmentResponseResourceDetail object. - :param str reference: Reference for the report to be generated. + :param str status: Status for the target account's assignment. + :param str id: (optional) Policy Template Id, only returned for a profile + assignment with policy references. + :param str version: (optional) Policy version, only returned for a profile + assignment with policy references. + :param TemplateAssignmentResource resource_created: (optional) Body + parameters for created resource. + :param TemplateAssignmentResourceError error_message: (optional) Body + parameters for assignment error. """ - self.reference = reference + self.id = id + self.version = version + self.resource_created = resource_created + self.error_message = error_message + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'ReportReference': - """Initialize a ReportReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponseResourceDetail': + """Initialize a TemplateAssignmentResponseResourceDetail object from a json dictionary.""" args = {} - if (reference := _dict.get('reference')) is not None: - args['reference'] = reference + if (id := _dict.get('id')) is not None: + args['id'] = id + if (version := _dict.get('version')) is not None: + args['version'] = version + if (resource_created := _dict.get('resource_created')) is not None: + args['resource_created'] = TemplateAssignmentResource.from_dict(resource_created) + if (error_message := _dict.get('error_message')) is not None: + args['error_message'] = TemplateAssignmentResourceError.from_dict(error_message) + if (status := _dict.get('status')) is not None: + args['status'] = status else: - raise ValueError('Required property \'reference\' not present in ReportReference JSON') + raise ValueError( + 'Required property \'status\' not present in TemplateAssignmentResponseResourceDetail JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReportReference object from a json dictionary.""" + """Initialize a TemplateAssignmentResponseResourceDetail object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'reference') and self.reference is not None: - _dict['reference'] = self.reference + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version + if hasattr(self, 'resource_created') and self.resource_created is not None: + if isinstance(self.resource_created, dict): + _dict['resource_created'] = self.resource_created + else: + _dict['resource_created'] = self.resource_created.to_dict() + if hasattr(self, 'error_message') and self.error_message is not None: + if isinstance(self.error_message, dict): + _dict['error_message'] = self.error_message + else: + _dict['error_message'] = self.error_message.to_dict() + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status return _dict def _to_dict(self): @@ -12277,146 +16848,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReportReference object.""" + """Return a `str` version of this TemplateAssignmentResponseResourceDetail object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReportReference') -> bool: + def __eq__(self, other: 'TemplateAssignmentResponseResourceDetail') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReportReference') -> bool: + def __ne__(self, other: 'TemplateAssignmentResponseResourceDetail') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResponseContext: +class TemplateCount: """ - Context with key properties for problem determination. + Version count for a specific template. - :param str transaction_id: (optional) The transaction ID of the inbound REST - request. - :param str operation: (optional) The operation of the inbound REST request. - :param str user_agent: (optional) The user agent of the inbound REST request. - :param str url: (optional) The URL of that cluster. - :param str instance_id: (optional) The instance ID of the server instance - processing the request. - :param str thread_id: (optional) The thread ID of the server instance processing - the request. - :param str host: (optional) The host of the server instance processing the - request. - :param str start_time: (optional) The start time of the request. - :param str end_time: (optional) The finish time of the request. - :param str elapsed_time: (optional) The elapsed time in msec. - :param str cluster_name: (optional) The cluster name. + :param str template_id: (optional) Template identifier. + :param int count: (optional) Number of versions for the template. """ def __init__( self, *, - transaction_id: Optional[str] = None, - operation: Optional[str] = None, - user_agent: Optional[str] = None, - url: Optional[str] = None, - instance_id: Optional[str] = None, - thread_id: Optional[str] = None, - host: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - elapsed_time: Optional[str] = None, - cluster_name: Optional[str] = None, + template_id: Optional[str] = None, + count: Optional[int] = None, ) -> None: """ - Initialize a ResponseContext object. + Initialize a TemplateCount object. - :param str transaction_id: (optional) The transaction ID of the inbound - REST request. - :param str operation: (optional) The operation of the inbound REST request. - :param str user_agent: (optional) The user agent of the inbound REST - request. - :param str url: (optional) The URL of that cluster. - :param str instance_id: (optional) The instance ID of the server instance - processing the request. - :param str thread_id: (optional) The thread ID of the server instance - processing the request. - :param str host: (optional) The host of the server instance processing the - request. - :param str start_time: (optional) The start time of the request. - :param str end_time: (optional) The finish time of the request. - :param str elapsed_time: (optional) The elapsed time in msec. - :param str cluster_name: (optional) The cluster name. - """ - self.transaction_id = transaction_id - self.operation = operation - self.user_agent = user_agent - self.url = url - self.instance_id = instance_id - self.thread_id = thread_id - self.host = host - self.start_time = start_time - self.end_time = end_time - self.elapsed_time = elapsed_time - self.cluster_name = cluster_name + :param str template_id: (optional) Template identifier. + :param int count: (optional) Number of versions for the template. + """ + self.template_id = template_id + self.count = count @classmethod - def from_dict(cls, _dict: Dict) -> 'ResponseContext': - """Initialize a ResponseContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateCount': + """Initialize a TemplateCount object from a json dictionary.""" args = {} - if (transaction_id := _dict.get('transaction_id')) is not None: - args['transaction_id'] = transaction_id - if (operation := _dict.get('operation')) is not None: - args['operation'] = operation - if (user_agent := _dict.get('user_agent')) is not None: - args['user_agent'] = user_agent - if (url := _dict.get('url')) is not None: - args['url'] = url - if (instance_id := _dict.get('instance_id')) is not None: - args['instance_id'] = instance_id - if (thread_id := _dict.get('thread_id')) is not None: - args['thread_id'] = thread_id - if (host := _dict.get('host')) is not None: - args['host'] = host - if (start_time := _dict.get('start_time')) is not None: - args['start_time'] = start_time - if (end_time := _dict.get('end_time')) is not None: - args['end_time'] = end_time - if (elapsed_time := _dict.get('elapsed_time')) is not None: - args['elapsed_time'] = elapsed_time - if (cluster_name := _dict.get('cluster_name')) is not None: - args['cluster_name'] = cluster_name + if (template_id := _dict.get('template_id')) is not None: + args['template_id'] = template_id + if (count := _dict.get('count')) is not None: + args['count'] = count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResponseContext object from a json dictionary.""" + """Initialize a TemplateCount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'transaction_id') and self.transaction_id is not None: - _dict['transaction_id'] = self.transaction_id - if hasattr(self, 'operation') and self.operation is not None: - _dict['operation'] = self.operation - if hasattr(self, 'user_agent') and self.user_agent is not None: - _dict['user_agent'] = self.user_agent - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url - if hasattr(self, 'instance_id') and self.instance_id is not None: - _dict['instance_id'] = self.instance_id - if hasattr(self, 'thread_id') and self.thread_id is not None: - _dict['thread_id'] = self.thread_id - if hasattr(self, 'host') and self.host is not None: - _dict['host'] = self.host - if hasattr(self, 'start_time') and self.start_time is not None: - _dict['start_time'] = self.start_time - if hasattr(self, 'end_time') and self.end_time is not None: - _dict['end_time'] = self.end_time - if hasattr(self, 'elapsed_time') and self.elapsed_time is not None: - _dict['elapsed_time'] = self.elapsed_time - if hasattr(self, 'cluster_name') and self.cluster_name is not None: - _dict['cluster_name'] = self.cluster_name + if hasattr(self, 'template_id') and self.template_id is not None: + _dict['template_id'] = self.template_id + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count return _dict def _to_dict(self): @@ -12424,236 +16914,141 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResponseContext object.""" + """Return a `str` version of this TemplateCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResponseContext') -> bool: + def __eq__(self, other: 'TemplateCount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ResponseContext') -> bool: + def __ne__(self, other: 'TemplateCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServiceId: +class TemplateProfileComponentRequest: """ - Response body format for service ID V1 REST requests. + Input body parameters for the TemplateProfileComponent. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str id: Unique identifier of this Service Id. - :param str iam_id: Cloud wide identifier for identities of this service ID. - :param str entity_tag: Version of the service ID details object. You need to - specify this value when updating the service ID to avoid stale updates. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012'. - :param bool locked: The service ID cannot be changed if set to true. - :param datetime created_at: If set contains a date time string of the creation - date in ISO format. - :param datetime modified_at: If set contains a date time string of the last - modification date in ISO format. - :param str account_id: ID of the account the service ID belongs to. - :param str group_id: (optional) ID of the group to which the service ID belongs - to. Only set if requested via parameter `show_group_id`. - :param str name: Name of the Service Id. The name is not checked for uniqueness. - Therefore multiple names with the same value can exist. Access is done via the - UUID of the Service Id. - :param str description: (optional) The optional description of the Service Id. - The 'description' property is only available if a description was provided - during a create of a Service Id. - :param List[str] unique_instance_crns: (optional) Optional list of CRNs (string - array) which point to the services connected to the service ID. - :param List[EnityHistoryRecord] history: (optional) History of the Service ID. - :param ApiKey apikey: (optional) Response body format for API key V1 REST - requests. - :param Activity activity: (optional) + :param str name: Name of the Profile. + You can use replacement variables in the profile name to adjust the name per + account. + The following variables are supported: + - `${template_id}` will be replaced by a unique identifier representing the + trusted profile template + - `${template_name}` will be replaced by the current name of the trusted profile + template + - `${template_version}` will be replaced by the current version of the trusted + profile template + - `${account_id}` will be replaced by the account identifier to which this + trusted profile template is assigned to + - `${account_name}` will be replaced by the account name to which this trusted + profile template is assigned to + Changes to e.g. the name of the account will NOT cause an update of the trusted + profile name. The profile name is processed during account assignment and any + template version upgrade, i.e. during that operation, the updated account name + would be used. + :param str description: (optional) Description of the Profile. + :param str email: (optional) Email of the trusted profile. + :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for the + Profile. + :param List[ProfileIdentityRequest] identities: (optional) Identities for the + Profile. """ def __init__( self, - id: str, - iam_id: str, - entity_tag: str, - crn: str, - locked: bool, - created_at: datetime, - modified_at: datetime, - account_id: str, name: str, *, - context: Optional['ResponseContext'] = None, - group_id: Optional[str] = None, description: Optional[str] = None, - unique_instance_crns: Optional[List[str]] = None, - history: Optional[List['EnityHistoryRecord']] = None, - apikey: Optional['ApiKey'] = None, - activity: Optional['Activity'] = None, + email: Optional[str] = None, + rules: Optional[List['TrustedProfileTemplateClaimRule']] = None, + identities: Optional[List['ProfileIdentityRequest']] = None, ) -> None: """ - Initialize a ServiceId object. - - :param str id: Unique identifier of this Service Id. - :param str iam_id: Cloud wide identifier for identities of this service ID. - :param str entity_tag: Version of the service ID details object. You need - to specify this value when updating the service ID to avoid stale updates. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource - Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012'. - :param bool locked: The service ID cannot be changed if set to true. - :param datetime created_at: If set contains a date time string of the - creation date in ISO format. - :param datetime modified_at: If set contains a date time string of the last - modification date in ISO format. - :param str account_id: ID of the account the service ID belongs to. - :param str name: Name of the Service Id. The name is not checked for - uniqueness. Therefore multiple names with the same value can exist. Access - is done via the UUID of the Service Id. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str group_id: (optional) ID of the group to which the service ID - belongs to. Only set if requested via parameter `show_group_id`. - :param str description: (optional) The optional description of the Service - Id. The 'description' property is only available if a description was - provided during a create of a Service Id. - :param List[str] unique_instance_crns: (optional) Optional list of CRNs - (string array) which point to the services connected to the service ID. - :param List[EnityHistoryRecord] history: (optional) History of the Service - ID. - :param ApiKey apikey: (optional) Response body format for API key V1 REST - requests. - :param Activity activity: (optional) - """ - self.context = context - self.id = id - self.iam_id = iam_id - self.entity_tag = entity_tag - self.crn = crn - self.locked = locked - self.created_at = created_at - self.modified_at = modified_at - self.account_id = account_id - self.group_id = group_id - self.name = name - self.description = description - self.unique_instance_crns = unique_instance_crns - self.history = history - self.apikey = apikey - self.activity = activity + Initialize a TemplateProfileComponentRequest object. - @classmethod - def from_dict(cls, _dict: Dict) -> 'ServiceId': - """Initialize a ServiceId object from a json dictionary.""" - args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ServiceId JSON') - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - else: - raise ValueError('Required property \'iam_id\' not present in ServiceId JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - else: - raise ValueError('Required property \'entity_tag\' not present in ServiceId JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in ServiceId JSON') - if (locked := _dict.get('locked')) is not None: - args['locked'] = locked - else: - raise ValueError('Required property \'locked\' not present in ServiceId JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in ServiceId JSON') - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = string_to_datetime(modified_at) - else: - raise ValueError('Required property \'modified_at\' not present in ServiceId JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in ServiceId JSON') - if (group_id := _dict.get('group_id')) is not None: - args['group_id'] = group_id + :param str name: Name of the Profile. + You can use replacement variables in the profile name to adjust the name + per account. + The following variables are supported: + - `${template_id}` will be replaced by a unique identifier representing the + trusted profile template + - `${template_name}` will be replaced by the current name of the trusted + profile template + - `${template_version}` will be replaced by the current version of the + trusted profile template + - `${account_id}` will be replaced by the account identifier to which this + trusted profile template is assigned to + - `${account_name}` will be replaced by the account name to which this + trusted profile template is assigned to + Changes to e.g. the name of the account will NOT cause an update of the + trusted profile name. The profile name is processed during account + assignment and any template version upgrade, i.e. during that operation, + the updated account name would be used. + :param str description: (optional) Description of the Profile. + :param str email: (optional) Email of the trusted profile. + :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for + the Profile. + :param List[ProfileIdentityRequest] identities: (optional) Identities for + the Profile. + """ + self.name = name + self.description = description + self.email = email + self.rules = rules + self.identities = identities + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TemplateProfileComponentRequest': + """Initialize a TemplateProfileComponentRequest object from a json dictionary.""" + args = {} if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in ServiceId JSON') + raise ValueError('Required property \'name\' not present in TemplateProfileComponentRequest JSON') if (description := _dict.get('description')) is not None: args['description'] = description - if (unique_instance_crns := _dict.get('unique_instance_crns')) is not None: - args['unique_instance_crns'] = unique_instance_crns - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (apikey := _dict.get('apikey')) is not None: - args['apikey'] = ApiKey.from_dict(apikey) - if (activity := _dict.get('activity')) is not None: - args['activity'] = Activity.from_dict(activity) + if (email := _dict.get('email')) is not None: + args['email'] = email + if (rules := _dict.get('rules')) is not None: + args['rules'] = [TrustedProfileTemplateClaimRule.from_dict(v) for v in rules] + if (identities := _dict.get('identities')) is not None: + args['identities'] = [ProfileIdentityRequest.from_dict(v) for v in identities] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ServiceId object from a json dictionary.""" + """Initialize a TemplateProfileComponentRequest object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'locked') and self.locked is not None: - _dict['locked'] = self.locked - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = datetime_to_string(self.modified_at) - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'group_id') and self.group_id is not None: - _dict['group_id'] = self.group_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description - if hasattr(self, 'unique_instance_crns') and self.unique_instance_crns is not None: - _dict['unique_instance_crns'] = self.unique_instance_crns - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: + if hasattr(self, 'email') and self.email is not None: + _dict['email'] = self.email + if hasattr(self, 'rules') and self.rules is not None: + rules_list = [] + for v in self.rules: if isinstance(v, dict): - history_list.append(v) + rules_list.append(v) else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'apikey') and self.apikey is not None: - if isinstance(self.apikey, dict): - _dict['apikey'] = self.apikey - else: - _dict['apikey'] = self.apikey.to_dict() - if hasattr(self, 'activity') and self.activity is not None: - if isinstance(self.activity, dict): - _dict['activity'] = self.activity - else: - _dict['activity'] = self.activity.to_dict() + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list + if hasattr(self, 'identities') and self.identities is not None: + identities_list = [] + for v in self.identities: + if isinstance(v, dict): + identities_list.append(v) + else: + identities_list.append(v.to_dict()) + _dict['identities'] = identities_list return _dict def _to_dict(self): @@ -12661,141 +17056,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ServiceId object.""" + """Return a `str` version of this TemplateProfileComponentRequest object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ServiceId') -> bool: + def __eq__(self, other: 'TemplateProfileComponentRequest') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ServiceId') -> bool: + def __ne__(self, other: 'TemplateProfileComponentRequest') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServiceIdGroup: +class TemplateProfileComponentResponse: """ - ServiceIdGroup. + Input body parameters for the TemplateProfileComponent. - :param str id: ID of the the service ID group. - :param str entity_tag: (optional) Version of the service ID group details - object. You need to specify this value when updating the service ID group to - avoid stale updates. - :param str account_id: ID of the account the service ID group belongs to. - :param str crn: Cloud Resource Name of the item. - :param str name: Name of the service ID group. Unique in the account. - :param str description: (optional) Description of the service ID group. - :param str created_at: (optional) Timestamp of when the service ID group was - created. - :param str created_by: IAM ID of the user or service which created the Service - Id group. - :param str modified_at: (optional) Timestamp of when the service ID group was - modified. + :param str name: Name of the Profile. + :param str description: (optional) Description of the Profile. + :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for the + Profile. + :param str email: (optional) Email of the trusted profile. + :param List[ProfileIdentityResponse] identities: (optional) Identities for the + Profile. """ def __init__( self, - id: str, - account_id: str, - crn: str, name: str, - created_by: str, *, - entity_tag: Optional[str] = None, description: Optional[str] = None, - created_at: Optional[str] = None, - modified_at: Optional[str] = None, + rules: Optional[List['TrustedProfileTemplateClaimRule']] = None, + email: Optional[str] = None, + identities: Optional[List['ProfileIdentityResponse']] = None, ) -> None: """ - Initialize a ServiceIdGroup object. + Initialize a TemplateProfileComponentResponse object. - :param str id: ID of the the service ID group. - :param str account_id: ID of the account the service ID group belongs to. - :param str crn: Cloud Resource Name of the item. - :param str name: Name of the service ID group. Unique in the account. - :param str created_by: IAM ID of the user or service which created the - Service Id group. - :param str entity_tag: (optional) Version of the service ID group details - object. You need to specify this value when updating the service ID group - to avoid stale updates. - :param str description: (optional) Description of the service ID group. - :param str created_at: (optional) Timestamp of when the service ID group - was created. - :param str modified_at: (optional) Timestamp of when the service ID group - was modified. + :param str name: Name of the Profile. + :param str description: (optional) Description of the Profile. + :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for + the Profile. + :param str email: (optional) Email of the trusted profile. + :param List[ProfileIdentityResponse] identities: (optional) Identities for + the Profile. """ - self.id = id - self.entity_tag = entity_tag - self.account_id = account_id - self.crn = crn self.name = name self.description = description - self.created_at = created_at - self.created_by = created_by - self.modified_at = modified_at + self.rules = rules + self.email = email + self.identities = identities @classmethod - def from_dict(cls, _dict: Dict) -> 'ServiceIdGroup': - """Initialize a ServiceIdGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TemplateProfileComponentResponse': + """Initialize a TemplateProfileComponentResponse object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in ServiceIdGroup JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in ServiceIdGroup JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in ServiceIdGroup JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in ServiceIdGroup JSON') + raise ValueError('Required property \'name\' not present in TemplateProfileComponentResponse JSON') if (description := _dict.get('description')) is not None: args['description'] = description - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = created_at - if (created_by := _dict.get('created_by')) is not None: - args['created_by'] = created_by - else: - raise ValueError('Required property \'created_by\' not present in ServiceIdGroup JSON') - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = modified_at + if (rules := _dict.get('rules')) is not None: + args['rules'] = [TrustedProfileTemplateClaimRule.from_dict(v) for v in rules] + if (email := _dict.get('email')) is not None: + args['email'] = email + if (identities := _dict.get('identities')) is not None: + args['identities'] = [ProfileIdentityResponse.from_dict(v) for v in identities] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ServiceIdGroup object from a json dictionary.""" + """Initialize a TemplateProfileComponentResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = self.created_at - if hasattr(self, 'created_by') and self.created_by is not None: - _dict['created_by'] = self.created_by - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = self.modified_at + if hasattr(self, 'rules') and self.rules is not None: + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list + if hasattr(self, 'email') and self.email is not None: + _dict['email'] = self.email + if hasattr(self, 'identities') and self.identities is not None: + identities_list = [] + for v in self.identities: + if isinstance(v, dict): + identities_list.append(v) + else: + identities_list.append(v.to_dict()) + _dict['identities'] = identities_list return _dict def _to_dict(self): @@ -12803,65 +17164,103 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ServiceIdGroup object.""" + """Return a `str` version of this TemplateProfileComponentResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ServiceIdGroup') -> bool: + def __eq__(self, other: 'TemplateProfileComponentResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ServiceIdGroup') -> bool: + def __ne__(self, other: 'TemplateProfileComponentResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServiceIdGroupCount: +class TestResult: """ - Service ID count for a specific group. - - :param str group_id: (optional) Service ID group identifier. - :param int count: (optional) Number of service IDs in the group. + TestResult. + + :param str idp_id: (optional) + :param str entity_tag: (optional) + :param int started_at: (optional) + :param str modified_at: (optional) + :param str idp_version: (optional) + :param List[TestResultStepsItem] steps: (optional) """ def __init__( self, *, - group_id: Optional[str] = None, - count: Optional[int] = None, + idp_id: Optional[str] = None, + entity_tag: Optional[str] = None, + started_at: Optional[int] = None, + modified_at: Optional[str] = None, + idp_version: Optional[str] = None, + steps: Optional[List['TestResultStepsItem']] = None, ) -> None: """ - Initialize a ServiceIdGroupCount object. + Initialize a TestResult object. - :param str group_id: (optional) Service ID group identifier. - :param int count: (optional) Number of service IDs in the group. + :param str idp_id: (optional) + :param str entity_tag: (optional) + :param int started_at: (optional) + :param str modified_at: (optional) + :param str idp_version: (optional) + :param List[TestResultStepsItem] steps: (optional) """ - self.group_id = group_id - self.count = count + self.idp_id = idp_id + self.entity_tag = entity_tag + self.started_at = started_at + self.modified_at = modified_at + self.idp_version = idp_version + self.steps = steps @classmethod - def from_dict(cls, _dict: Dict) -> 'ServiceIdGroupCount': - """Initialize a ServiceIdGroupCount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TestResult': + """Initialize a TestResult object from a json dictionary.""" args = {} - if (group_id := _dict.get('group_id')) is not None: - args['group_id'] = group_id - if (count := _dict.get('count')) is not None: - args['count'] = count + if (idp_id := _dict.get('idp_id')) is not None: + args['idp_id'] = idp_id + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + if (started_at := _dict.get('started_at')) is not None: + args['started_at'] = started_at + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = modified_at + if (idp_version := _dict.get('idp_version')) is not None: + args['idp_version'] = idp_version + if (steps := _dict.get('steps')) is not None: + args['steps'] = [TestResultStepsItem.from_dict(v) for v in steps] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ServiceIdGroupCount object from a json dictionary.""" + """Initialize a TestResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'group_id') and self.group_id is not None: - _dict['group_id'] = self.group_id - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count + if hasattr(self, 'idp_id') and self.idp_id is not None: + _dict['idp_id'] = self.idp_id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'started_at') and self.started_at is not None: + _dict['started_at'] = self.started_at + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = self.modified_at + if hasattr(self, 'idp_version') and self.idp_version is not None: + _dict['idp_version'] = self.idp_version + if hasattr(self, 'steps') and self.steps is not None: + steps_list = [] + for v in self.steps: + if isinstance(v, dict): + steps_list.append(v) + else: + steps_list.append(v.to_dict()) + _dict['steps'] = steps_list return _dict def _to_dict(self): @@ -12869,66 +17268,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ServiceIdGroupCount object.""" + """Return a `str` version of this TestResult object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ServiceIdGroupCount') -> bool: + def __eq__(self, other: 'TestResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ServiceIdGroupCount') -> bool: + def __ne__(self, other: 'TestResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServiceIdGroupList: +class TestResultStepsItem: """ - ServiceIdGroupList. + TestResultStepsItem. - :param List[ServiceIdGroup] serviceid_groups: List of Service ID groups based on - the query parameter. + :param int sequence: (optional) + :param str name: (optional) + :param str state: (optional) + :param str result: (optional) """ def __init__( self, - serviceid_groups: List['ServiceIdGroup'], + *, + sequence: Optional[int] = None, + name: Optional[str] = None, + state: Optional[str] = None, + result: Optional[str] = None, ) -> None: """ - Initialize a ServiceIdGroupList object. + Initialize a TestResultStepsItem object. - :param List[ServiceIdGroup] serviceid_groups: List of Service ID groups - based on the query parameter. + :param int sequence: (optional) + :param str name: (optional) + :param str state: (optional) + :param str result: (optional) """ - self.serviceid_groups = serviceid_groups + self.sequence = sequence + self.name = name + self.state = state + self.result = result @classmethod - def from_dict(cls, _dict: Dict) -> 'ServiceIdGroupList': - """Initialize a ServiceIdGroupList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TestResultStepsItem': + """Initialize a TestResultStepsItem object from a json dictionary.""" args = {} - if (serviceid_groups := _dict.get('serviceid_groups')) is not None: - args['serviceid_groups'] = [ServiceIdGroup.from_dict(v) for v in serviceid_groups] - else: - raise ValueError('Required property \'serviceid_groups\' not present in ServiceIdGroupList JSON') + if (sequence := _dict.get('sequence')) is not None: + args['sequence'] = sequence + if (name := _dict.get('name')) is not None: + args['name'] = name + if (state := _dict.get('state')) is not None: + args['state'] = state + if (result := _dict.get('result')) is not None: + args['result'] = result return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ServiceIdGroupList object from a json dictionary.""" + """Initialize a TestResultStepsItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'serviceid_groups') and self.serviceid_groups is not None: - serviceid_groups_list = [] - for v in self.serviceid_groups: - if isinstance(v, dict): - serviceid_groups_list.append(v) - else: - serviceid_groups_list.append(v.to_dict()) - _dict['serviceid_groups'] = serviceid_groups_list + if hasattr(self, 'sequence') and self.sequence is not None: + _dict['sequence'] = self.sequence + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'state') and self.state is not None: + _dict['state'] = self.state + if hasattr(self, 'result') and self.result is not None: + _dict['result'] = self.result return _dict def _to_dict(self): @@ -12936,130 +17350,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ServiceIdGroupList object.""" + """Return a `str` version of this TestResultStepsItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ServiceIdGroupList') -> bool: + def __eq__(self, other: 'TestResultStepsItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ServiceIdGroupList') -> bool: + def __ne__(self, other: 'TestResultStepsItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServiceIdList: +class TestTriggerResponse: """ - Response body format for the list service ID V1 REST request. + TestTriggerResponse. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 items - per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is available. - :param str next: (optional) Link to the next available page. If 'next' property - is not part of the response no next page is available. - :param List[ServiceId] serviceids: List of service IDs based on the query - paramters and the page size. The service IDs array is always part of the - response but might be empty depending on the query parameter values provided. + :param str result: (optional) + :param str test_url: (optional) """ def __init__( self, - serviceids: List['ServiceId'], *, - context: Optional['ResponseContext'] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, - first: Optional[str] = None, - previous: Optional[str] = None, - next: Optional[str] = None, + result: Optional[str] = None, + test_url: Optional[str] = None, ) -> None: """ - Initialize a ServiceIdList object. + Initialize a TestTriggerResponse object. - :param List[ServiceId] serviceids: List of service IDs based on the query - paramters and the page size. The service IDs array is always part of the - response but might be empty depending on the query parameter values - provided. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 - items per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is - available. - :param str next: (optional) Link to the next available page. If 'next' - property is not part of the response no next page is available. + :param str result: (optional) + :param str test_url: (optional) """ - self.context = context - self.offset = offset - self.limit = limit - self.first = first - self.previous = previous - self.next = next - self.serviceids = serviceids + self.result = result + self.test_url = test_url @classmethod - def from_dict(cls, _dict: Dict) -> 'ServiceIdList': - """Initialize a ServiceIdList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TestTriggerResponse': + """Initialize a TestTriggerResponse object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (offset := _dict.get('offset')) is not None: - args['offset'] = offset - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - if (first := _dict.get('first')) is not None: - args['first'] = first - if (previous := _dict.get('previous')) is not None: - args['previous'] = previous - if (next := _dict.get('next')) is not None: - args['next'] = next - if (serviceids := _dict.get('serviceids')) is not None: - args['serviceids'] = [ServiceId.from_dict(v) for v in serviceids] - else: - raise ValueError('Required property \'serviceids\' not present in ServiceIdList JSON') + if (result := _dict.get('result')) is not None: + args['result'] = result + if (test_url := _dict.get('test_url')) is not None: + args['test_url'] = test_url return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ServiceIdList object from a json dictionary.""" + """Initialize a TestTriggerResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'offset') and self.offset is not None: - _dict['offset'] = self.offset - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first - if hasattr(self, 'previous') and self.previous is not None: - _dict['previous'] = self.previous - if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next - if hasattr(self, 'serviceids') and self.serviceids is not None: - serviceids_list = [] - for v in self.serviceids: - if isinstance(v, dict): - serviceids_list.append(v) - else: - serviceids_list.append(v.to_dict()) - _dict['serviceids'] = serviceids_list + if hasattr(self, 'result') and self.result is not None: + _dict['result'] = self.result + if hasattr(self, 'test_url') and self.test_url is not None: + _dict['test_url'] = self.test_url return _dict def _to_dict(self): @@ -13067,250 +17416,250 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ServiceIdList object.""" + """Return a `str` version of this TestTriggerResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ServiceIdList') -> bool: + def __eq__(self, other: 'TestTriggerResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ServiceIdList') -> bool: + def __ne__(self, other: 'TestTriggerResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateAccountSettings: +class TrustedProfile: """ - Input body parameters for the Account Settings REST request. + Response body format for trusted profile V1 REST requests. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and subnets - from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param List[UserMfa] user_mfa: (optional) List of users that are exempted from - the MFA requirement of the account. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period of - time in seconds in which a session will be invalidated due to inactivity. Valid - values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines the - access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines the - refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: (optional) Defines whether or not user - visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, - such as those the user has invited to the account, or descendants of those users - based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. - :param TemplateAccountSettingsRestrictUserDomains restrict_user_domains: - (optional) + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str id: the unique identifier of the trusted profile. + Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. + :param str entity_tag: Version of the trusted profile details object. You need + to specify this value when updating the trusted profile to avoid stale updates. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. + :param str name: Name of the trusted profile. The name is checked for + uniqueness. Therefore trusted profiles with the same names can not exist in the + same account. + :param str description: (optional) The optional description of the trusted + profile. The 'description' property is only available if a description was + provided during a create of a trusted profile. + :param str email: (optional) The optional email of the trusted profile. The + 'email' property is only available if an email was provided during a create of a + trusted profile. + :param datetime created_at: (optional) If set contains a date time string of the + creation date in ISO format. + :param datetime modified_at: (optional) If set contains a date time string of + the last modification date in ISO format. + :param str iam_id: The iam_id of this trusted profile. + :param str account_id: ID of the account that this trusted profile belong to. + :param str template_id: (optional) ID of the IAM template that was used to + create an enterprise-managed trusted profile in your account. When returned, + this indicates that the trusted profile is created from and managed by a + template in the root enterprise account. + :param str assignment_id: (optional) ID of the assignment that was used to + create an enterprise-managed trusted profile in your account. When returned, + this indicates that the trusted profile is created from and managed by a + template in the root enterprise account. + :param int ims_account_id: (optional) IMS acount ID of the trusted profile. + :param int ims_user_id: (optional) IMS user ID of the trusted profile. + :param List[EnityHistoryRecord] history: (optional) History of the trusted + profile. + :param Activity activity: (optional) """ def __init__( self, - *, - restrict_create_service_id: Optional[str] = None, - restrict_create_platform_apikey: Optional[str] = None, - allowed_ip_addresses: Optional[str] = None, - mfa: Optional[str] = None, - user_mfa: Optional[List['UserMfa']] = None, - session_expiration_in_seconds: Optional[str] = None, - session_invalidation_in_seconds: Optional[str] = None, - max_sessions_per_identity: Optional[str] = None, - system_access_token_expiration_in_seconds: Optional[str] = None, - system_refresh_token_expiration_in_seconds: Optional[str] = None, - restrict_user_list_visibility: Optional[str] = None, - restrict_user_domains: Optional['TemplateAccountSettingsRestrictUserDomains'] = None, + id: str, + entity_tag: str, + crn: str, + name: str, + iam_id: str, + account_id: str, + *, + context: Optional['ResponseContext'] = None, + description: Optional[str] = None, + email: Optional[str] = None, + created_at: Optional[datetime] = None, + modified_at: Optional[datetime] = None, + template_id: Optional[str] = None, + assignment_id: Optional[str] = None, + ims_account_id: Optional[int] = None, + ims_user_id: Optional[int] = None, + history: Optional[List['EnityHistoryRecord']] = None, + activity: Optional['Activity'] = None, ) -> None: """ - Initialize a TemplateAccountSettings object. + Initialize a TrustedProfile object. - :param str restrict_create_service_id: (optional) Defines whether or not - creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str restrict_create_platform_apikey: (optional) Defines whether or - not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the - IAM Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - :param str allowed_ip_addresses: (optional) Defines the IP addresses and - subnets from which IAM tokens can be created for the account. - :param str mfa: (optional) MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - :param List[UserMfa] user_mfa: (optional) List of users that are exempted - from the MFA requirement of the account. - :param str session_expiration_in_seconds: (optional) Defines the session - expiration in seconds for the account. Valid values: - * Any whole number between between '900' and '86400' - * NOT_SET - To unset account setting and use service default. - :param str session_invalidation_in_seconds: (optional) Defines the period - of time in seconds in which a session will be invalidated due to - inactivity. Valid values: - * Any whole number between '900' and '7200' - * NOT_SET - To unset account setting and use service default. - :param str max_sessions_per_identity: (optional) Defines the max allowed - sessions per identity required by the account. Valid values: - * Any whole number greater than 0 - * NOT_SET - To unset account setting and use service default. - :param str system_access_token_expiration_in_seconds: (optional) Defines - the access token expiration in seconds. Valid values: - * Any whole number between '900' and '3600' - * NOT_SET - To unset account setting and use service default. - :param str system_refresh_token_expiration_in_seconds: (optional) Defines - the refresh token expiration in seconds. Valid values: - * Any whole number between '900' and '259200' - * NOT_SET - To unset account setting and use service default. - :param str restrict_user_list_visibility: (optional) Defines whether or not - user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the - account, such as those the user has invited to the account, or descendants - of those users based on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the - Users page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. - :param TemplateAccountSettingsRestrictUserDomains restrict_user_domains: - (optional) + :param str id: the unique identifier of the trusted profile. + Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. + :param str entity_tag: Version of the trusted profile details object. You + need to specify this value when updating the trusted profile to avoid stale + updates. + :param str crn: Cloud Resource Name of the item. Example Cloud Resource + Name: + 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. + :param str name: Name of the trusted profile. The name is checked for + uniqueness. Therefore trusted profiles with the same names can not exist in + the same account. + :param str iam_id: The iam_id of this trusted profile. + :param str account_id: ID of the account that this trusted profile belong + to. + :param ResponseContext context: (optional) Context with key properties for + problem determination. + :param str description: (optional) The optional description of the trusted + profile. The 'description' property is only available if a description was + provided during a create of a trusted profile. + :param str email: (optional) The optional email of the trusted profile. The + 'email' property is only available if an email was provided during a create + of a trusted profile. + :param datetime created_at: (optional) If set contains a date time string + of the creation date in ISO format. + :param datetime modified_at: (optional) If set contains a date time string + of the last modification date in ISO format. + :param str template_id: (optional) ID of the IAM template that was used to + create an enterprise-managed trusted profile in your account. When + returned, this indicates that the trusted profile is created from and + managed by a template in the root enterprise account. + :param str assignment_id: (optional) ID of the assignment that was used to + create an enterprise-managed trusted profile in your account. When + returned, this indicates that the trusted profile is created from and + managed by a template in the root enterprise account. + :param int ims_account_id: (optional) IMS acount ID of the trusted profile. + :param int ims_user_id: (optional) IMS user ID of the trusted profile. + :param List[EnityHistoryRecord] history: (optional) History of the trusted + profile. + :param Activity activity: (optional) """ - self.restrict_create_service_id = restrict_create_service_id - self.restrict_create_platform_apikey = restrict_create_platform_apikey - self.allowed_ip_addresses = allowed_ip_addresses - self.mfa = mfa - self.user_mfa = user_mfa - self.session_expiration_in_seconds = session_expiration_in_seconds - self.session_invalidation_in_seconds = session_invalidation_in_seconds - self.max_sessions_per_identity = max_sessions_per_identity - self.system_access_token_expiration_in_seconds = system_access_token_expiration_in_seconds - self.system_refresh_token_expiration_in_seconds = system_refresh_token_expiration_in_seconds - self.restrict_user_list_visibility = restrict_user_list_visibility - self.restrict_user_domains = restrict_user_domains + self.context = context + self.id = id + self.entity_tag = entity_tag + self.crn = crn + self.name = name + self.description = description + self.email = email + self.created_at = created_at + self.modified_at = modified_at + self.iam_id = iam_id + self.account_id = account_id + self.template_id = template_id + self.assignment_id = assignment_id + self.ims_account_id = ims_account_id + self.ims_user_id = ims_user_id + self.history = history + self.activity = activity @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAccountSettings': - """Initialize a TemplateAccountSettings object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfile': + """Initialize a TrustedProfile object from a json dictionary.""" args = {} - if (restrict_create_service_id := _dict.get('restrict_create_service_id')) is not None: - args['restrict_create_service_id'] = restrict_create_service_id - if (restrict_create_platform_apikey := _dict.get('restrict_create_platform_apikey')) is not None: - args['restrict_create_platform_apikey'] = restrict_create_platform_apikey - if (allowed_ip_addresses := _dict.get('allowed_ip_addresses')) is not None: - args['allowed_ip_addresses'] = allowed_ip_addresses - if (mfa := _dict.get('mfa')) is not None: - args['mfa'] = mfa - if (user_mfa := _dict.get('user_mfa')) is not None: - args['user_mfa'] = [UserMfa.from_dict(v) for v in user_mfa] - if (session_expiration_in_seconds := _dict.get('session_expiration_in_seconds')) is not None: - args['session_expiration_in_seconds'] = session_expiration_in_seconds - if (session_invalidation_in_seconds := _dict.get('session_invalidation_in_seconds')) is not None: - args['session_invalidation_in_seconds'] = session_invalidation_in_seconds - if (max_sessions_per_identity := _dict.get('max_sessions_per_identity')) is not None: - args['max_sessions_per_identity'] = max_sessions_per_identity - if ( - system_access_token_expiration_in_seconds := _dict.get('system_access_token_expiration_in_seconds') - ) is not None: - args['system_access_token_expiration_in_seconds'] = system_access_token_expiration_in_seconds - if ( - system_refresh_token_expiration_in_seconds := _dict.get('system_refresh_token_expiration_in_seconds') - ) is not None: - args['system_refresh_token_expiration_in_seconds'] = system_refresh_token_expiration_in_seconds - if (restrict_user_list_visibility := _dict.get('restrict_user_list_visibility')) is not None: - args['restrict_user_list_visibility'] = restrict_user_list_visibility - if (restrict_user_domains := _dict.get('restrict_user_domains')) is not None: - args['restrict_user_domains'] = TemplateAccountSettingsRestrictUserDomains.from_dict(restrict_user_domains) + if (context := _dict.get('context')) is not None: + args['context'] = ResponseContext.from_dict(context) + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in TrustedProfile JSON') + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + else: + raise ValueError('Required property \'entity_tag\' not present in TrustedProfile JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in TrustedProfile JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in TrustedProfile JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (email := _dict.get('email')) is not None: + args['email'] = email + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + if (modified_at := _dict.get('modified_at')) is not None: + args['modified_at'] = string_to_datetime(modified_at) + if (iam_id := _dict.get('iam_id')) is not None: + args['iam_id'] = iam_id + else: + raise ValueError('Required property \'iam_id\' not present in TrustedProfile JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in TrustedProfile JSON') + if (template_id := _dict.get('template_id')) is not None: + args['template_id'] = template_id + if (assignment_id := _dict.get('assignment_id')) is not None: + args['assignment_id'] = assignment_id + if (ims_account_id := _dict.get('ims_account_id')) is not None: + args['ims_account_id'] = ims_account_id + if (ims_user_id := _dict.get('ims_user_id')) is not None: + args['ims_user_id'] = ims_user_id + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (activity := _dict.get('activity')) is not None: + args['activity'] = Activity.from_dict(activity) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAccountSettings object from a json dictionary.""" + """Initialize a TrustedProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'restrict_create_service_id') and self.restrict_create_service_id is not None: - _dict['restrict_create_service_id'] = self.restrict_create_service_id - if hasattr(self, 'restrict_create_platform_apikey') and self.restrict_create_platform_apikey is not None: - _dict['restrict_create_platform_apikey'] = self.restrict_create_platform_apikey - if hasattr(self, 'allowed_ip_addresses') and self.allowed_ip_addresses is not None: - _dict['allowed_ip_addresses'] = self.allowed_ip_addresses - if hasattr(self, 'mfa') and self.mfa is not None: - _dict['mfa'] = self.mfa - if hasattr(self, 'user_mfa') and self.user_mfa is not None: - user_mfa_list = [] - for v in self.user_mfa: + if hasattr(self, 'context') and self.context is not None: + if isinstance(self.context, dict): + _dict['context'] = self.context + else: + _dict['context'] = self.context.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'email') and self.email is not None: + _dict['email'] = self.email + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'modified_at') and self.modified_at is not None: + _dict['modified_at'] = datetime_to_string(self.modified_at) + if hasattr(self, 'iam_id') and self.iam_id is not None: + _dict['iam_id'] = self.iam_id + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id + if hasattr(self, 'template_id') and self.template_id is not None: + _dict['template_id'] = self.template_id + if hasattr(self, 'assignment_id') and self.assignment_id is not None: + _dict['assignment_id'] = self.assignment_id + if hasattr(self, 'ims_account_id') and self.ims_account_id is not None: + _dict['ims_account_id'] = self.ims_account_id + if hasattr(self, 'ims_user_id') and self.ims_user_id is not None: + _dict['ims_user_id'] = self.ims_user_id + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: if isinstance(v, dict): - user_mfa_list.append(v) + history_list.append(v) else: - user_mfa_list.append(v.to_dict()) - _dict['user_mfa'] = user_mfa_list - if hasattr(self, 'session_expiration_in_seconds') and self.session_expiration_in_seconds is not None: - _dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds - if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None: - _dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds - if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None: - _dict['max_sessions_per_identity'] = self.max_sessions_per_identity - if ( - hasattr(self, 'system_access_token_expiration_in_seconds') - and self.system_access_token_expiration_in_seconds is not None - ): - _dict['system_access_token_expiration_in_seconds'] = self.system_access_token_expiration_in_seconds - if ( - hasattr(self, 'system_refresh_token_expiration_in_seconds') - and self.system_refresh_token_expiration_in_seconds is not None - ): - _dict['system_refresh_token_expiration_in_seconds'] = self.system_refresh_token_expiration_in_seconds - if hasattr(self, 'restrict_user_list_visibility') and self.restrict_user_list_visibility is not None: - _dict['restrict_user_list_visibility'] = self.restrict_user_list_visibility - if hasattr(self, 'restrict_user_domains') and self.restrict_user_domains is not None: - if isinstance(self.restrict_user_domains, dict): - _dict['restrict_user_domains'] = self.restrict_user_domains + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'activity') and self.activity is not None: + if isinstance(self.activity, dict): + _dict['activity'] = self.activity else: - _dict['restrict_user_domains'] = self.restrict_user_domains.to_dict() + _dict['activity'] = self.activity.to_dict() return _dict def _to_dict(self): @@ -13318,138 +17667,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAccountSettings object.""" + """Return a `str` version of this TrustedProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAccountSettings') -> bool: + def __eq__(self, other: 'TrustedProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAccountSettings') -> bool: + def __ne__(self, other: 'TrustedProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RestrictCreateServiceIdEnum(str, Enum): - """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - """ - - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' - - class RestrictCreatePlatformApikeyEnum(str, Enum): - """ - Defines whether or not creating the resource is access controlled. Valid values: - * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM - Identity Service can create service IDs, including the account owner - * NOT_RESTRICTED - all members of an account can create service IDs - * NOT_SET - to 'unset' a previous set value. - """ - - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' - - class MfaEnum(str, Enum): - """ - MFA trait definitions as follows: - * NONE - No MFA trait set - * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - * TOTP - For all non-federated IBMId users - * TOTP4ALL - For all users - * LEVEL1 - Email-based MFA for all users - * LEVEL2 - TOTP-based MFA for all users - * LEVEL3 - Security Key MFA for all users. - """ - - NONE = 'NONE' - NONE_NO_ROPC = 'NONE_NO_ROPC' - TOTP = 'TOTP' - TOTP4ALL = 'TOTP4ALL' - LEVEL1 = 'LEVEL1' - LEVEL2 = 'LEVEL2' - LEVEL3 = 'LEVEL3' - - class RestrictUserListVisibilityEnum(str, Enum): - """ - Defines whether or not user visibility is access controlled. Valid values: - * RESTRICTED - users can view only specific types of users in the account, such - as those the user has invited to the account, or descendants of those users based - on the classic infrastructure hierarchy - * NOT_RESTRICTED - any user in the account can view other users from the Users - page in IBM Cloud console - * NOT_SET - to 'unset' a previous set value. - """ - - RESTRICTED = 'RESTRICTED' - NOT_RESTRICTED = 'NOT_RESTRICTED' - NOT_SET = 'NOT_SET' - -class TemplateAccountSettingsRestrictUserDomains: +class TrustedProfileTemplateClaimRule: """ - TemplateAccountSettingsRestrictUserDomains. + TrustedProfileTemplateClaimRule. - :param bool account_sufficient: (optional) - :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) - Defines if account invitations are restricted to specified domains. To remove an - entry for a realm_id, perform an update (PUT) request with only the realm_id - set. + :param str name: (optional) Name of the claim rule to be created or updated. + :param str type: Type of the claim rule. + :param str realm_name: (optional) The realm name of the Idp this claim rule + applies to. This field is required only if the type is specified as + 'Profile-SAML'. + :param int expiration: (optional) Session expiration in seconds, only required + if type is 'Profile-SAML'. + :param List[ProfileClaimRuleConditions] conditions: Conditions of this claim + rule. """ def __init__( self, + type: str, + conditions: List['ProfileClaimRuleConditions'], *, - account_sufficient: Optional[bool] = None, - restrictions: Optional[List['AccountSettingsUserDomainRestriction']] = None, + name: Optional[str] = None, + realm_name: Optional[str] = None, + expiration: Optional[int] = None, ) -> None: """ - Initialize a TemplateAccountSettingsRestrictUserDomains object. + Initialize a TrustedProfileTemplateClaimRule object. - :param bool account_sufficient: (optional) - :param List[AccountSettingsUserDomainRestriction] restrictions: (optional) - Defines if account invitations are restricted to specified domains. To - remove an entry for a realm_id, perform an update (PUT) request with only - the realm_id set. + :param str type: Type of the claim rule. + :param List[ProfileClaimRuleConditions] conditions: Conditions of this + claim rule. + :param str name: (optional) Name of the claim rule to be created or + updated. + :param str realm_name: (optional) The realm name of the Idp this claim rule + applies to. This field is required only if the type is specified as + 'Profile-SAML'. + :param int expiration: (optional) Session expiration in seconds, only + required if type is 'Profile-SAML'. """ - self.account_sufficient = account_sufficient - self.restrictions = restrictions + self.name = name + self.type = type + self.realm_name = realm_name + self.expiration = expiration + self.conditions = conditions @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAccountSettingsRestrictUserDomains': - """Initialize a TemplateAccountSettingsRestrictUserDomains object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateClaimRule': + """Initialize a TrustedProfileTemplateClaimRule object from a json dictionary.""" args = {} - if (account_sufficient := _dict.get('account_sufficient')) is not None: - args['account_sufficient'] = account_sufficient - if (restrictions := _dict.get('restrictions')) is not None: - args['restrictions'] = [AccountSettingsUserDomainRestriction.from_dict(v) for v in restrictions] + if (name := _dict.get('name')) is not None: + args['name'] = name + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in TrustedProfileTemplateClaimRule JSON') + if (realm_name := _dict.get('realm_name')) is not None: + args['realm_name'] = realm_name + if (expiration := _dict.get('expiration')) is not None: + args['expiration'] = expiration + if (conditions := _dict.get('conditions')) is not None: + args['conditions'] = [ProfileClaimRuleConditions.from_dict(v) for v in conditions] + else: + raise ValueError('Required property \'conditions\' not present in TrustedProfileTemplateClaimRule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAccountSettingsRestrictUserDomains object from a json dictionary.""" + """Initialize a TrustedProfileTemplateClaimRule object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'account_sufficient') and self.account_sufficient is not None: - _dict['account_sufficient'] = self.account_sufficient - if hasattr(self, 'restrictions') and self.restrictions is not None: - restrictions_list = [] - for v in self.restrictions: + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'realm_name') and self.realm_name is not None: + _dict['realm_name'] = self.realm_name + if hasattr(self, 'expiration') and self.expiration is not None: + _dict['expiration'] = self.expiration + if hasattr(self, 'conditions') and self.conditions is not None: + conditions_list = [] + for v in self.conditions: if isinstance(v, dict): - restrictions_list.append(v) + conditions_list.append(v) else: - restrictions_list.append(v.to_dict()) - _dict['restrictions'] = restrictions_list + conditions_list.append(v.to_dict()) + _dict['conditions'] = conditions_list return _dict def _to_dict(self): @@ -13457,43 +17776,49 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAccountSettingsRestrictUserDomains object.""" + """Return a `str` version of this TrustedProfileTemplateClaimRule object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAccountSettingsRestrictUserDomains') -> bool: + def __eq__(self, other: 'TrustedProfileTemplateClaimRule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAccountSettingsRestrictUserDomains') -> bool: + def __ne__(self, other: 'TrustedProfileTemplateClaimRule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + Type of the claim rule. + """ -class TemplateAssignmentListResponse: + PROFILE_SAML = 'Profile-SAML' + + +class TrustedProfileTemplateList: """ - List Response body format for Template Assignments Records. + TrustedProfileTemplateList. :param ResponseContext context: (optional) Context with key properties for problem determination. :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 items - per page. Valid range is 1 to 100. + :param int limit: (optional) Optional size of a single page. :param str first: (optional) Link to the first page. :param str previous: (optional) Link to the previous available page. If 'previous' property is not part of the response no previous page is available. :param str next: (optional) Link to the next available page. If 'next' property is not part of the response no next page is available. - :param List[TemplateAssignmentResponse] assignments: List of Assignments based - on the query paramters and the page size. The assignments array is always part - of the response but might be empty depending on the query parameter values - provided. + :param List[TrustedProfileTemplateResponse] profile_templates: List of Profile + Templates based on the query paramters and the page size. The profile_templates + array is always part of the response but might be empty depending on the query + parameter values provided. """ def __init__( self, - assignments: List['TemplateAssignmentResponse'], + profile_templates: List['TrustedProfileTemplateResponse'], *, context: Optional['ResponseContext'] = None, offset: Optional[int] = None, @@ -13503,17 +17828,16 @@ def __init__( next: Optional[str] = None, ) -> None: """ - Initialize a TemplateAssignmentListResponse object. + Initialize a TrustedProfileTemplateList object. - :param List[TemplateAssignmentResponse] assignments: List of Assignments - based on the query paramters and the page size. The assignments array is - always part of the response but might be empty depending on the query - parameter values provided. + :param List[TrustedProfileTemplateResponse] profile_templates: List of + Profile Templates based on the query paramters and the page size. The + profile_templates array is always part of the response but might be empty + depending on the query parameter values provided. :param ResponseContext context: (optional) Context with key properties for problem determination. :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 - items per page. Valid range is 1 to 100. + :param int limit: (optional) Optional size of a single page. :param str first: (optional) Link to the first page. :param str previous: (optional) Link to the previous available page. If 'previous' property is not part of the response no previous page is @@ -13527,11 +17851,11 @@ def __init__( self.first = first self.previous = previous self.next = next - self.assignments = assignments + self.profile_templates = profile_templates @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentListResponse': - """Initialize a TemplateAssignmentListResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateList': + """Initialize a TrustedProfileTemplateList object from a json dictionary.""" args = {} if (context := _dict.get('context')) is not None: args['context'] = ResponseContext.from_dict(context) @@ -13545,15 +17869,15 @@ def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentListResponse': args['previous'] = previous if (next := _dict.get('next')) is not None: args['next'] = next - if (assignments := _dict.get('assignments')) is not None: - args['assignments'] = [TemplateAssignmentResponse.from_dict(v) for v in assignments] + if (profile_templates := _dict.get('profile_templates')) is not None: + args['profile_templates'] = [TrustedProfileTemplateResponse.from_dict(v) for v in profile_templates] else: - raise ValueError('Required property \'assignments\' not present in TemplateAssignmentListResponse JSON') + raise ValueError('Required property \'profile_templates\' not present in TrustedProfileTemplateList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentListResponse object from a json dictionary.""" + """Initialize a TrustedProfileTemplateList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -13574,14 +17898,14 @@ def to_dict(self) -> Dict: _dict['previous'] = self.previous if hasattr(self, 'next') and self.next is not None: _dict['next'] = self.next - if hasattr(self, 'assignments') and self.assignments is not None: - assignments_list = [] - for v in self.assignments: + if hasattr(self, 'profile_templates') and self.profile_templates is not None: + profile_templates_list = [] + for v in self.profile_templates: if isinstance(v, dict): - assignments_list.append(v) + profile_templates_list.append(v) else: - assignments_list.append(v.to_dict()) - _dict['assignments'] = assignments_list + profile_templates_list.append(v.to_dict()) + _dict['profile_templates'] = profile_templates_list return _dict def _to_dict(self): @@ -13589,140 +17913,226 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentListResponse object.""" + """Return a `str` version of this TrustedProfileTemplateList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAssignmentListResponse') -> bool: + def __eq__(self, other: 'TrustedProfileTemplateList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAssignmentListResponse') -> bool: + def __ne__(self, other: 'TrustedProfileTemplateList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateAssignmentResource: +class TrustedProfileTemplateResponse: """ - Body parameters for created resource. + Response body format for Trusted Profile Template REST requests. - :param str id: (optional) Id of the created resource. + :param str id: ID of the the template. + :param int version: Version of the the template. + :param str account_id: ID of the account where the template resides. + :param str name: The name of the trusted profile template. This is visible only + in the enterprise account. + :param str description: (optional) The description of the trusted profile + template. Describe the template for enterprise account users. + :param bool committed: (optional) Committed flag determines if the template is + ready for assignment. + :param TemplateProfileComponentResponse profile: (optional) Input body + parameters for the TemplateProfileComponent. + :param List[PolicyTemplateReference] policy_template_references: (optional) + Existing policy templates that you can reference to assign access in the trusted + profile component. + :param ActionControls action_controls: (optional) + :param List[EnityHistoryRecord] history: (optional) History of the trusted + profile template. + :param str entity_tag: (optional) Entity tag for this templateId-version + combination. + :param str crn: (optional) Cloud resource name. + :param str created_at: (optional) Timestamp of when the template was created. + :param str created_by_id: (optional) IAMid of the creator. + :param str last_modified_at: (optional) Timestamp of when the template was last + modified. + :param str last_modified_by_id: (optional) IAMid of the identity that made the + latest modification. """ def __init__( self, + id: str, + version: int, + account_id: str, + name: str, *, - id: Optional[str] = None, + description: Optional[str] = None, + committed: Optional[bool] = None, + profile: Optional['TemplateProfileComponentResponse'] = None, + policy_template_references: Optional[List['PolicyTemplateReference']] = None, + action_controls: Optional['ActionControls'] = None, + history: Optional[List['EnityHistoryRecord']] = None, + entity_tag: Optional[str] = None, + crn: Optional[str] = None, + created_at: Optional[str] = None, + created_by_id: Optional[str] = None, + last_modified_at: Optional[str] = None, + last_modified_by_id: Optional[str] = None, ) -> None: """ - Initialize a TemplateAssignmentResource object. + Initialize a TrustedProfileTemplateResponse object. - :param str id: (optional) Id of the created resource. + :param str id: ID of the the template. + :param int version: Version of the the template. + :param str account_id: ID of the account where the template resides. + :param str name: The name of the trusted profile template. This is visible + only in the enterprise account. + :param str description: (optional) The description of the trusted profile + template. Describe the template for enterprise account users. + :param bool committed: (optional) Committed flag determines if the template + is ready for assignment. + :param TemplateProfileComponentResponse profile: (optional) Input body + parameters for the TemplateProfileComponent. + :param List[PolicyTemplateReference] policy_template_references: (optional) + Existing policy templates that you can reference to assign access in the + trusted profile component. + :param ActionControls action_controls: (optional) + :param List[EnityHistoryRecord] history: (optional) History of the trusted + profile template. + :param str entity_tag: (optional) Entity tag for this templateId-version + combination. + :param str crn: (optional) Cloud resource name. + :param str created_at: (optional) Timestamp of when the template was + created. + :param str created_by_id: (optional) IAMid of the creator. + :param str last_modified_at: (optional) Timestamp of when the template was + last modified. + :param str last_modified_by_id: (optional) IAMid of the identity that made + the latest modification. """ self.id = id + self.version = version + self.account_id = account_id + self.name = name + self.description = description + self.committed = committed + self.profile = profile + self.policy_template_references = policy_template_references + self.action_controls = action_controls + self.history = history + self.entity_tag = entity_tag + self.crn = crn + self.created_at = created_at + self.created_by_id = created_by_id + self.last_modified_at = last_modified_at + self.last_modified_by_id = last_modified_by_id @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResource': - """Initialize a TemplateAssignmentResource object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateResponse': + """Initialize a TrustedProfileTemplateResponse object from a json dictionary.""" args = {} if (id := _dict.get('id')) is not None: args['id'] = id - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentResource object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentResource object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'TemplateAssignmentResource') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'TemplateAssignmentResource') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class TemplateAssignmentResourceError: - """ - Body parameters for assignment error. - - :param str name: (optional) Name of the error. - :param str error_code: (optional) Internal error code. - :param str message: (optional) Error message detailing the nature of the error. - :param str status_code: (optional) Internal status code for the error. - """ - - def __init__( - self, - *, - name: Optional[str] = None, - error_code: Optional[str] = None, - message: Optional[str] = None, - status_code: Optional[str] = None, - ) -> None: - """ - Initialize a TemplateAssignmentResourceError object. - - :param str name: (optional) Name of the error. - :param str error_code: (optional) Internal error code. - :param str message: (optional) Error message detailing the nature of the - error. - :param str status_code: (optional) Internal status code for the error. - """ - self.name = name - self.error_code = error_code - self.message = message - self.status_code = status_code - - @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResourceError': - """Initialize a TemplateAssignmentResourceError object from a json dictionary.""" - args = {} + else: + raise ValueError('Required property \'id\' not present in TrustedProfileTemplateResponse JSON') + if (version := _dict.get('version')) is not None: + args['version'] = version + else: + raise ValueError('Required property \'version\' not present in TrustedProfileTemplateResponse JSON') + if (account_id := _dict.get('account_id')) is not None: + args['account_id'] = account_id + else: + raise ValueError('Required property \'account_id\' not present in TrustedProfileTemplateResponse JSON') if (name := _dict.get('name')) is not None: args['name'] = name - if (error_code := _dict.get('errorCode')) is not None: - args['error_code'] = error_code - if (message := _dict.get('message')) is not None: - args['message'] = message - if (status_code := _dict.get('statusCode')) is not None: - args['status_code'] = status_code + else: + raise ValueError('Required property \'name\' not present in TrustedProfileTemplateResponse JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (committed := _dict.get('committed')) is not None: + args['committed'] = committed + if (profile := _dict.get('profile')) is not None: + args['profile'] = TemplateProfileComponentResponse.from_dict(profile) + if (policy_template_references := _dict.get('policy_template_references')) is not None: + args['policy_template_references'] = [ + PolicyTemplateReference.from_dict(v) for v in policy_template_references + ] + if (action_controls := _dict.get('action_controls')) is not None: + args['action_controls'] = ActionControls.from_dict(action_controls) + if (history := _dict.get('history')) is not None: + args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] + if (entity_tag := _dict.get('entity_tag')) is not None: + args['entity_tag'] = entity_tag + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = created_at + if (created_by_id := _dict.get('created_by_id')) is not None: + args['created_by_id'] = created_by_id + if (last_modified_at := _dict.get('last_modified_at')) is not None: + args['last_modified_at'] = last_modified_at + if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: + args['last_modified_by_id'] = last_modified_by_id return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentResourceError object from a json dictionary.""" + """Initialize a TrustedProfileTemplateResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version + if hasattr(self, 'account_id') and self.account_id is not None: + _dict['account_id'] = self.account_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'error_code') and self.error_code is not None: - _dict['errorCode'] = self.error_code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'status_code') and self.status_code is not None: - _dict['statusCode'] = self.status_code + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'committed') and self.committed is not None: + _dict['committed'] = self.committed + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'policy_template_references') and self.policy_template_references is not None: + policy_template_references_list = [] + for v in self.policy_template_references: + if isinstance(v, dict): + policy_template_references_list.append(v) + else: + policy_template_references_list.append(v.to_dict()) + _dict['policy_template_references'] = policy_template_references_list + if hasattr(self, 'action_controls') and self.action_controls is not None: + if isinstance(self.action_controls, dict): + _dict['action_controls'] = self.action_controls + else: + _dict['action_controls'] = self.action_controls.to_dict() + if hasattr(self, 'history') and self.history is not None: + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list + if hasattr(self, 'entity_tag') and self.entity_tag is not None: + _dict['entity_tag'] = self.entity_tag + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = self.created_at + if hasattr(self, 'created_by_id') and self.created_by_id is not None: + _dict['created_by_id'] = self.created_by_id + if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: + _dict['last_modified_at'] = self.last_modified_at + if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: + _dict['last_modified_by_id'] = self.last_modified_by_id return _dict def _to_dict(self): @@ -13730,178 +18140,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentResourceError object.""" + """Return a `str` version of this TrustedProfileTemplateResponse object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAssignmentResourceError') -> bool: + def __eq__(self, other: 'TrustedProfileTemplateResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAssignmentResourceError') -> bool: + def __ne__(self, other: 'TrustedProfileTemplateResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateAssignmentResponse: +class TrustedProfilesList: """ - Response body format for Template Assignment Record. + Response body format for the List trusted profiles V1 REST request. :param ResponseContext context: (optional) Context with key properties for problem determination. - :param str id: Assignment record Id. - :param str account_id: Enterprise account Id. - :param str template_id: Template Id. - :param int template_version: Template version. - :param str target_type: Assignment target type. - :param str target: Assignment target. - :param str status: Assignment status. - :param List[TemplateAssignmentResponseResource] resources: (optional) Status - breakdown per target account of IAM resources created or errors encountered in - attempting to create those IAM resources. IAM resources are only included in the - response providing the assignment is not in progress. IAM resources are also - only included when getting a single assignment, and excluded by list APIs. - :param List[EnityHistoryRecord] history: (optional) Assignment history. - :param str href: (optional) Href. - :param str created_at: Assignment created at. - :param str created_by_id: IAMid of the identity that created the assignment. - :param str last_modified_at: Assignment modified at. - :param str last_modified_by_id: IAMid of the identity that last modified the - assignment. - :param str entity_tag: Entity tag for this assignment record. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 items + per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is available. + :param str next: (optional) Link to the next available page. If 'next' property + is not part of the response no next page is available. + :param List[TrustedProfile] profiles: List of trusted profiles. """ def __init__( self, - id: str, - account_id: str, - template_id: str, - template_version: int, - target_type: str, - target: str, - status: str, - created_at: str, - created_by_id: str, - last_modified_at: str, - last_modified_by_id: str, - entity_tag: str, + profiles: List['TrustedProfile'], *, context: Optional['ResponseContext'] = None, - resources: Optional[List['TemplateAssignmentResponseResource']] = None, - history: Optional[List['EnityHistoryRecord']] = None, - href: Optional[str] = None, + offset: Optional[int] = None, + limit: Optional[int] = None, + first: Optional[str] = None, + previous: Optional[str] = None, + next: Optional[str] = None, ) -> None: """ - Initialize a TemplateAssignmentResponse object. + Initialize a TrustedProfilesList object. - :param str id: Assignment record Id. - :param str account_id: Enterprise account Id. - :param str template_id: Template Id. - :param int template_version: Template version. - :param str target_type: Assignment target type. - :param str target: Assignment target. - :param str status: Assignment status. - :param str created_at: Assignment created at. - :param str created_by_id: IAMid of the identity that created the - assignment. - :param str last_modified_at: Assignment modified at. - :param str last_modified_by_id: IAMid of the identity that last modified - the assignment. - :param str entity_tag: Entity tag for this assignment record. + :param List[TrustedProfile] profiles: List of trusted profiles. :param ResponseContext context: (optional) Context with key properties for problem determination. - :param List[TemplateAssignmentResponseResource] resources: (optional) - Status breakdown per target account of IAM resources created or errors - encountered in attempting to create those IAM resources. IAM resources are - only included in the response providing the assignment is not in progress. - IAM resources are also only included when getting a single assignment, and - excluded by list APIs. - :param List[EnityHistoryRecord] history: (optional) Assignment history. - :param str href: (optional) Href. + :param int offset: (optional) The offset of the current page. + :param int limit: (optional) Optional size of a single page. Default is 20 + items per page. Valid range is 1 to 100. + :param str first: (optional) Link to the first page. + :param str previous: (optional) Link to the previous available page. If + 'previous' property is not part of the response no previous page is + available. + :param str next: (optional) Link to the next available page. If 'next' + property is not part of the response no next page is available. """ self.context = context - self.id = id - self.account_id = account_id - self.template_id = template_id - self.template_version = template_version - self.target_type = target_type - self.target = target - self.status = status - self.resources = resources - self.history = history - self.href = href - self.created_at = created_at - self.created_by_id = created_by_id - self.last_modified_at = last_modified_at - self.last_modified_by_id = last_modified_by_id - self.entity_tag = entity_tag + self.offset = offset + self.limit = limit + self.first = first + self.previous = previous + self.next = next + self.profiles = profiles @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponse': - """Initialize a TemplateAssignmentResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfilesList': + """Initialize a TrustedProfilesList object from a json dictionary.""" args = {} if (context := _dict.get('context')) is not None: args['context'] = ResponseContext.from_dict(context) - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in TemplateAssignmentResponse JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in TemplateAssignmentResponse JSON') - if (template_id := _dict.get('template_id')) is not None: - args['template_id'] = template_id - else: - raise ValueError('Required property \'template_id\' not present in TemplateAssignmentResponse JSON') - if (template_version := _dict.get('template_version')) is not None: - args['template_version'] = template_version - else: - raise ValueError('Required property \'template_version\' not present in TemplateAssignmentResponse JSON') - if (target_type := _dict.get('target_type')) is not None: - args['target_type'] = target_type - else: - raise ValueError('Required property \'target_type\' not present in TemplateAssignmentResponse JSON') - if (target := _dict.get('target')) is not None: - args['target'] = target - else: - raise ValueError('Required property \'target\' not present in TemplateAssignmentResponse JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status - else: - raise ValueError('Required property \'status\' not present in TemplateAssignmentResponse JSON') - if (resources := _dict.get('resources')) is not None: - args['resources'] = [TemplateAssignmentResponseResource.from_dict(v) for v in resources] - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (href := _dict.get('href')) is not None: - args['href'] = href - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = created_at - else: - raise ValueError('Required property \'created_at\' not present in TemplateAssignmentResponse JSON') - if (created_by_id := _dict.get('created_by_id')) is not None: - args['created_by_id'] = created_by_id - else: - raise ValueError('Required property \'created_by_id\' not present in TemplateAssignmentResponse JSON') - if (last_modified_at := _dict.get('last_modified_at')) is not None: - args['last_modified_at'] = last_modified_at - else: - raise ValueError('Required property \'last_modified_at\' not present in TemplateAssignmentResponse JSON') - if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: - args['last_modified_by_id'] = last_modified_by_id - else: - raise ValueError('Required property \'last_modified_by_id\' not present in TemplateAssignmentResponse JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag + if (offset := _dict.get('offset')) is not None: + args['offset'] = offset + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (first := _dict.get('first')) is not None: + args['first'] = first + if (previous := _dict.get('previous')) is not None: + args['previous'] = previous + if (next := _dict.get('next')) is not None: + args['next'] = next + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [TrustedProfile.from_dict(v) for v in profiles] else: - raise ValueError('Required property \'entity_tag\' not present in TemplateAssignmentResponse JSON') + raise ValueError('Required property \'profiles\' not present in TrustedProfilesList JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentResponse object from a json dictionary.""" + """Initialize a TrustedProfilesList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -13912,48 +18241,24 @@ def to_dict(self) -> Dict: _dict['context'] = self.context else: _dict['context'] = self.context.to_dict() - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'template_id') and self.template_id is not None: - _dict['template_id'] = self.template_id - if hasattr(self, 'template_version') and self.template_version is not None: - _dict['template_version'] = self.template_version - if hasattr(self, 'target_type') and self.target_type is not None: - _dict['target_type'] = self.target_type - if hasattr(self, 'target') and self.target is not None: - _dict['target'] = self.target - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'resources') and self.resources is not None: - resources_list = [] - for v in self.resources: - if isinstance(v, dict): - resources_list.append(v) - else: - resources_list.append(v.to_dict()) - _dict['resources'] = resources_list - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first + if hasattr(self, 'previous') and self.previous is not None: + _dict['previous'] = self.previous + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: if isinstance(v, dict): - history_list.append(v) + profiles_list.append(v) else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = self.created_at - if hasattr(self, 'created_by_id') and self.created_by_id is not None: - _dict['created_by_id'] = self.created_by_id - if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: - _dict['last_modified_at'] = self.last_modified_at - if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: - _dict['last_modified_by_id'] = self.last_modified_by_id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -13961,102 +18266,75 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentResponse object.""" + """Return a `str` version of this TrustedProfilesList object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAssignmentResponse') -> bool: + def __eq__(self, other: 'TrustedProfilesList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAssignmentResponse') -> bool: + def __ne__(self, other: 'TrustedProfilesList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateAssignmentResponseResource: +class UpdateIdPRequestProperties: """ - Overview of resources assignment per target account. + Properties of the IDP. Will be stored plain-text. - :param str target: Target account where the IAM resource is created. - :param TemplateAssignmentResponseResourceDetail profile: (optional) - :param TemplateAssignmentResponseResourceDetail account_settings: (optional) - :param List[TemplateAssignmentResponseResourceDetail] - policy_template_references: (optional) Policy resource(s) included only for - trusted profile assignments with policy references. + :param UpdateIdPRequestPropertiesIdp idp: (optional) Identity Provider + configuration. + :param UpdateIdPRequestPropertiesSp sp: (optional) Service Provider + configuration. """ def __init__( self, - target: str, *, - profile: Optional['TemplateAssignmentResponseResourceDetail'] = None, - account_settings: Optional['TemplateAssignmentResponseResourceDetail'] = None, - policy_template_references: Optional[List['TemplateAssignmentResponseResourceDetail']] = None, + idp: Optional['UpdateIdPRequestPropertiesIdp'] = None, + sp: Optional['UpdateIdPRequestPropertiesSp'] = None, ) -> None: """ - Initialize a TemplateAssignmentResponseResource object. + Initialize a UpdateIdPRequestProperties object. - :param str target: Target account where the IAM resource is created. - :param TemplateAssignmentResponseResourceDetail profile: (optional) - :param TemplateAssignmentResponseResourceDetail account_settings: - (optional) - :param List[TemplateAssignmentResponseResourceDetail] - policy_template_references: (optional) Policy resource(s) included only for - trusted profile assignments with policy references. + :param UpdateIdPRequestPropertiesIdp idp: (optional) Identity Provider + configuration. + :param UpdateIdPRequestPropertiesSp sp: (optional) Service Provider + configuration. """ - self.target = target - self.profile = profile - self.account_settings = account_settings - self.policy_template_references = policy_template_references + self.idp = idp + self.sp = sp @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponseResource': - """Initialize a TemplateAssignmentResponseResource object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestProperties': + """Initialize a UpdateIdPRequestProperties object from a json dictionary.""" args = {} - if (target := _dict.get('target')) is not None: - args['target'] = target - else: - raise ValueError('Required property \'target\' not present in TemplateAssignmentResponseResource JSON') - if (profile := _dict.get('profile')) is not None: - args['profile'] = TemplateAssignmentResponseResourceDetail.from_dict(profile) - if (account_settings := _dict.get('account_settings')) is not None: - args['account_settings'] = TemplateAssignmentResponseResourceDetail.from_dict(account_settings) - if (policy_template_references := _dict.get('policy_template_references')) is not None: - args['policy_template_references'] = [ - TemplateAssignmentResponseResourceDetail.from_dict(v) for v in policy_template_references - ] + if (idp := _dict.get('idp')) is not None: + args['idp'] = UpdateIdPRequestPropertiesIdp.from_dict(idp) + if (sp := _dict.get('sp')) is not None: + args['sp'] = UpdateIdPRequestPropertiesSp.from_dict(sp) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentResponseResource object from a json dictionary.""" + """Initialize a UpdateIdPRequestProperties object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'target') and self.target is not None: - _dict['target'] = self.target - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile + if hasattr(self, 'idp') and self.idp is not None: + if isinstance(self.idp, dict): + _dict['idp'] = self.idp else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'account_settings') and self.account_settings is not None: - if isinstance(self.account_settings, dict): - _dict['account_settings'] = self.account_settings + _dict['idp'] = self.idp.to_dict() + if hasattr(self, 'sp') and self.sp is not None: + if isinstance(self.sp, dict): + _dict['sp'] = self.sp else: - _dict['account_settings'] = self.account_settings.to_dict() - if hasattr(self, 'policy_template_references') and self.policy_template_references is not None: - policy_template_references_list = [] - for v in self.policy_template_references: - if isinstance(v, dict): - policy_template_references_list.append(v) - else: - policy_template_references_list.append(v.to_dict()) - _dict['policy_template_references'] = policy_template_references_list + _dict['sp'] = self.sp.to_dict() return _dict def _to_dict(self): @@ -14064,107 +18342,83 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentResponseResource object.""" + """Return a `str` version of this UpdateIdPRequestProperties object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAssignmentResponseResource') -> bool: + def __eq__(self, other: 'UpdateIdPRequestProperties') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAssignmentResponseResource') -> bool: + def __ne__(self, other: 'UpdateIdPRequestProperties') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateAssignmentResponseResourceDetail: +class UpdateIdPRequestPropertiesIdp: """ - TemplateAssignmentResponseResourceDetail. + Identity Provider configuration. - :param str id: (optional) Policy Template Id, only returned for a profile - assignment with policy references. - :param str version: (optional) Policy version, only returned for a profile - assignment with policy references. - :param TemplateAssignmentResource resource_created: (optional) Body parameters - for created resource. - :param TemplateAssignmentResourceError error_message: (optional) Body parameters - for assignment error. - :param str status: Status for the target account's assignment. + :param str entity_id: (optional) SAML IDP entity ID. + :param str redirect_binding_url: (optional) Redirect binding URL. + :param bool want_request_signed: (optional) Indicates if IDP wants requests to + be signed. + :param str logout_url: (optional) SAML IDP logout URL (optional). """ def __init__( self, - status: str, *, - id: Optional[str] = None, - version: Optional[str] = None, - resource_created: Optional['TemplateAssignmentResource'] = None, - error_message: Optional['TemplateAssignmentResourceError'] = None, + entity_id: Optional[str] = None, + redirect_binding_url: Optional[str] = None, + want_request_signed: Optional[bool] = None, + logout_url: Optional[str] = None, ) -> None: """ - Initialize a TemplateAssignmentResponseResourceDetail object. + Initialize a UpdateIdPRequestPropertiesIdp object. - :param str status: Status for the target account's assignment. - :param str id: (optional) Policy Template Id, only returned for a profile - assignment with policy references. - :param str version: (optional) Policy version, only returned for a profile - assignment with policy references. - :param TemplateAssignmentResource resource_created: (optional) Body - parameters for created resource. - :param TemplateAssignmentResourceError error_message: (optional) Body - parameters for assignment error. + :param str entity_id: (optional) SAML IDP entity ID. + :param str redirect_binding_url: (optional) Redirect binding URL. + :param bool want_request_signed: (optional) Indicates if IDP wants requests + to be signed. + :param str logout_url: (optional) SAML IDP logout URL (optional). """ - self.id = id - self.version = version - self.resource_created = resource_created - self.error_message = error_message - self.status = status + self.entity_id = entity_id + self.redirect_binding_url = redirect_binding_url + self.want_request_signed = want_request_signed + self.logout_url = logout_url @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateAssignmentResponseResourceDetail': - """Initialize a TemplateAssignmentResponseResourceDetail object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestPropertiesIdp': + """Initialize a UpdateIdPRequestPropertiesIdp object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - if (version := _dict.get('version')) is not None: - args['version'] = version - if (resource_created := _dict.get('resource_created')) is not None: - args['resource_created'] = TemplateAssignmentResource.from_dict(resource_created) - if (error_message := _dict.get('error_message')) is not None: - args['error_message'] = TemplateAssignmentResourceError.from_dict(error_message) - if (status := _dict.get('status')) is not None: - args['status'] = status - else: - raise ValueError( - 'Required property \'status\' not present in TemplateAssignmentResponseResourceDetail JSON' - ) + if (entity_id := _dict.get('entity_id')) is not None: + args['entity_id'] = entity_id + if (redirect_binding_url := _dict.get('redirect_binding_url')) is not None: + args['redirect_binding_url'] = redirect_binding_url + if (want_request_signed := _dict.get('want_request_signed')) is not None: + args['want_request_signed'] = want_request_signed + if (logout_url := _dict.get('logout_url')) is not None: + args['logout_url'] = logout_url return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateAssignmentResponseResourceDetail object from a json dictionary.""" + """Initialize a UpdateIdPRequestPropertiesIdp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'version') and self.version is not None: - _dict['version'] = self.version - if hasattr(self, 'resource_created') and self.resource_created is not None: - if isinstance(self.resource_created, dict): - _dict['resource_created'] = self.resource_created - else: - _dict['resource_created'] = self.resource_created.to_dict() - if hasattr(self, 'error_message') and self.error_message is not None: - if isinstance(self.error_message, dict): - _dict['error_message'] = self.error_message - else: - _dict['error_message'] = self.error_message.to_dict() - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status + if hasattr(self, 'entity_id') and self.entity_id is not None: + _dict['entity_id'] = self.entity_id + if hasattr(self, 'redirect_binding_url') and self.redirect_binding_url is not None: + _dict['redirect_binding_url'] = self.redirect_binding_url + if hasattr(self, 'want_request_signed') and self.want_request_signed is not None: + _dict['want_request_signed'] = self.want_request_signed + if hasattr(self, 'logout_url') and self.logout_url is not None: + _dict['logout_url'] = self.logout_url return _dict def _to_dict(self): @@ -14172,65 +18426,130 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateAssignmentResponseResourceDetail object.""" + """Return a `str` version of this UpdateIdPRequestPropertiesIdp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateAssignmentResponseResourceDetail') -> bool: + def __eq__(self, other: 'UpdateIdPRequestPropertiesIdp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateAssignmentResponseResourceDetail') -> bool: + def __ne__(self, other: 'UpdateIdPRequestPropertiesIdp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateCount: +class UpdateIdPRequestPropertiesSp: """ - Version count for a specific template. - - :param str template_id: (optional) Template identifier. - :param int count: (optional) Number of versions for the template. + Service Provider configuration. + + :param bool want_assertion_signed: (optional) Indicates if SP wants assertions + to be signed. + :param bool want_response_signed: (optional) Indicates if SP wants responses to + be signed. + :param bool encrypt_response: (optional) Indicates if responses should be + encrypted. + :param bool idp_initiated_login_enabled: (optional) Enables IDP-initiated login. + :param bool logout_url_enabled_when_available: (optional) Enables logout URL + when available. + :param List[str] idp_initiated_urls: (optional) URLs for IDP-initiated login. + :param UpdateIdPRequestPropertiesSpAuthnContext authn_context: (optional) + Authentication context configuration. + :param dict claims: (optional) Custom mapping between SAML assertions and IAM + claims. """ def __init__( self, *, - template_id: Optional[str] = None, - count: Optional[int] = None, + want_assertion_signed: Optional[bool] = None, + want_response_signed: Optional[bool] = None, + encrypt_response: Optional[bool] = None, + idp_initiated_login_enabled: Optional[bool] = None, + logout_url_enabled_when_available: Optional[bool] = None, + idp_initiated_urls: Optional[List[str]] = None, + authn_context: Optional['UpdateIdPRequestPropertiesSpAuthnContext'] = None, + claims: Optional[dict] = None, ) -> None: """ - Initialize a TemplateCount object. - - :param str template_id: (optional) Template identifier. - :param int count: (optional) Number of versions for the template. - """ - self.template_id = template_id - self.count = count + Initialize a UpdateIdPRequestPropertiesSp object. + + :param bool want_assertion_signed: (optional) Indicates if SP wants + assertions to be signed. + :param bool want_response_signed: (optional) Indicates if SP wants + responses to be signed. + :param bool encrypt_response: (optional) Indicates if responses should be + encrypted. + :param bool idp_initiated_login_enabled: (optional) Enables IDP-initiated + login. + :param bool logout_url_enabled_when_available: (optional) Enables logout + URL when available. + :param List[str] idp_initiated_urls: (optional) URLs for IDP-initiated + login. + :param UpdateIdPRequestPropertiesSpAuthnContext authn_context: (optional) + Authentication context configuration. + :param dict claims: (optional) Custom mapping between SAML assertions and + IAM claims. + """ + self.want_assertion_signed = want_assertion_signed + self.want_response_signed = want_response_signed + self.encrypt_response = encrypt_response + self.idp_initiated_login_enabled = idp_initiated_login_enabled + self.logout_url_enabled_when_available = logout_url_enabled_when_available + self.idp_initiated_urls = idp_initiated_urls + self.authn_context = authn_context + self.claims = claims @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateCount': - """Initialize a TemplateCount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestPropertiesSp': + """Initialize a UpdateIdPRequestPropertiesSp object from a json dictionary.""" args = {} - if (template_id := _dict.get('template_id')) is not None: - args['template_id'] = template_id - if (count := _dict.get('count')) is not None: - args['count'] = count + if (want_assertion_signed := _dict.get('want_assertion_signed')) is not None: + args['want_assertion_signed'] = want_assertion_signed + if (want_response_signed := _dict.get('want_response_signed')) is not None: + args['want_response_signed'] = want_response_signed + if (encrypt_response := _dict.get('encrypt_response')) is not None: + args['encrypt_response'] = encrypt_response + if (idp_initiated_login_enabled := _dict.get('idp_initiated_login_enabled')) is not None: + args['idp_initiated_login_enabled'] = idp_initiated_login_enabled + if (logout_url_enabled_when_available := _dict.get('logout_url_enabled_when_available')) is not None: + args['logout_url_enabled_when_available'] = logout_url_enabled_when_available + if (idp_initiated_urls := _dict.get('idp_initiated_urls')) is not None: + args['idp_initiated_urls'] = idp_initiated_urls + if (authn_context := _dict.get('authn_context')) is not None: + args['authn_context'] = UpdateIdPRequestPropertiesSpAuthnContext.from_dict(authn_context) + if (claims := _dict.get('claims')) is not None: + args['claims'] = claims return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateCount object from a json dictionary.""" + """Initialize a UpdateIdPRequestPropertiesSp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'template_id') and self.template_id is not None: - _dict['template_id'] = self.template_id - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count + if hasattr(self, 'want_assertion_signed') and self.want_assertion_signed is not None: + _dict['want_assertion_signed'] = self.want_assertion_signed + if hasattr(self, 'want_response_signed') and self.want_response_signed is not None: + _dict['want_response_signed'] = self.want_response_signed + if hasattr(self, 'encrypt_response') and self.encrypt_response is not None: + _dict['encrypt_response'] = self.encrypt_response + if hasattr(self, 'idp_initiated_login_enabled') and self.idp_initiated_login_enabled is not None: + _dict['idp_initiated_login_enabled'] = self.idp_initiated_login_enabled + if hasattr(self, 'logout_url_enabled_when_available') and self.logout_url_enabled_when_available is not None: + _dict['logout_url_enabled_when_available'] = self.logout_url_enabled_when_available + if hasattr(self, 'idp_initiated_urls') and self.idp_initiated_urls is not None: + _dict['idp_initiated_urls'] = self.idp_initiated_urls + if hasattr(self, 'authn_context') and self.authn_context is not None: + if isinstance(self.authn_context, dict): + _dict['authn_context'] = self.authn_context + else: + _dict['authn_context'] = self.authn_context.to_dict() + if hasattr(self, 'claims') and self.claims is not None: + _dict['claims'] = self.claims return _dict def _to_dict(self): @@ -14238,141 +18557,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateCount object.""" + """Return a `str` version of this UpdateIdPRequestPropertiesSp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateCount') -> bool: + def __eq__(self, other: 'UpdateIdPRequestPropertiesSp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateCount') -> bool: + def __ne__(self, other: 'UpdateIdPRequestPropertiesSp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateProfileComponentRequest: +class UpdateIdPRequestPropertiesSpAuthnContext: """ - Input body parameters for the TemplateProfileComponent. + Authentication context configuration. - :param str name: Name of the Profile. - You can use replacement variables in the profile name to adjust the name per - account. - The following variables are supported: - - `${template_id}` will be replaced by a unique identifier representing the - trusted profile template - - `${template_name}` will be replaced by the current name of the trusted profile - template - - `${template_version}` will be replaced by the current version of the trusted - profile template - - `${account_id}` will be replaced by the account identifier to which this - trusted profile template is assigned to - - `${account_name}` will be replaced by the account name to which this trusted - profile template is assigned to - Changes to e.g. the name of the account will NOT cause an update of the trusted - profile name. The profile name is processed during account assignment and any - template version upgrade, i.e. during that operation, the updated account name - would be used. - :param str description: (optional) Description of the Profile. - :param str email: (optional) Email of the trusted profile. - :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for the - Profile. - :param List[ProfileIdentityRequest] identities: (optional) Identities for the - Profile. + :param List[str] request: (optional) Requested authentication context classes. + :param List[str] accept: (optional) Accepted authentication context classes. """ def __init__( self, - name: str, *, - description: Optional[str] = None, - email: Optional[str] = None, - rules: Optional[List['TrustedProfileTemplateClaimRule']] = None, - identities: Optional[List['ProfileIdentityRequest']] = None, + request: Optional[List[str]] = None, + accept: Optional[List[str]] = None, ) -> None: """ - Initialize a TemplateProfileComponentRequest object. + Initialize a UpdateIdPRequestPropertiesSpAuthnContext object. - :param str name: Name of the Profile. - You can use replacement variables in the profile name to adjust the name - per account. - The following variables are supported: - - `${template_id}` will be replaced by a unique identifier representing the - trusted profile template - - `${template_name}` will be replaced by the current name of the trusted - profile template - - `${template_version}` will be replaced by the current version of the - trusted profile template - - `${account_id}` will be replaced by the account identifier to which this - trusted profile template is assigned to - - `${account_name}` will be replaced by the account name to which this - trusted profile template is assigned to - Changes to e.g. the name of the account will NOT cause an update of the - trusted profile name. The profile name is processed during account - assignment and any template version upgrade, i.e. during that operation, - the updated account name would be used. - :param str description: (optional) Description of the Profile. - :param str email: (optional) Email of the trusted profile. - :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for - the Profile. - :param List[ProfileIdentityRequest] identities: (optional) Identities for - the Profile. + :param List[str] request: (optional) Requested authentication context + classes. + :param List[str] accept: (optional) Accepted authentication context + classes. """ - self.name = name - self.description = description - self.email = email - self.rules = rules - self.identities = identities + self.request = request + self.accept = accept @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateProfileComponentRequest': - """Initialize a TemplateProfileComponentRequest object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestPropertiesSpAuthnContext': + """Initialize a UpdateIdPRequestPropertiesSpAuthnContext object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in TemplateProfileComponentRequest JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (email := _dict.get('email')) is not None: - args['email'] = email - if (rules := _dict.get('rules')) is not None: - args['rules'] = [TrustedProfileTemplateClaimRule.from_dict(v) for v in rules] - if (identities := _dict.get('identities')) is not None: - args['identities'] = [ProfileIdentityRequest.from_dict(v) for v in identities] + if (request := _dict.get('request')) is not None: + args['request'] = request + if (accept := _dict.get('accept')) is not None: + args['accept'] = accept return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateProfileComponentRequest object from a json dictionary.""" + """Initialize a UpdateIdPRequestPropertiesSpAuthnContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'email') and self.email is not None: - _dict['email'] = self.email - if hasattr(self, 'rules') and self.rules is not None: - rules_list = [] - for v in self.rules: - if isinstance(v, dict): - rules_list.append(v) - else: - rules_list.append(v.to_dict()) - _dict['rules'] = rules_list - if hasattr(self, 'identities') and self.identities is not None: - identities_list = [] - for v in self.identities: - if isinstance(v, dict): - identities_list.append(v) - else: - identities_list.append(v.to_dict()) - _dict['identities'] = identities_list + if hasattr(self, 'request') and self.request is not None: + _dict['request'] = self.request + if hasattr(self, 'accept') and self.accept is not None: + _dict['accept'] = self.accept return _dict def _to_dict(self): @@ -14380,107 +18625,72 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateProfileComponentRequest object.""" + """Return a `str` version of this UpdateIdPRequestPropertiesSpAuthnContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateProfileComponentRequest') -> bool: + def __eq__(self, other: 'UpdateIdPRequestPropertiesSpAuthnContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateProfileComponentRequest') -> bool: + def __ne__(self, other: 'UpdateIdPRequestPropertiesSpAuthnContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TemplateProfileComponentResponse: +class UpdateIdPRequestSecrets: """ - Input body parameters for the TemplateProfileComponent. + Secrets of the IDP. Will be stored encrypted. - :param str name: Name of the Profile. - :param str description: (optional) Description of the Profile. - :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for the - Profile. - :param str email: (optional) Email of the trusted profile. - :param List[ProfileIdentityResponse] identities: (optional) Identities for the - Profile. + :param UpdateIdPRequestSecretsIdp idp: (optional) Identity Provider secrets. + :param UpdateIdPRequestSecretsSp sp: (optional) Service Provider secrets. """ def __init__( self, - name: str, *, - description: Optional[str] = None, - rules: Optional[List['TrustedProfileTemplateClaimRule']] = None, - email: Optional[str] = None, - identities: Optional[List['ProfileIdentityResponse']] = None, + idp: Optional['UpdateIdPRequestSecretsIdp'] = None, + sp: Optional['UpdateIdPRequestSecretsSp'] = None, ) -> None: """ - Initialize a TemplateProfileComponentResponse object. + Initialize a UpdateIdPRequestSecrets object. - :param str name: Name of the Profile. - :param str description: (optional) Description of the Profile. - :param List[TrustedProfileTemplateClaimRule] rules: (optional) Rules for - the Profile. - :param str email: (optional) Email of the trusted profile. - :param List[ProfileIdentityResponse] identities: (optional) Identities for - the Profile. + :param UpdateIdPRequestSecretsIdp idp: (optional) Identity Provider + secrets. + :param UpdateIdPRequestSecretsSp sp: (optional) Service Provider secrets. """ - self.name = name - self.description = description - self.rules = rules - self.email = email - self.identities = identities + self.idp = idp + self.sp = sp @classmethod - def from_dict(cls, _dict: Dict) -> 'TemplateProfileComponentResponse': - """Initialize a TemplateProfileComponentResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecrets': + """Initialize a UpdateIdPRequestSecrets object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in TemplateProfileComponentResponse JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (rules := _dict.get('rules')) is not None: - args['rules'] = [TrustedProfileTemplateClaimRule.from_dict(v) for v in rules] - if (email := _dict.get('email')) is not None: - args['email'] = email - if (identities := _dict.get('identities')) is not None: - args['identities'] = [ProfileIdentityResponse.from_dict(v) for v in identities] + if (idp := _dict.get('idp')) is not None: + args['idp'] = UpdateIdPRequestSecretsIdp.from_dict(idp) + if (sp := _dict.get('sp')) is not None: + args['sp'] = UpdateIdPRequestSecretsSp.from_dict(sp) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TemplateProfileComponentResponse object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecrets object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'rules') and self.rules is not None: - rules_list = [] - for v in self.rules: - if isinstance(v, dict): - rules_list.append(v) - else: - rules_list.append(v.to_dict()) - _dict['rules'] = rules_list - if hasattr(self, 'email') and self.email is not None: - _dict['email'] = self.email - if hasattr(self, 'identities') and self.identities is not None: - identities_list = [] - for v in self.identities: - if isinstance(v, dict): - identities_list.append(v) - else: - identities_list.append(v.to_dict()) - _dict['identities'] = identities_list + if hasattr(self, 'idp') and self.idp is not None: + if isinstance(self.idp, dict): + _dict['idp'] = self.idp + else: + _dict['idp'] = self.idp.to_dict() + if hasattr(self, 'sp') and self.sp is not None: + if isinstance(self.sp, dict): + _dict['sp'] = self.sp + else: + _dict['sp'] = self.sp.to_dict() return _dict def _to_dict(self): @@ -14488,250 +18698,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TemplateProfileComponentResponse object.""" + """Return a `str` version of this UpdateIdPRequestSecrets object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TemplateProfileComponentResponse') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecrets') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TemplateProfileComponentResponse') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecrets') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TrustedProfile: +class UpdateIdPRequestSecretsIdp: """ - Response body format for trusted profile V1 REST requests. + Identity Provider secrets. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str id: the unique identifier of the trusted profile. - Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. - :param str entity_tag: Version of the trusted profile details object. You need - to specify this value when updating the trusted profile to avoid stale updates. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. - :param str name: Name of the trusted profile. The name is checked for - uniqueness. Therefore trusted profiles with the same names can not exist in the - same account. - :param str description: (optional) The optional description of the trusted - profile. The 'description' property is only available if a description was - provided during a create of a trusted profile. - :param str email: (optional) The optional email of the trusted profile. The - 'email' property is only available if an email was provided during a create of a - trusted profile. - :param datetime created_at: (optional) If set contains a date time string of the - creation date in ISO format. - :param datetime modified_at: (optional) If set contains a date time string of - the last modification date in ISO format. - :param str iam_id: The iam_id of this trusted profile. - :param str account_id: ID of the account that this trusted profile belong to. - :param str template_id: (optional) ID of the IAM template that was used to - create an enterprise-managed trusted profile in your account. When returned, - this indicates that the trusted profile is created from and managed by a - template in the root enterprise account. - :param str assignment_id: (optional) ID of the assignment that was used to - create an enterprise-managed trusted profile in your account. When returned, - this indicates that the trusted profile is created from and managed by a - template in the root enterprise account. - :param int ims_account_id: (optional) IMS acount ID of the trusted profile. - :param int ims_user_id: (optional) IMS user ID of the trusted profile. - :param List[EnityHistoryRecord] history: (optional) History of the trusted - profile. - :param Activity activity: (optional) + :param List[UpdateIdPRequestSecretsIdpSigningItem] signing: (optional) IDP + signing certificates. + :param List[UpdateIdPRequestSecretsIdpEncryptingItem] encrypting: (optional) IDP + encrypting certificates. """ def __init__( self, - id: str, - entity_tag: str, - crn: str, - name: str, - iam_id: str, - account_id: str, *, - context: Optional['ResponseContext'] = None, - description: Optional[str] = None, - email: Optional[str] = None, - created_at: Optional[datetime] = None, - modified_at: Optional[datetime] = None, - template_id: Optional[str] = None, - assignment_id: Optional[str] = None, - ims_account_id: Optional[int] = None, - ims_user_id: Optional[int] = None, - history: Optional[List['EnityHistoryRecord']] = None, - activity: Optional['Activity'] = None, + signing: Optional[List['UpdateIdPRequestSecretsIdpSigningItem']] = None, + encrypting: Optional[List['UpdateIdPRequestSecretsIdpEncryptingItem']] = None, ) -> None: """ - Initialize a TrustedProfile object. + Initialize a UpdateIdPRequestSecretsIdp object. - :param str id: the unique identifier of the trusted profile. - Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. - :param str entity_tag: Version of the trusted profile details object. You - need to specify this value when updating the trusted profile to avoid stale - updates. - :param str crn: Cloud Resource Name of the item. Example Cloud Resource - Name: - 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'. - :param str name: Name of the trusted profile. The name is checked for - uniqueness. Therefore trusted profiles with the same names can not exist in - the same account. - :param str iam_id: The iam_id of this trusted profile. - :param str account_id: ID of the account that this trusted profile belong - to. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param str description: (optional) The optional description of the trusted - profile. The 'description' property is only available if a description was - provided during a create of a trusted profile. - :param str email: (optional) The optional email of the trusted profile. The - 'email' property is only available if an email was provided during a create - of a trusted profile. - :param datetime created_at: (optional) If set contains a date time string - of the creation date in ISO format. - :param datetime modified_at: (optional) If set contains a date time string - of the last modification date in ISO format. - :param str template_id: (optional) ID of the IAM template that was used to - create an enterprise-managed trusted profile in your account. When - returned, this indicates that the trusted profile is created from and - managed by a template in the root enterprise account. - :param str assignment_id: (optional) ID of the assignment that was used to - create an enterprise-managed trusted profile in your account. When - returned, this indicates that the trusted profile is created from and - managed by a template in the root enterprise account. - :param int ims_account_id: (optional) IMS acount ID of the trusted profile. - :param int ims_user_id: (optional) IMS user ID of the trusted profile. - :param List[EnityHistoryRecord] history: (optional) History of the trusted - profile. - :param Activity activity: (optional) + :param List[UpdateIdPRequestSecretsIdpSigningItem] signing: (optional) IDP + signing certificates. + :param List[UpdateIdPRequestSecretsIdpEncryptingItem] encrypting: + (optional) IDP encrypting certificates. """ - self.context = context - self.id = id - self.entity_tag = entity_tag - self.crn = crn - self.name = name - self.description = description - self.email = email - self.created_at = created_at - self.modified_at = modified_at - self.iam_id = iam_id - self.account_id = account_id - self.template_id = template_id - self.assignment_id = assignment_id - self.ims_account_id = ims_account_id - self.ims_user_id = ims_user_id - self.history = history - self.activity = activity + self.signing = signing + self.encrypting = encrypting - @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfile': - """Initialize a TrustedProfile object from a json dictionary.""" - args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in TrustedProfile JSON') - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - else: - raise ValueError('Required property \'entity_tag\' not present in TrustedProfile JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in TrustedProfile JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in TrustedProfile JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (email := _dict.get('email')) is not None: - args['email'] = email - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - if (modified_at := _dict.get('modified_at')) is not None: - args['modified_at'] = string_to_datetime(modified_at) - if (iam_id := _dict.get('iam_id')) is not None: - args['iam_id'] = iam_id - else: - raise ValueError('Required property \'iam_id\' not present in TrustedProfile JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in TrustedProfile JSON') - if (template_id := _dict.get('template_id')) is not None: - args['template_id'] = template_id - if (assignment_id := _dict.get('assignment_id')) is not None: - args['assignment_id'] = assignment_id - if (ims_account_id := _dict.get('ims_account_id')) is not None: - args['ims_account_id'] = ims_account_id - if (ims_user_id := _dict.get('ims_user_id')) is not None: - args['ims_user_id'] = ims_user_id - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (activity := _dict.get('activity')) is not None: - args['activity'] = Activity.from_dict(activity) + @classmethod + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecretsIdp': + """Initialize a UpdateIdPRequestSecretsIdp object from a json dictionary.""" + args = {} + if (signing := _dict.get('signing')) is not None: + args['signing'] = [UpdateIdPRequestSecretsIdpSigningItem.from_dict(v) for v in signing] + if (encrypting := _dict.get('encrypting')) is not None: + args['encrypting'] = [UpdateIdPRequestSecretsIdpEncryptingItem.from_dict(v) for v in encrypting] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfile object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecretsIdp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'email') and self.email is not None: - _dict['email'] = self.email - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'modified_at') and self.modified_at is not None: - _dict['modified_at'] = datetime_to_string(self.modified_at) - if hasattr(self, 'iam_id') and self.iam_id is not None: - _dict['iam_id'] = self.iam_id - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'template_id') and self.template_id is not None: - _dict['template_id'] = self.template_id - if hasattr(self, 'assignment_id') and self.assignment_id is not None: - _dict['assignment_id'] = self.assignment_id - if hasattr(self, 'ims_account_id') and self.ims_account_id is not None: - _dict['ims_account_id'] = self.ims_account_id - if hasattr(self, 'ims_user_id') and self.ims_user_id is not None: - _dict['ims_user_id'] = self.ims_user_id - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: + if hasattr(self, 'signing') and self.signing is not None: + signing_list = [] + for v in self.signing: if isinstance(v, dict): - history_list.append(v) + signing_list.append(v) else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'activity') and self.activity is not None: - if isinstance(self.activity, dict): - _dict['activity'] = self.activity - else: - _dict['activity'] = self.activity.to_dict() + signing_list.append(v.to_dict()) + _dict['signing'] = signing_list + if hasattr(self, 'encrypting') and self.encrypting is not None: + encrypting_list = [] + for v in self.encrypting: + if isinstance(v, dict): + encrypting_list.append(v) + else: + encrypting_list.append(v.to_dict()) + _dict['encrypting'] = encrypting_list return _dict def _to_dict(self): @@ -14739,108 +18780,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfile object.""" + """Return a `str` version of this UpdateIdPRequestSecretsIdp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfile') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecretsIdp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TrustedProfile') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecretsIdp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TrustedProfileTemplateClaimRule: +class UpdateIdPRequestSecretsIdpEncryptingItem: """ - TrustedProfileTemplateClaimRule. + UpdateIdPRequestSecretsIdpEncryptingItem. - :param str name: (optional) Name of the claim rule to be created or updated. - :param str type: Type of the claim rule. - :param str realm_name: (optional) The realm name of the Idp this claim rule - applies to. This field is required only if the type is specified as - 'Profile-SAML'. - :param int expiration: (optional) Session expiration in seconds, only required - if type is 'Profile-SAML'. - :param List[ProfileClaimRuleConditions] conditions: Conditions of this claim - rule. + :param str value: (optional) Certificate value. + :param str type: (optional) Certificate type. """ def __init__( self, - type: str, - conditions: List['ProfileClaimRuleConditions'], *, - name: Optional[str] = None, - realm_name: Optional[str] = None, - expiration: Optional[int] = None, + value: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a TrustedProfileTemplateClaimRule object. + Initialize a UpdateIdPRequestSecretsIdpEncryptingItem object. - :param str type: Type of the claim rule. - :param List[ProfileClaimRuleConditions] conditions: Conditions of this - claim rule. - :param str name: (optional) Name of the claim rule to be created or - updated. - :param str realm_name: (optional) The realm name of the Idp this claim rule - applies to. This field is required only if the type is specified as - 'Profile-SAML'. - :param int expiration: (optional) Session expiration in seconds, only - required if type is 'Profile-SAML'. + :param str value: (optional) Certificate value. + :param str type: (optional) Certificate type. """ - self.name = name + self.value = value self.type = type - self.realm_name = realm_name - self.expiration = expiration - self.conditions = conditions @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateClaimRule': - """Initialize a TrustedProfileTemplateClaimRule object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecretsIdpEncryptingItem': + """Initialize a UpdateIdPRequestSecretsIdpEncryptingItem object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if (value := _dict.get('value')) is not None: + args['value'] = value if (type := _dict.get('type')) is not None: args['type'] = type - else: - raise ValueError('Required property \'type\' not present in TrustedProfileTemplateClaimRule JSON') - if (realm_name := _dict.get('realm_name')) is not None: - args['realm_name'] = realm_name - if (expiration := _dict.get('expiration')) is not None: - args['expiration'] = expiration - if (conditions := _dict.get('conditions')) is not None: - args['conditions'] = [ProfileClaimRuleConditions.from_dict(v) for v in conditions] - else: - raise ValueError('Required property \'conditions\' not present in TrustedProfileTemplateClaimRule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfileTemplateClaimRule object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecretsIdpEncryptingItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'realm_name') and self.realm_name is not None: - _dict['realm_name'] = self.realm_name - if hasattr(self, 'expiration') and self.expiration is not None: - _dict['expiration'] = self.expiration - if hasattr(self, 'conditions') and self.conditions is not None: - conditions_list = [] - for v in self.conditions: - if isinstance(v, dict): - conditions_list.append(v) - else: - conditions_list.append(v.to_dict()) - _dict['conditions'] = conditions_list return _dict def _to_dict(self): @@ -14848,136 +18846,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfileTemplateClaimRule object.""" + """Return a `str` version of this UpdateIdPRequestSecretsIdpEncryptingItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfileTemplateClaimRule') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecretsIdpEncryptingItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TrustedProfileTemplateClaimRule') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecretsIdpEncryptingItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TypeEnum(str, Enum): """ - Type of the claim rule. + Certificate type. """ - PROFILE_SAML = 'Profile-SAML' + PRIMARY = 'primary' + SECONDARY = 'secondary' -class TrustedProfileTemplateList: +class UpdateIdPRequestSecretsIdpSigningItem: """ - TrustedProfileTemplateList. + UpdateIdPRequestSecretsIdpSigningItem. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is available. - :param str next: (optional) Link to the next available page. If 'next' property - is not part of the response no next page is available. - :param List[TrustedProfileTemplateResponse] profile_templates: List of Profile - Templates based on the query paramters and the page size. The profile_templates - array is always part of the response but might be empty depending on the query - parameter values provided. + :param str value: (optional) Certificate value in PEM format. + :param str type: (optional) Certificate type. """ def __init__( self, - profile_templates: List['TrustedProfileTemplateResponse'], *, - context: Optional['ResponseContext'] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, - first: Optional[str] = None, - previous: Optional[str] = None, - next: Optional[str] = None, + value: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a TrustedProfileTemplateList object. + Initialize a UpdateIdPRequestSecretsIdpSigningItem object. - :param List[TrustedProfileTemplateResponse] profile_templates: List of - Profile Templates based on the query paramters and the page size. The - profile_templates array is always part of the response but might be empty - depending on the query parameter values provided. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is - available. - :param str next: (optional) Link to the next available page. If 'next' - property is not part of the response no next page is available. + :param str value: (optional) Certificate value in PEM format. + :param str type: (optional) Certificate type. """ - self.context = context - self.offset = offset - self.limit = limit - self.first = first - self.previous = previous - self.next = next - self.profile_templates = profile_templates + self.value = value + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateList': - """Initialize a TrustedProfileTemplateList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecretsIdpSigningItem': + """Initialize a UpdateIdPRequestSecretsIdpSigningItem object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (offset := _dict.get('offset')) is not None: - args['offset'] = offset - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - if (first := _dict.get('first')) is not None: - args['first'] = first - if (previous := _dict.get('previous')) is not None: - args['previous'] = previous - if (next := _dict.get('next')) is not None: - args['next'] = next - if (profile_templates := _dict.get('profile_templates')) is not None: - args['profile_templates'] = [TrustedProfileTemplateResponse.from_dict(v) for v in profile_templates] - else: - raise ValueError('Required property \'profile_templates\' not present in TrustedProfileTemplateList JSON') + if (value := _dict.get('value')) is not None: + args['value'] = value + if (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfileTemplateList object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecretsIdpSigningItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'offset') and self.offset is not None: - _dict['offset'] = self.offset - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first - if hasattr(self, 'previous') and self.previous is not None: - _dict['previous'] = self.previous - if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next - if hasattr(self, 'profile_templates') and self.profile_templates is not None: - profile_templates_list = [] - for v in self.profile_templates: - if isinstance(v, dict): - profile_templates_list.append(v) - else: - profile_templates_list.append(v.to_dict()) - _dict['profile_templates'] = profile_templates_list + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -14985,226 +18920,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfileTemplateList object.""" + """Return a `str` version of this UpdateIdPRequestSecretsIdpSigningItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfileTemplateList') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecretsIdpSigningItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TrustedProfileTemplateList') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecretsIdpSigningItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + Certificate type. + """ -class TrustedProfileTemplateResponse: - """ - Response body format for Trusted Profile Template REST requests. - - :param str id: ID of the the template. - :param int version: Version of the the template. - :param str account_id: ID of the account where the template resides. - :param str name: The name of the trusted profile template. This is visible only - in the enterprise account. - :param str description: (optional) The description of the trusted profile - template. Describe the template for enterprise account users. - :param bool committed: (optional) Committed flag determines if the template is - ready for assignment. - :param TemplateProfileComponentResponse profile: (optional) Input body - parameters for the TemplateProfileComponent. - :param List[PolicyTemplateReference] policy_template_references: (optional) - Existing policy templates that you can reference to assign access in the trusted - profile component. - :param ActionControls action_controls: (optional) - :param List[EnityHistoryRecord] history: (optional) History of the trusted - profile template. - :param str entity_tag: (optional) Entity tag for this templateId-version - combination. - :param str crn: (optional) Cloud resource name. - :param str created_at: (optional) Timestamp of when the template was created. - :param str created_by_id: (optional) IAMid of the creator. - :param str last_modified_at: (optional) Timestamp of when the template was last - modified. - :param str last_modified_by_id: (optional) IAMid of the identity that made the - latest modification. + PRIMARY = 'primary' + SECONDARY = 'secondary' + + +class UpdateIdPRequestSecretsSp: + """ + Service Provider secrets. + + :param List[UpdateIdPRequestSecretsSpSigningItem] signing: (optional) SP signing + certificates. """ def __init__( self, - id: str, - version: int, - account_id: str, - name: str, *, - description: Optional[str] = None, - committed: Optional[bool] = None, - profile: Optional['TemplateProfileComponentResponse'] = None, - policy_template_references: Optional[List['PolicyTemplateReference']] = None, - action_controls: Optional['ActionControls'] = None, - history: Optional[List['EnityHistoryRecord']] = None, - entity_tag: Optional[str] = None, - crn: Optional[str] = None, - created_at: Optional[str] = None, - created_by_id: Optional[str] = None, - last_modified_at: Optional[str] = None, - last_modified_by_id: Optional[str] = None, + signing: Optional[List['UpdateIdPRequestSecretsSpSigningItem']] = None, ) -> None: """ - Initialize a TrustedProfileTemplateResponse object. + Initialize a UpdateIdPRequestSecretsSp object. - :param str id: ID of the the template. - :param int version: Version of the the template. - :param str account_id: ID of the account where the template resides. - :param str name: The name of the trusted profile template. This is visible - only in the enterprise account. - :param str description: (optional) The description of the trusted profile - template. Describe the template for enterprise account users. - :param bool committed: (optional) Committed flag determines if the template - is ready for assignment. - :param TemplateProfileComponentResponse profile: (optional) Input body - parameters for the TemplateProfileComponent. - :param List[PolicyTemplateReference] policy_template_references: (optional) - Existing policy templates that you can reference to assign access in the - trusted profile component. - :param ActionControls action_controls: (optional) - :param List[EnityHistoryRecord] history: (optional) History of the trusted - profile template. - :param str entity_tag: (optional) Entity tag for this templateId-version - combination. - :param str crn: (optional) Cloud resource name. - :param str created_at: (optional) Timestamp of when the template was - created. - :param str created_by_id: (optional) IAMid of the creator. - :param str last_modified_at: (optional) Timestamp of when the template was - last modified. - :param str last_modified_by_id: (optional) IAMid of the identity that made - the latest modification. + :param List[UpdateIdPRequestSecretsSpSigningItem] signing: (optional) SP + signing certificates. """ - self.id = id - self.version = version - self.account_id = account_id - self.name = name - self.description = description - self.committed = committed - self.profile = profile - self.policy_template_references = policy_template_references - self.action_controls = action_controls - self.history = history - self.entity_tag = entity_tag - self.crn = crn - self.created_at = created_at - self.created_by_id = created_by_id - self.last_modified_at = last_modified_at - self.last_modified_by_id = last_modified_by_id + self.signing = signing @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileTemplateResponse': - """Initialize a TrustedProfileTemplateResponse object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecretsSp': + """Initialize a UpdateIdPRequestSecretsSp object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in TrustedProfileTemplateResponse JSON') - if (version := _dict.get('version')) is not None: - args['version'] = version - else: - raise ValueError('Required property \'version\' not present in TrustedProfileTemplateResponse JSON') - if (account_id := _dict.get('account_id')) is not None: - args['account_id'] = account_id - else: - raise ValueError('Required property \'account_id\' not present in TrustedProfileTemplateResponse JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in TrustedProfileTemplateResponse JSON') - if (description := _dict.get('description')) is not None: - args['description'] = description - if (committed := _dict.get('committed')) is not None: - args['committed'] = committed - if (profile := _dict.get('profile')) is not None: - args['profile'] = TemplateProfileComponentResponse.from_dict(profile) - if (policy_template_references := _dict.get('policy_template_references')) is not None: - args['policy_template_references'] = [ - PolicyTemplateReference.from_dict(v) for v in policy_template_references - ] - if (action_controls := _dict.get('action_controls')) is not None: - args['action_controls'] = ActionControls.from_dict(action_controls) - if (history := _dict.get('history')) is not None: - args['history'] = [EnityHistoryRecord.from_dict(v) for v in history] - if (entity_tag := _dict.get('entity_tag')) is not None: - args['entity_tag'] = entity_tag - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = created_at - if (created_by_id := _dict.get('created_by_id')) is not None: - args['created_by_id'] = created_by_id - if (last_modified_at := _dict.get('last_modified_at')) is not None: - args['last_modified_at'] = last_modified_at - if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None: - args['last_modified_by_id'] = last_modified_by_id + if (signing := _dict.get('signing')) is not None: + args['signing'] = [UpdateIdPRequestSecretsSpSigningItem.from_dict(v) for v in signing] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfileTemplateResponse object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecretsSp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'version') and self.version is not None: - _dict['version'] = self.version - if hasattr(self, 'account_id') and self.account_id is not None: - _dict['account_id'] = self.account_id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'description') and self.description is not None: - _dict['description'] = self.description - if hasattr(self, 'committed') and self.committed is not None: - _dict['committed'] = self.committed - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'policy_template_references') and self.policy_template_references is not None: - policy_template_references_list = [] - for v in self.policy_template_references: - if isinstance(v, dict): - policy_template_references_list.append(v) - else: - policy_template_references_list.append(v.to_dict()) - _dict['policy_template_references'] = policy_template_references_list - if hasattr(self, 'action_controls') and self.action_controls is not None: - if isinstance(self.action_controls, dict): - _dict['action_controls'] = self.action_controls - else: - _dict['action_controls'] = self.action_controls.to_dict() - if hasattr(self, 'history') and self.history is not None: - history_list = [] - for v in self.history: + if hasattr(self, 'signing') and self.signing is not None: + signing_list = [] + for v in self.signing: if isinstance(v, dict): - history_list.append(v) + signing_list.append(v) else: - history_list.append(v.to_dict()) - _dict['history'] = history_list - if hasattr(self, 'entity_tag') and self.entity_tag is not None: - _dict['entity_tag'] = self.entity_tag - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = self.created_at - if hasattr(self, 'created_by_id') and self.created_by_id is not None: - _dict['created_by_id'] = self.created_by_id - if hasattr(self, 'last_modified_at') and self.last_modified_at is not None: - _dict['last_modified_at'] = self.last_modified_at - if hasattr(self, 'last_modified_by_id') and self.last_modified_by_id is not None: - _dict['last_modified_by_id'] = self.last_modified_by_id + signing_list.append(v.to_dict()) + _dict['signing'] = signing_list return _dict def _to_dict(self): @@ -15212,125 +18994,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfileTemplateResponse object.""" + """Return a `str` version of this UpdateIdPRequestSecretsSp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfileTemplateResponse') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecretsSp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TrustedProfileTemplateResponse') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecretsSp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TrustedProfilesList: +class UpdateIdPRequestSecretsSpSigningItem: """ - Response body format for the List trusted profiles V1 REST request. + UpdateIdPRequestSecretsSpSigningItem. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 items - per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is available. - :param str next: (optional) Link to the next available page. If 'next' property - is not part of the response no next page is available. - :param List[TrustedProfile] profiles: List of trusted profiles. + :param str certificate_value: (optional) Certificate value in PEM format. + :param str key_value: (optional) Private key value. + :param str key_encoding: (optional) Key encoding format (e.g., pkcs8). + :param str type: (optional) Certificate type. """ def __init__( self, - profiles: List['TrustedProfile'], *, - context: Optional['ResponseContext'] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, - first: Optional[str] = None, - previous: Optional[str] = None, - next: Optional[str] = None, + certificate_value: Optional[str] = None, + key_value: Optional[str] = None, + key_encoding: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ - Initialize a TrustedProfilesList object. + Initialize a UpdateIdPRequestSecretsSpSigningItem object. - :param List[TrustedProfile] profiles: List of trusted profiles. - :param ResponseContext context: (optional) Context with key properties for - problem determination. - :param int offset: (optional) The offset of the current page. - :param int limit: (optional) Optional size of a single page. Default is 20 - items per page. Valid range is 1 to 100. - :param str first: (optional) Link to the first page. - :param str previous: (optional) Link to the previous available page. If - 'previous' property is not part of the response no previous page is - available. - :param str next: (optional) Link to the next available page. If 'next' - property is not part of the response no next page is available. + :param str certificate_value: (optional) Certificate value in PEM format. + :param str key_value: (optional) Private key value. + :param str key_encoding: (optional) Key encoding format (e.g., pkcs8). + :param str type: (optional) Certificate type. """ - self.context = context - self.offset = offset - self.limit = limit - self.first = first - self.previous = previous - self.next = next - self.profiles = profiles + self.certificate_value = certificate_value + self.key_value = key_value + self.key_encoding = key_encoding + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfilesList': - """Initialize a TrustedProfilesList object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'UpdateIdPRequestSecretsSpSigningItem': + """Initialize a UpdateIdPRequestSecretsSpSigningItem object from a json dictionary.""" args = {} - if (context := _dict.get('context')) is not None: - args['context'] = ResponseContext.from_dict(context) - if (offset := _dict.get('offset')) is not None: - args['offset'] = offset - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - if (first := _dict.get('first')) is not None: - args['first'] = first - if (previous := _dict.get('previous')) is not None: - args['previous'] = previous - if (next := _dict.get('next')) is not None: - args['next'] = next - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [TrustedProfile.from_dict(v) for v in profiles] - else: - raise ValueError('Required property \'profiles\' not present in TrustedProfilesList JSON') + if (certificate_value := _dict.get('certificate_value')) is not None: + args['certificate_value'] = certificate_value + if (key_value := _dict.get('key_value')) is not None: + args['key_value'] = key_value + if (key_encoding := _dict.get('key_encoding')) is not None: + args['key_encoding'] = key_encoding + if (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfilesList object from a json dictionary.""" + """Initialize a UpdateIdPRequestSecretsSpSigningItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'context') and self.context is not None: - if isinstance(self.context, dict): - _dict['context'] = self.context - else: - _dict['context'] = self.context.to_dict() - if hasattr(self, 'offset') and self.offset is not None: - _dict['offset'] = self.offset - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first - if hasattr(self, 'previous') and self.previous is not None: - _dict['previous'] = self.previous - if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + if hasattr(self, 'certificate_value') and self.certificate_value is not None: + _dict['certificate_value'] = self.certificate_value + if hasattr(self, 'key_value') and self.key_value is not None: + _dict['key_value'] = self.key_value + if hasattr(self, 'key_encoding') and self.key_encoding is not None: + _dict['key_encoding'] = self.key_encoding + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -15338,19 +19076,27 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfilesList object.""" + """Return a `str` version of this UpdateIdPRequestSecretsSpSigningItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfilesList') -> bool: + def __eq__(self, other: 'UpdateIdPRequestSecretsSpSigningItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TrustedProfilesList') -> bool: + def __ne__(self, other: 'UpdateIdPRequestSecretsSpSigningItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + Certificate type. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + class UserActivity: """ diff --git a/test/integration/test_iam_identity_v1.py b/test/integration/test_iam_identity_v1.py index 821fadd7..74a7a802 100644 --- a/test/integration/test_iam_identity_v1.py +++ b/test/integration/test_iam_identity_v1.py @@ -69,6 +69,9 @@ account_settings_template_assignment_id = None account_settings_template_assignment_etag = None +idp_id = None +idp_etag = None + iam_id_for_preferences = None @@ -2102,6 +2105,234 @@ def test_delete_account_settings_template(self): ) assert delete_response.get_status_code() == 204 + @needscredentials + def test_create_idp(self): + create_idp_request_properties_idp_model = { + 'entity_id': 'http://www.okta.com/abcdefg', + 'redirect_binding_url': 'https://trial-12345.okta.com/app/trial-6789/abcdefg/sso/saml', + 'want_request_signed': True, + } + + create_idp_request_properties_sp_model = { + 'want_assertion_signed': True, + 'want_response_signed': True, + 'encrypt_response': True, + 'idp_initiated_login_enabled': True, + 'logout_url_enabled_when_available': True, + } + + create_idp_request_properties_model = { + 'idp': create_idp_request_properties_idp_model, + 'sp': create_idp_request_properties_sp_model, + } + + create_idp_request_secrets_model = { + 'idp': {}, + 'sp': {}, + } + + create_idp_response = self.iam_identity_service.create_idp( + account_id=self.account_id, + name='Python-SDK-IT-IdP', + type='saml', + active=True, + properties=create_idp_request_properties_model, + secrets=create_idp_request_secrets_model, + ) + + assert create_idp_response.get_status_code() == 201 + idp = create_idp_response.get_result() + assert idp is not None + print('\ncreate_idp() response: ', json.dumps(idp, indent=2)) + + global idp_id + idp_id = idp['idp_id'] + assert idp_id is not None + + @needscredentials + def test_list_idps(self): + list_idps_response = self.iam_identity_service.list_idps( + account_id=self.account_id, + ) + + assert list_idps_response.get_status_code() == 200 + list_idps_result = list_idps_response.get_result() + assert list_idps_result is not None + print('\nlist_idps() response: ', json.dumps(list_idps_result, indent=2)) + + @needscredentials + def test_get_idp(self): + assert idp_id is not None + + get_idp_response = self.iam_identity_service.get_idp( + idp_id=idp_id, + ) + + assert get_idp_response.get_status_code() == 200 + idp = get_idp_response.get_result() + assert idp is not None + print('\nget_idp() response: ', json.dumps(idp, indent=2)) + + global idp_etag + idp_etag = get_idp_response.get_headers()['Etag'] + assert idp_etag is not None + + @needscredentials + def test_update_idp(self): + assert idp_id is not None + assert idp_etag is not None + + update_idp_request_properties_idp_model = { + 'entity_id': 'http://www.okta.com/abcdefgijk', + 'redirect_binding_url': 'https://trial-12345.okta.com/app/trial-6789/abcdefgijk/sso/saml', + 'want_request_signed': False, + } + + update_idp_request_properties_sp_model = { + 'want_assertion_signed': False, + 'want_response_signed': False, + 'encrypt_response': True, + 'idp_initiated_login_enabled': False, + 'logout_url_enabled_when_available': True, + } + + update_idp_request_properties_model = { + 'idp': update_idp_request_properties_idp_model, + 'sp': update_idp_request_properties_sp_model, + } + + update_idp_response = self.iam_identity_service.update_idp( + idp_id=idp_id, + if_match=idp_etag, + ui_setup_completed=True, + active=True, + properties=update_idp_request_properties_model, + force_share_scope_update=True, + ) + + assert update_idp_response.get_status_code() == 200 + idp = update_idp_response.get_result() + assert idp is not None + print('\nupdate_idp() response: ', json.dumps(idp, indent=2)) + + @needscredentials + def test_list_consumer_accounts(self): + assert idp_id is not None + + list_consumer_accounts_response = self.iam_identity_service.list_consumer_accounts( + idp_id=idp_id, + ) + + assert list_consumer_accounts_response.get_status_code() == 200 + consumers_response = list_consumer_accounts_response.get_result() + assert consumers_response is not None + print('\nlist_consumer_accounts() response: ', json.dumps(consumers_response, indent=2)) + + @needscredentials + def test_get_login_settings(self): + get_login_settings_response = self.iam_identity_service.get_login_settings( + account_id=self.account_id, + ) + + assert get_login_settings_response.get_status_code() == 200 + account_login_settings = get_login_settings_response.get_result() + assert account_login_settings is not None + print('\nget_login_settings() response: ', json.dumps(account_login_settings, indent=2)) + + @needscredentials + def test_update_login_settings(self): + update_login_settings_response = self.iam_identity_service.update_login_settings( + account_id=self.account_id, + alias='my_alias_update_test', + ) + + assert update_login_settings_response.get_status_code() == 200 + account_login_settings = update_login_settings_response.get_result() + assert account_login_settings is not None + print('\nupdate_login_settings() response: ', json.dumps(account_login_settings, indent=2)) + + @needscredentials + def test_list_idp_settings(self): + list_id_p_settings_response = self.iam_identity_service.list_id_p_settings( + account_id=self.account_id, + type='consumable', + include_idp_metadata='true', + ) + + assert list_id_p_settings_response.get_status_code() == 200 + list_id_p_settings_result = list_id_p_settings_response.get_result() + assert list_id_p_settings_result is not None + print('\nlist_id_p_settings() response: ', json.dumps(list_id_p_settings_result, indent=2)) + + @needscredentials + def test_add_idp_setting(self): + assert idp_id is not None + + add_id_p_setting_response = self.iam_identity_service.add_id_p_setting( + account_id=self.account_id, + idp_id=idp_id, + cloud_user_strategy='STATIC', + active=True, + ui_default=True, + ) + + assert add_id_p_setting_response.get_status_code() == 200 + account_idp_settings = add_id_p_setting_response.get_result() + assert account_idp_settings is not None + print('\nadd_id_p_setting() response: ', json.dumps(account_idp_settings, indent=2)) + + @needscredentials + def test_get_idp_setting(self): + assert idp_id is not None + + get_id_p_setting_response = self.iam_identity_service.get_id_p_setting( + account_id=self.account_id, + idp_id=idp_id, + ) + + assert get_id_p_setting_response.get_status_code() == 200 + account_idp_settings = get_id_p_setting_response.get_result() + assert account_idp_settings is not None + print('\nget_id_p_setting() response: ', json.dumps(account_idp_settings, indent=2)) + + @needscredentials + def test_update_idp_setting(self): + assert idp_id is not None + + update_id_p_setting_response = self.iam_identity_service.update_id_p_setting( + account_id=self.account_id, + idp_id=idp_id, + cloud_user_strategy='STATIC', + active=True, + ui_default=False, + ) + + assert update_id_p_setting_response.get_status_code() == 200 + account_idp_settings = update_id_p_setting_response.get_result() + assert account_idp_settings is not None + print('\nupdate_id_p_setting() response: ', json.dumps(account_idp_settings, indent=2)) + + @needscredentials + def test_remove_idp_setting(self): + assert idp_id is not None + + remove_id_p_setting_response = self.iam_identity_service.remove_id_p_setting( + account_id=self.account_id, + idp_id=idp_id, + ) + + assert remove_id_p_setting_response.get_status_code() == 204 + + @needscredentials + def test_delete_idp(self): + assert idp_id is not None + + delete_idp_response = self.iam_identity_service.delete_idp( + idp_id=idp_id, + ) + + assert delete_idp_response.get_status_code() == 204 + @needscredentials def test_update_api_key(self): assert apikey_id1 is not None diff --git a/test/unit/test_iam_identity_v1.py b/test/unit/test_iam_identity_v1.py index 7a32cdd4..cbf321cc 100644 --- a/test/unit/test_iam_identity_v1.py +++ b/test/unit/test_iam_identity_v1.py @@ -21,12 +21,14 @@ from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime import inspect +import io import json import os import pytest import re import requests import responses +import tempfile import urllib from ibm_platform_services.iam_identity_v1 import * @@ -9936,314 +9938,3112 @@ def test_bulk_list_account_entity_consumption_value_error_with_retries(self): # End of Service: AccountLimits ############################################################################## - ############################################################################## -# Start of Model Tests +# Start of Service: IDPManagement ############################################################################## # region -class TestModel_AccessGroupCount: +class TestNewInstance: """ - Test Class for AccessGroupCount + Test Class for new_instance """ - def test_access_group_count_serialization(self): + def test_new_instance(self): """ - Test serialization/deserialization for AccessGroupCount + new_instance() """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - # Construct a json representation of a AccessGroupCount model - access_group_count_model_json = {} - access_group_count_model_json['group_id'] = 'testString' - access_group_count_model_json['count'] = 38 - - # Construct a model instance of AccessGroupCount by calling from_dict on the json representation - access_group_count_model = AccessGroupCount.from_dict(access_group_count_model_json) - assert access_group_count_model != False - - # Construct a model instance of AccessGroupCount by calling from_dict on the json representation - access_group_count_model_dict = AccessGroupCount.from_dict(access_group_count_model_json).__dict__ - access_group_count_model2 = AccessGroupCount(**access_group_count_model_dict) + service = IamIdentityV1.new_instance( + service_name='TEST_SERVICE', + ) - # Verify the model instances are equivalent - assert access_group_count_model == access_group_count_model2 + assert service is not None + assert isinstance(service, IamIdentityV1) - # Convert model instance back to dict and verify no loss of data - access_group_count_model_json2 = access_group_count_model.to_dict() - assert access_group_count_model_json2 == access_group_count_model_json + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = IamIdentityV1.new_instance( + service_name='TEST_SERVICE_NOT_FOUND', + ) -class TestModel_AccountBasedMfaEnrollment: +class TestListIdps: """ - Test Class for AccountBasedMfaEnrollment + Test Class for list_idps """ - def test_account_based_mfa_enrollment_serialization(self): + @responses.activate + def test_list_idps_all_params(self): """ - Test serialization/deserialization for AccountBasedMfaEnrollment + list_idps() """ - - # Construct dict forms of any model objects needed in order to build this model. - - mfa_enrollment_type_status_model = {} # MfaEnrollmentTypeStatus - mfa_enrollment_type_status_model['required'] = True - mfa_enrollment_type_status_model['enrolled'] = True - - # Construct a json representation of a AccountBasedMfaEnrollment model - account_based_mfa_enrollment_model_json = {} - account_based_mfa_enrollment_model_json['security_questions'] = mfa_enrollment_type_status_model - account_based_mfa_enrollment_model_json['totp'] = mfa_enrollment_type_status_model - account_based_mfa_enrollment_model_json['verisign'] = mfa_enrollment_type_status_model - account_based_mfa_enrollment_model_json['complies'] = True - - # Construct a model instance of AccountBasedMfaEnrollment by calling from_dict on the json representation - account_based_mfa_enrollment_model = AccountBasedMfaEnrollment.from_dict( - account_based_mfa_enrollment_model_json + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idps": [{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, ) - assert account_based_mfa_enrollment_model != False - # Construct a model instance of AccountBasedMfaEnrollment by calling from_dict on the json representation - account_based_mfa_enrollment_model_dict = AccountBasedMfaEnrollment.from_dict( - account_based_mfa_enrollment_model_json - ).__dict__ - account_based_mfa_enrollment_model2 = AccountBasedMfaEnrollment(**account_based_mfa_enrollment_model_dict) + # Set up parameter values + account_id = 'testString' + include_history = 'testString' - # Verify the model instances are equivalent - assert account_based_mfa_enrollment_model == account_based_mfa_enrollment_model2 + # Invoke method + response = _service.list_idps( + account_id, + include_history=include_history, + headers={}, + ) - # Convert model instance back to dict and verify no loss of data - account_based_mfa_enrollment_model_json2 = account_based_mfa_enrollment_model.to_dict() - assert account_based_mfa_enrollment_model_json2 == account_based_mfa_enrollment_model_json + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'account_id={}'.format(account_id) in query_string + assert 'include_history={}'.format(include_history) in query_string + def test_list_idps_all_params_with_retries(self): + # Enable retries and run test_list_idps_all_params. + _service.enable_retries() + self.test_list_idps_all_params() -class TestModel_AccountSettingsAssignedTemplatesSection: - """ - Test Class for AccountSettingsAssignedTemplatesSection - """ + # Disable retries and run test_list_idps_all_params. + _service.disable_retries() + self.test_list_idps_all_params() - def test_account_settings_assigned_templates_section_serialization(self): + @responses.activate + def test_list_idps_required_params(self): """ - Test serialization/deserialization for AccountSettingsAssignedTemplatesSection + test_list_idps_required_params() """ + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idps": [{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) - # Construct dict forms of any model objects needed in order to build this model. + # Set up parameter values + account_id = 'testString' - account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse - account_settings_user_mfa_response_model['iam_id'] = 'testString' - account_settings_user_mfa_response_model['mfa'] = 'NONE' - account_settings_user_mfa_response_model['name'] = 'testString' - account_settings_user_mfa_response_model['userName'] = 'testString' - account_settings_user_mfa_response_model['email'] = 'testString' - account_settings_user_mfa_response_model['description'] = 'testString' + # Invoke method + response = _service.list_idps( + account_id, + headers={}, + ) - account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction - account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model['restrict_invitation'] = True + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'account_id={}'.format(account_id) in query_string - assigned_templates_account_settings_restrict_user_domains_model = ( - {} - ) # AssignedTemplatesAccountSettingsRestrictUserDomains - assigned_templates_account_settings_restrict_user_domains_model['account_sufficient'] = True - assigned_templates_account_settings_restrict_user_domains_model['restrictions'] = [ - account_settings_user_domain_restriction_model - ] + def test_list_idps_required_params_with_retries(self): + # Enable retries and run test_list_idps_required_params. + _service.enable_retries() + self.test_list_idps_required_params() - # Construct a json representation of a AccountSettingsAssignedTemplatesSection model - account_settings_assigned_templates_section_model_json = {} - account_settings_assigned_templates_section_model_json['template_id'] = 'testString' - account_settings_assigned_templates_section_model_json['template_version'] = 26 - account_settings_assigned_templates_section_model_json['template_name'] = 'testString' - account_settings_assigned_templates_section_model_json['restrict_create_service_id'] = 'NOT_SET' - account_settings_assigned_templates_section_model_json['restrict_create_platform_apikey'] = 'NOT_SET' - account_settings_assigned_templates_section_model_json['allowed_ip_addresses'] = 'testString' - account_settings_assigned_templates_section_model_json['mfa'] = 'NONE' - account_settings_assigned_templates_section_model_json['session_expiration_in_seconds'] = '86400' - account_settings_assigned_templates_section_model_json['session_invalidation_in_seconds'] = '7200' - account_settings_assigned_templates_section_model_json['max_sessions_per_identity'] = 'testString' - account_settings_assigned_templates_section_model_json['system_access_token_expiration_in_seconds'] = '3600' - account_settings_assigned_templates_section_model_json['system_refresh_token_expiration_in_seconds'] = '259200' - account_settings_assigned_templates_section_model_json['restrict_user_list_visibility'] = 'RESTRICTED' - account_settings_assigned_templates_section_model_json['user_mfa'] = [account_settings_user_mfa_response_model] - account_settings_assigned_templates_section_model_json['restrict_user_domains'] = ( - assigned_templates_account_settings_restrict_user_domains_model - ) + # Disable retries and run test_list_idps_required_params. + _service.disable_retries() + self.test_list_idps_required_params() - # Construct a model instance of AccountSettingsAssignedTemplatesSection by calling from_dict on the json representation - account_settings_assigned_templates_section_model = AccountSettingsAssignedTemplatesSection.from_dict( - account_settings_assigned_templates_section_model_json + @responses.activate + def test_list_idps_value_error(self): + """ + test_list_idps_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idps": [{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, ) - assert account_settings_assigned_templates_section_model != False - # Construct a model instance of AccountSettingsAssignedTemplatesSection by calling from_dict on the json representation - account_settings_assigned_templates_section_model_dict = AccountSettingsAssignedTemplatesSection.from_dict( - account_settings_assigned_templates_section_model_json - ).__dict__ - account_settings_assigned_templates_section_model2 = AccountSettingsAssignedTemplatesSection( - **account_settings_assigned_templates_section_model_dict - ) + # Set up parameter values + account_id = 'testString' - # Verify the model instances are equivalent - assert account_settings_assigned_templates_section_model == account_settings_assigned_templates_section_model2 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_idps(**req_copy) - # Convert model instance back to dict and verify no loss of data - account_settings_assigned_templates_section_model_json2 = ( - account_settings_assigned_templates_section_model.to_dict() - ) - assert ( - account_settings_assigned_templates_section_model_json2 - == account_settings_assigned_templates_section_model_json - ) + def test_list_idps_value_error_with_retries(self): + # Enable retries and run test_list_idps_value_error. + _service.enable_retries() + self.test_list_idps_value_error() + + # Disable retries and run test_list_idps_value_error. + _service.disable_retries() + self.test_list_idps_value_error() -class TestModel_AccountSettingsEffectiveSection: +class TestCreateIdp: """ - Test Class for AccountSettingsEffectiveSection + Test Class for create_idp """ - def test_account_settings_effective_section_serialization(self): + @responses.activate + def test_create_idp_all_params(self): """ - Test serialization/deserialization for AccountSettingsEffectiveSection + create_idp() """ + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) - # Construct dict forms of any model objects needed in order to build this model. - - account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse - account_settings_user_mfa_response_model['iam_id'] = 'testString' - account_settings_user_mfa_response_model['mfa'] = 'NONE' - account_settings_user_mfa_response_model['name'] = 'testString' - account_settings_user_mfa_response_model['userName'] = 'testString' - account_settings_user_mfa_response_model['email'] = 'testString' - account_settings_user_mfa_response_model['description'] = 'testString' + # Construct a dict representation of a CreateIdpRequestPropertiesIdp model + create_idp_request_properties_idp_model = {} + create_idp_request_properties_idp_model['xml_import'] = True + create_idp_request_properties_idp_model['entity_id'] = 'testString' + create_idp_request_properties_idp_model['redirect_binding_url'] = 'testString' + create_idp_request_properties_idp_model['want_request_signed'] = True + create_idp_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a CreateIdpRequestPropertiesSpAuthnContext model + create_idp_request_properties_sp_authn_context_model = {} + create_idp_request_properties_sp_authn_context_model['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a CreateIdpRequestPropertiesSp model + create_idp_request_properties_sp_model = {} + create_idp_request_properties_sp_model['want_assertion_signed'] = True + create_idp_request_properties_sp_model['want_response_signed'] = True + create_idp_request_properties_sp_model['encrypt_response'] = True + create_idp_request_properties_sp_model['idp_initiated_login_enabled'] = True + create_idp_request_properties_sp_model['logout_url_enabled_when_available'] = True + create_idp_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + create_idp_request_properties_sp_model['authn_context'] = create_idp_request_properties_sp_authn_context_model + create_idp_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a CreateIdpRequestProperties model + create_idp_request_properties_model = {} + create_idp_request_properties_model['idp'] = create_idp_request_properties_idp_model + create_idp_request_properties_model['sp'] = create_idp_request_properties_sp_model + + # Construct a dict representation of a CreateIdpRequestSecretsIdpSigningItem model + create_idp_request_secrets_idp_signing_item_model = {} + create_idp_request_secrets_idp_signing_item_model['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdpEncryptingItem model + create_idp_request_secrets_idp_encrypting_item_model = {} + create_idp_request_secrets_idp_encrypting_item_model['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdp model + create_idp_request_secrets_idp_model = {} + create_idp_request_secrets_idp_model['xml_import'] = True + create_idp_request_secrets_idp_model['signing'] = [create_idp_request_secrets_idp_signing_item_model] + create_idp_request_secrets_idp_model['encrypting'] = [create_idp_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a CreateIdpRequestSecretsSpSigningItem model + create_idp_request_secrets_sp_signing_item_model = {} + create_idp_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsSp model + create_idp_request_secrets_sp_model = {} + create_idp_request_secrets_sp_model['signing'] = [create_idp_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a CreateIdpRequestSecrets model + create_idp_request_secrets_model = {} + create_idp_request_secrets_model['idp'] = create_idp_request_secrets_idp_model + create_idp_request_secrets_model['sp'] = create_idp_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' - # Construct a json representation of a AccountSettingsEffectiveSection model - account_settings_effective_section_model_json = {} - account_settings_effective_section_model_json['restrict_create_service_id'] = 'NOT_SET' - account_settings_effective_section_model_json['restrict_create_platform_apikey'] = 'NOT_SET' - account_settings_effective_section_model_json['restrict_user_list_visibility'] = 'NOT_RESTRICTED' - account_settings_effective_section_model_json['allowed_ip_addresses'] = 'testString' - account_settings_effective_section_model_json['mfa'] = 'NONE' - account_settings_effective_section_model_json['user_mfa'] = [account_settings_user_mfa_response_model] - account_settings_effective_section_model_json['session_expiration_in_seconds'] = '86400' - account_settings_effective_section_model_json['session_invalidation_in_seconds'] = '7200' - account_settings_effective_section_model_json['max_sessions_per_identity'] = 'testString' - account_settings_effective_section_model_json['system_access_token_expiration_in_seconds'] = '3600' - account_settings_effective_section_model_json['system_refresh_token_expiration_in_seconds'] = '259200' + # Set up parameter values + account_id = 'testString' + name = 'testString' + type = 'ldap' + active = True + properties = create_idp_request_properties_model + secrets = create_idp_request_secrets_model + share_scope = [share_scope_model] + automation = 'testString' - # Construct a model instance of AccountSettingsEffectiveSection by calling from_dict on the json representation - account_settings_effective_section_model = AccountSettingsEffectiveSection.from_dict( - account_settings_effective_section_model_json + # Invoke method + response = _service.create_idp( + account_id, + name, + type, + active=active, + properties=properties, + secrets=secrets, + share_scope=share_scope, + automation=automation, + headers={}, ) - assert account_settings_effective_section_model != False + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'automation={}'.format(automation) in query_string + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['account_id'] == 'testString' + assert req_body['name'] == 'testString' + assert req_body['type'] == 'ldap' + assert req_body['active'] == True + assert req_body['properties'] == create_idp_request_properties_model + assert req_body['secrets'] == create_idp_request_secrets_model + assert req_body['share_scope'] == [share_scope_model] + + def test_create_idp_all_params_with_retries(self): + # Enable retries and run test_create_idp_all_params. + _service.enable_retries() + self.test_create_idp_all_params() + + # Disable retries and run test_create_idp_all_params. + _service.disable_retries() + self.test_create_idp_all_params() + + @responses.activate + def test_create_idp_required_params(self): + """ + test_create_idp_required_params() + """ + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a CreateIdpRequestPropertiesIdp model + create_idp_request_properties_idp_model = {} + create_idp_request_properties_idp_model['xml_import'] = True + create_idp_request_properties_idp_model['entity_id'] = 'testString' + create_idp_request_properties_idp_model['redirect_binding_url'] = 'testString' + create_idp_request_properties_idp_model['want_request_signed'] = True + create_idp_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a CreateIdpRequestPropertiesSpAuthnContext model + create_idp_request_properties_sp_authn_context_model = {} + create_idp_request_properties_sp_authn_context_model['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a CreateIdpRequestPropertiesSp model + create_idp_request_properties_sp_model = {} + create_idp_request_properties_sp_model['want_assertion_signed'] = True + create_idp_request_properties_sp_model['want_response_signed'] = True + create_idp_request_properties_sp_model['encrypt_response'] = True + create_idp_request_properties_sp_model['idp_initiated_login_enabled'] = True + create_idp_request_properties_sp_model['logout_url_enabled_when_available'] = True + create_idp_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + create_idp_request_properties_sp_model['authn_context'] = create_idp_request_properties_sp_authn_context_model + create_idp_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a CreateIdpRequestProperties model + create_idp_request_properties_model = {} + create_idp_request_properties_model['idp'] = create_idp_request_properties_idp_model + create_idp_request_properties_model['sp'] = create_idp_request_properties_sp_model + + # Construct a dict representation of a CreateIdpRequestSecretsIdpSigningItem model + create_idp_request_secrets_idp_signing_item_model = {} + create_idp_request_secrets_idp_signing_item_model['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdpEncryptingItem model + create_idp_request_secrets_idp_encrypting_item_model = {} + create_idp_request_secrets_idp_encrypting_item_model['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdp model + create_idp_request_secrets_idp_model = {} + create_idp_request_secrets_idp_model['xml_import'] = True + create_idp_request_secrets_idp_model['signing'] = [create_idp_request_secrets_idp_signing_item_model] + create_idp_request_secrets_idp_model['encrypting'] = [create_idp_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a CreateIdpRequestSecretsSpSigningItem model + create_idp_request_secrets_sp_signing_item_model = {} + create_idp_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsSp model + create_idp_request_secrets_sp_model = {} + create_idp_request_secrets_sp_model['signing'] = [create_idp_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a CreateIdpRequestSecrets model + create_idp_request_secrets_model = {} + create_idp_request_secrets_model['idp'] = create_idp_request_secrets_idp_model + create_idp_request_secrets_model['sp'] = create_idp_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Set up parameter values + account_id = 'testString' + name = 'testString' + type = 'ldap' + active = True + properties = create_idp_request_properties_model + secrets = create_idp_request_secrets_model + share_scope = [share_scope_model] + + # Invoke method + response = _service.create_idp( + account_id, + name, + type, + active=active, + properties=properties, + secrets=secrets, + share_scope=share_scope, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['account_id'] == 'testString' + assert req_body['name'] == 'testString' + assert req_body['type'] == 'ldap' + assert req_body['active'] == True + assert req_body['properties'] == create_idp_request_properties_model + assert req_body['secrets'] == create_idp_request_secrets_model + assert req_body['share_scope'] == [share_scope_model] + + def test_create_idp_required_params_with_retries(self): + # Enable retries and run test_create_idp_required_params. + _service.enable_retries() + self.test_create_idp_required_params() + + # Disable retries and run test_create_idp_required_params. + _service.disable_retries() + self.test_create_idp_required_params() + + @responses.activate + def test_create_idp_value_error(self): + """ + test_create_idp_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a CreateIdpRequestPropertiesIdp model + create_idp_request_properties_idp_model = {} + create_idp_request_properties_idp_model['xml_import'] = True + create_idp_request_properties_idp_model['entity_id'] = 'testString' + create_idp_request_properties_idp_model['redirect_binding_url'] = 'testString' + create_idp_request_properties_idp_model['want_request_signed'] = True + create_idp_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a CreateIdpRequestPropertiesSpAuthnContext model + create_idp_request_properties_sp_authn_context_model = {} + create_idp_request_properties_sp_authn_context_model['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a CreateIdpRequestPropertiesSp model + create_idp_request_properties_sp_model = {} + create_idp_request_properties_sp_model['want_assertion_signed'] = True + create_idp_request_properties_sp_model['want_response_signed'] = True + create_idp_request_properties_sp_model['encrypt_response'] = True + create_idp_request_properties_sp_model['idp_initiated_login_enabled'] = True + create_idp_request_properties_sp_model['logout_url_enabled_when_available'] = True + create_idp_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + create_idp_request_properties_sp_model['authn_context'] = create_idp_request_properties_sp_authn_context_model + create_idp_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a CreateIdpRequestProperties model + create_idp_request_properties_model = {} + create_idp_request_properties_model['idp'] = create_idp_request_properties_idp_model + create_idp_request_properties_model['sp'] = create_idp_request_properties_sp_model + + # Construct a dict representation of a CreateIdpRequestSecretsIdpSigningItem model + create_idp_request_secrets_idp_signing_item_model = {} + create_idp_request_secrets_idp_signing_item_model['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdpEncryptingItem model + create_idp_request_secrets_idp_encrypting_item_model = {} + create_idp_request_secrets_idp_encrypting_item_model['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsIdp model + create_idp_request_secrets_idp_model = {} + create_idp_request_secrets_idp_model['xml_import'] = True + create_idp_request_secrets_idp_model['signing'] = [create_idp_request_secrets_idp_signing_item_model] + create_idp_request_secrets_idp_model['encrypting'] = [create_idp_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a CreateIdpRequestSecretsSpSigningItem model + create_idp_request_secrets_sp_signing_item_model = {} + create_idp_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a CreateIdpRequestSecretsSp model + create_idp_request_secrets_sp_model = {} + create_idp_request_secrets_sp_model['signing'] = [create_idp_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a CreateIdpRequestSecrets model + create_idp_request_secrets_model = {} + create_idp_request_secrets_model['idp'] = create_idp_request_secrets_idp_model + create_idp_request_secrets_model['sp'] = create_idp_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Set up parameter values + account_id = 'testString' + name = 'testString' + type = 'ldap' + active = True + properties = create_idp_request_properties_model + secrets = create_idp_request_secrets_model + share_scope = [share_scope_model] + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "name": name, + "type": type, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_idp(**req_copy) + + def test_create_idp_value_error_with_retries(self): + # Enable retries and run test_create_idp_value_error. + _service.enable_retries() + self.test_create_idp_value_error() + + # Disable retries and run test_create_idp_value_error. + _service.disable_retries() + self.test_create_idp_value_error() + + +class TestGetIdp: + """ + Test Class for get_idp + """ + + @responses.activate + def test_get_idp_all_params(self): + """ + get_idp() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + include_history = 'testString' + + # Invoke method + response = _service.get_idp( + idp_id, + include_history=include_history, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'include_history={}'.format(include_history) in query_string + + def test_get_idp_all_params_with_retries(self): + # Enable retries and run test_get_idp_all_params. + _service.enable_retries() + self.test_get_idp_all_params() + + # Disable retries and run test_get_idp_all_params. + _service.disable_retries() + self.test_get_idp_all_params() + + @responses.activate + def test_get_idp_required_params(self): + """ + test_get_idp_required_params() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.get_idp( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_idp_required_params_with_retries(self): + # Enable retries and run test_get_idp_required_params. + _service.enable_retries() + self.test_get_idp_required_params() + + # Disable retries and run test_get_idp_required_params. + _service.disable_retries() + self.test_get_idp_required_params() + + @responses.activate + def test_get_idp_value_error(self): + """ + test_get_idp_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_idp(**req_copy) + + def test_get_idp_value_error_with_retries(self): + # Enable retries and run test_get_idp_value_error. + _service.enable_retries() + self.test_get_idp_value_error() + + # Disable retries and run test_get_idp_value_error. + _service.disable_retries() + self.test_get_idp_value_error() + + +class TestUpdateIdp: + """ + Test Class for update_idp + """ + + @responses.activate + def test_update_idp_all_params(self): + """ + update_idp() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a UpdateIdPRequestPropertiesIdp model + update_id_p_request_properties_idp_model = {} + update_id_p_request_properties_idp_model['entity_id'] = 'testString' + update_id_p_request_properties_idp_model['redirect_binding_url'] = 'testString' + update_id_p_request_properties_idp_model['want_request_signed'] = True + update_id_p_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a UpdateIdPRequestPropertiesSpAuthnContext model + update_id_p_request_properties_sp_authn_context_model = {} + update_id_p_request_properties_sp_authn_context_model['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a UpdateIdPRequestPropertiesSp model + update_id_p_request_properties_sp_model = {} + update_id_p_request_properties_sp_model['want_assertion_signed'] = True + update_id_p_request_properties_sp_model['want_response_signed'] = True + update_id_p_request_properties_sp_model['encrypt_response'] = True + update_id_p_request_properties_sp_model['idp_initiated_login_enabled'] = True + update_id_p_request_properties_sp_model['logout_url_enabled_when_available'] = True + update_id_p_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + update_id_p_request_properties_sp_model['authn_context'] = update_id_p_request_properties_sp_authn_context_model + update_id_p_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a UpdateIdPRequestProperties model + update_id_p_request_properties_model = {} + update_id_p_request_properties_model['idp'] = update_id_p_request_properties_idp_model + update_id_p_request_properties_model['sp'] = update_id_p_request_properties_sp_model + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpSigningItem model + update_id_p_request_secrets_idp_signing_item_model = {} + update_id_p_request_secrets_idp_signing_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpEncryptingItem model + update_id_p_request_secrets_idp_encrypting_item_model = {} + update_id_p_request_secrets_idp_encrypting_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdp model + update_id_p_request_secrets_idp_model = {} + update_id_p_request_secrets_idp_model['signing'] = [update_id_p_request_secrets_idp_signing_item_model] + update_id_p_request_secrets_idp_model['encrypting'] = [update_id_p_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecretsSpSigningItem model + update_id_p_request_secrets_sp_signing_item_model = {} + update_id_p_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsSp model + update_id_p_request_secrets_sp_model = {} + update_id_p_request_secrets_sp_model['signing'] = [update_id_p_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecrets model + update_id_p_request_secrets_model = {} + update_id_p_request_secrets_model['idp'] = update_id_p_request_secrets_idp_model + update_id_p_request_secrets_model['sp'] = update_id_p_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Set up parameter values + idp_id = 'testString' + if_match = 'testString' + ui_setup_completed = True + name = 'testString' + active = True + properties = update_id_p_request_properties_model + secrets = update_id_p_request_secrets_model + share_scope = [share_scope_model] + force_share_scope_update = True + + # Invoke method + response = _service.update_idp( + idp_id, + if_match, + ui_setup_completed=ui_setup_completed, + name=name, + active=active, + properties=properties, + secrets=secrets, + share_scope=share_scope, + force_share_scope_update=force_share_scope_update, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'force_share_scope_update={}'.format('true' if force_share_scope_update else 'false') in query_string + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['ui_setup_completed'] == True + assert req_body['name'] == 'testString' + assert req_body['active'] == True + assert req_body['properties'] == update_id_p_request_properties_model + assert req_body['secrets'] == update_id_p_request_secrets_model + assert req_body['share_scope'] == [share_scope_model] + + def test_update_idp_all_params_with_retries(self): + # Enable retries and run test_update_idp_all_params. + _service.enable_retries() + self.test_update_idp_all_params() + + # Disable retries and run test_update_idp_all_params. + _service.disable_retries() + self.test_update_idp_all_params() + + @responses.activate + def test_update_idp_required_params(self): + """ + test_update_idp_required_params() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a UpdateIdPRequestPropertiesIdp model + update_id_p_request_properties_idp_model = {} + update_id_p_request_properties_idp_model['entity_id'] = 'testString' + update_id_p_request_properties_idp_model['redirect_binding_url'] = 'testString' + update_id_p_request_properties_idp_model['want_request_signed'] = True + update_id_p_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a UpdateIdPRequestPropertiesSpAuthnContext model + update_id_p_request_properties_sp_authn_context_model = {} + update_id_p_request_properties_sp_authn_context_model['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a UpdateIdPRequestPropertiesSp model + update_id_p_request_properties_sp_model = {} + update_id_p_request_properties_sp_model['want_assertion_signed'] = True + update_id_p_request_properties_sp_model['want_response_signed'] = True + update_id_p_request_properties_sp_model['encrypt_response'] = True + update_id_p_request_properties_sp_model['idp_initiated_login_enabled'] = True + update_id_p_request_properties_sp_model['logout_url_enabled_when_available'] = True + update_id_p_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + update_id_p_request_properties_sp_model['authn_context'] = update_id_p_request_properties_sp_authn_context_model + update_id_p_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a UpdateIdPRequestProperties model + update_id_p_request_properties_model = {} + update_id_p_request_properties_model['idp'] = update_id_p_request_properties_idp_model + update_id_p_request_properties_model['sp'] = update_id_p_request_properties_sp_model + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpSigningItem model + update_id_p_request_secrets_idp_signing_item_model = {} + update_id_p_request_secrets_idp_signing_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpEncryptingItem model + update_id_p_request_secrets_idp_encrypting_item_model = {} + update_id_p_request_secrets_idp_encrypting_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdp model + update_id_p_request_secrets_idp_model = {} + update_id_p_request_secrets_idp_model['signing'] = [update_id_p_request_secrets_idp_signing_item_model] + update_id_p_request_secrets_idp_model['encrypting'] = [update_id_p_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecretsSpSigningItem model + update_id_p_request_secrets_sp_signing_item_model = {} + update_id_p_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsSp model + update_id_p_request_secrets_sp_model = {} + update_id_p_request_secrets_sp_model['signing'] = [update_id_p_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecrets model + update_id_p_request_secrets_model = {} + update_id_p_request_secrets_model['idp'] = update_id_p_request_secrets_idp_model + update_id_p_request_secrets_model['sp'] = update_id_p_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Set up parameter values + idp_id = 'testString' + if_match = 'testString' + ui_setup_completed = True + name = 'testString' + active = True + properties = update_id_p_request_properties_model + secrets = update_id_p_request_secrets_model + share_scope = [share_scope_model] + + # Invoke method + response = _service.update_idp( + idp_id, + if_match, + ui_setup_completed=ui_setup_completed, + name=name, + active=active, + properties=properties, + secrets=secrets, + share_scope=share_scope, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['ui_setup_completed'] == True + assert req_body['name'] == 'testString' + assert req_body['active'] == True + assert req_body['properties'] == update_id_p_request_properties_model + assert req_body['secrets'] == update_id_p_request_secrets_model + assert req_body['share_scope'] == [share_scope_model] + + def test_update_idp_required_params_with_retries(self): + # Enable retries and run test_update_idp_required_params. + _service.enable_retries() + self.test_update_idp_required_params() + + # Disable retries and run test_update_idp_required_params. + _service.disable_retries() + self.test_update_idp_required_params() + + @responses.activate + def test_update_idp_value_error(self): + """ + test_update_idp_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "share_scope": [{"id": "id", "type": "account"}], "active": true, "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a UpdateIdPRequestPropertiesIdp model + update_id_p_request_properties_idp_model = {} + update_id_p_request_properties_idp_model['entity_id'] = 'testString' + update_id_p_request_properties_idp_model['redirect_binding_url'] = 'testString' + update_id_p_request_properties_idp_model['want_request_signed'] = True + update_id_p_request_properties_idp_model['logout_url'] = 'testString' + + # Construct a dict representation of a UpdateIdPRequestPropertiesSpAuthnContext model + update_id_p_request_properties_sp_authn_context_model = {} + update_id_p_request_properties_sp_authn_context_model['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a dict representation of a UpdateIdPRequestPropertiesSp model + update_id_p_request_properties_sp_model = {} + update_id_p_request_properties_sp_model['want_assertion_signed'] = True + update_id_p_request_properties_sp_model['want_response_signed'] = True + update_id_p_request_properties_sp_model['encrypt_response'] = True + update_id_p_request_properties_sp_model['idp_initiated_login_enabled'] = True + update_id_p_request_properties_sp_model['logout_url_enabled_when_available'] = True + update_id_p_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + update_id_p_request_properties_sp_model['authn_context'] = update_id_p_request_properties_sp_authn_context_model + update_id_p_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a dict representation of a UpdateIdPRequestProperties model + update_id_p_request_properties_model = {} + update_id_p_request_properties_model['idp'] = update_id_p_request_properties_idp_model + update_id_p_request_properties_model['sp'] = update_id_p_request_properties_sp_model + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpSigningItem model + update_id_p_request_secrets_idp_signing_item_model = {} + update_id_p_request_secrets_idp_signing_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdpEncryptingItem model + update_id_p_request_secrets_idp_encrypting_item_model = {} + update_id_p_request_secrets_idp_encrypting_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsIdp model + update_id_p_request_secrets_idp_model = {} + update_id_p_request_secrets_idp_model['signing'] = [update_id_p_request_secrets_idp_signing_item_model] + update_id_p_request_secrets_idp_model['encrypting'] = [update_id_p_request_secrets_idp_encrypting_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecretsSpSigningItem model + update_id_p_request_secrets_sp_signing_item_model = {} + update_id_p_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a dict representation of a UpdateIdPRequestSecretsSp model + update_id_p_request_secrets_sp_model = {} + update_id_p_request_secrets_sp_model['signing'] = [update_id_p_request_secrets_sp_signing_item_model] + + # Construct a dict representation of a UpdateIdPRequestSecrets model + update_id_p_request_secrets_model = {} + update_id_p_request_secrets_model['idp'] = update_id_p_request_secrets_idp_model + update_id_p_request_secrets_model['sp'] = update_id_p_request_secrets_sp_model + + # Construct a dict representation of a ShareScope model + share_scope_model = {} + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Set up parameter values + idp_id = 'testString' + if_match = 'testString' + ui_setup_completed = True + name = 'testString' + active = True + properties = update_id_p_request_properties_model + secrets = update_id_p_request_secrets_model + share_scope = [share_scope_model] + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + "if_match": if_match, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_idp(**req_copy) + + def test_update_idp_value_error_with_retries(self): + # Enable retries and run test_update_idp_value_error. + _service.enable_retries() + self.test_update_idp_value_error() + + # Disable retries and run test_update_idp_value_error. + _service.disable_retries() + self.test_update_idp_value_error() + + +class TestDeleteIdp: + """ + Test Class for delete_idp + """ + + @responses.activate + def test_delete_idp_all_params(self): + """ + delete_idp() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + responses.add( + responses.DELETE, + url, + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.delete_idp( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_delete_idp_all_params_with_retries(self): + # Enable retries and run test_delete_idp_all_params. + _service.enable_retries() + self.test_delete_idp_all_params() + + # Disable retries and run test_delete_idp_all_params. + _service.disable_retries() + self.test_delete_idp_all_params() + + @responses.activate + def test_delete_idp_value_error(self): + """ + test_delete_idp_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString') + responses.add( + responses.DELETE, + url, + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_idp(**req_copy) + + def test_delete_idp_value_error_with_retries(self): + # Enable retries and run test_delete_idp_value_error. + _service.enable_retries() + self.test_delete_idp_value_error() + + # Disable retries and run test_delete_idp_value_error. + _service.disable_retries() + self.test_delete_idp_value_error() + + +class TestListConsumerAccounts: + """ + Test Class for list_consumer_accounts + """ + + @responses.activate + def test_list_consumer_accounts_all_params(self): + """ + list_consumer_accounts() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/consumers') + mock_response = '{"idp_id": "idp_id", "consumers": [{"account_id": "account_id", "share_scope": [{"id": "id", "type": "account"}]}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.list_consumer_accounts( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_consumer_accounts_all_params_with_retries(self): + # Enable retries and run test_list_consumer_accounts_all_params. + _service.enable_retries() + self.test_list_consumer_accounts_all_params() + + # Disable retries and run test_list_consumer_accounts_all_params. + _service.disable_retries() + self.test_list_consumer_accounts_all_params() + + @responses.activate + def test_list_consumer_accounts_value_error(self): + """ + test_list_consumer_accounts_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/consumers') + mock_response = '{"idp_id": "idp_id", "consumers": [{"account_id": "account_id", "share_scope": [{"id": "id", "type": "account"}]}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_consumer_accounts(**req_copy) + + def test_list_consumer_accounts_value_error_with_retries(self): + # Enable retries and run test_list_consumer_accounts_value_error. + _service.enable_retries() + self.test_list_consumer_accounts_value_error() + + # Disable retries and run test_list_consumer_accounts_value_error. + _service.disable_retries() + self.test_list_consumer_accounts_value_error() + + +class TestExportSamlMetadata: + """ + Test Class for export_saml_metadata + """ + + @responses.activate + def test_export_saml_metadata_all_params(self): + """ + export_saml_metadata() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/saml/metadata') + mock_response = '"\n\n \n \n \n \n \n MIIDqTCCApGgAwIBAgIDA....\n \n \n \n \n \n urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\n \n \n \n\n"' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='text/xml', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.export_saml_metadata( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_export_saml_metadata_all_params_with_retries(self): + # Enable retries and run test_export_saml_metadata_all_params. + _service.enable_retries() + self.test_export_saml_metadata_all_params() + + # Disable retries and run test_export_saml_metadata_all_params. + _service.disable_retries() + self.test_export_saml_metadata_all_params() + + @responses.activate + def test_export_saml_metadata_value_error(self): + """ + test_export_saml_metadata_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/saml/metadata') + mock_response = '"\n\n \n \n \n \n \n MIIDqTCCApGgAwIBAgIDA....\n \n \n \n \n \n urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\n \n \n \n\n"' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='text/xml', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.export_saml_metadata(**req_copy) + + def test_export_saml_metadata_value_error_with_retries(self): + # Enable retries and run test_export_saml_metadata_value_error. + _service.enable_retries() + self.test_export_saml_metadata_value_error() + + # Disable retries and run test_export_saml_metadata_value_error. + _service.disable_retries() + self.test_export_saml_metadata_value_error() + + +class TestImportSamlIdpMetadata: + """ + Test Class for import_saml_idp_metadata + """ + + @responses.activate + def test_import_saml_idp_metadata_all_params(self): + """ + import_saml_idp_metadata() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/saml/metadata') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "history": [{"anyKey": "anyValue"}], "share_scope": [{"id": "id", "type": "account"}], "active": true, "ui_setup_completed": true}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + body = io.BytesIO(b'This is a mock file.').getvalue() + parse_only = False + + # Invoke method + response = _service.import_saml_idp_metadata( + idp_id, + body, + parse_only=parse_only, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'parse_only={}'.format('true' if parse_only else 'false') in query_string + # Validate body params + assert responses.calls[0].request.body == body + + def test_import_saml_idp_metadata_all_params_with_retries(self): + # Enable retries and run test_import_saml_idp_metadata_all_params. + _service.enable_retries() + self.test_import_saml_idp_metadata_all_params() + + # Disable retries and run test_import_saml_idp_metadata_all_params. + _service.disable_retries() + self.test_import_saml_idp_metadata_all_params() + + @responses.activate + def test_import_saml_idp_metadata_required_params(self): + """ + test_import_saml_idp_metadata_required_params() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/saml/metadata') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "history": [{"anyKey": "anyValue"}], "share_scope": [{"id": "id", "type": "account"}], "active": true, "ui_setup_completed": true}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + body = io.BytesIO(b'This is a mock file.').getvalue() + + # Invoke method + response = _service.import_saml_idp_metadata( + idp_id, + body, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + assert responses.calls[0].request.body == body + + def test_import_saml_idp_metadata_required_params_with_retries(self): + # Enable retries and run test_import_saml_idp_metadata_required_params. + _service.enable_retries() + self.test_import_saml_idp_metadata_required_params() + + # Disable retries and run test_import_saml_idp_metadata_required_params. + _service.disable_retries() + self.test_import_saml_idp_metadata_required_params() + + @responses.activate + def test_import_saml_idp_metadata_value_error(self): + """ + test_import_saml_idp_metadata_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/saml/metadata') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "created_at": "2019-01-01T12:00:00.000Z", "modified_at": "2019-01-01T12:00:00.000Z", "account_id": "account_id", "name": "name", "type": "saml", "properties": {"anyKey": "anyValue"}, "secrets": {"anyKey": "anyValue"}, "history": [{"anyKey": "anyValue"}], "share_scope": [{"id": "id", "type": "account"}], "active": true, "ui_setup_completed": true}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + body = io.BytesIO(b'This is a mock file.').getvalue() + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + "body": body, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.import_saml_idp_metadata(**req_copy) + + def test_import_saml_idp_metadata_value_error_with_retries(self): + # Enable retries and run test_import_saml_idp_metadata_value_error. + _service.enable_retries() + self.test_import_saml_idp_metadata_value_error() + + # Disable retries and run test_import_saml_idp_metadata_value_error. + _service.disable_retries() + self.test_import_saml_idp_metadata_value_error() + + +class TestGetIdpTestResult: + """ + Test Class for get_idp_test_result + """ + + @responses.activate + def test_get_idp_test_result_all_params(self): + """ + get_idp_test_result() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/test') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "started_at": 10, "modified_at": "modified_at", "idp_version": "idp_version", "steps": [{"sequence": 8, "name": "name", "state": "state", "result": "result"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.get_idp_test_result( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_idp_test_result_all_params_with_retries(self): + # Enable retries and run test_get_idp_test_result_all_params. + _service.enable_retries() + self.test_get_idp_test_result_all_params() + + # Disable retries and run test_get_idp_test_result_all_params. + _service.disable_retries() + self.test_get_idp_test_result_all_params() + + @responses.activate + def test_get_idp_test_result_value_error(self): + """ + test_get_idp_test_result_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/test') + mock_response = '{"idp_id": "idp_id", "entity_tag": "entity_tag", "started_at": 10, "modified_at": "modified_at", "idp_version": "idp_version", "steps": [{"sequence": 8, "name": "name", "state": "state", "result": "result"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_idp_test_result(**req_copy) + + def test_get_idp_test_result_value_error_with_retries(self): + # Enable retries and run test_get_idp_test_result_value_error. + _service.enable_retries() + self.test_get_idp_test_result_value_error() + + # Disable retries and run test_get_idp_test_result_value_error. + _service.disable_retries() + self.test_get_idp_test_result_value_error() + + +class TestTestIdp: + """ + Test Class for test_idp + """ + + @responses.activate + def test_test_idp_all_params(self): + """ + test_idp() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/test') + mock_response = '{"result": "result", "test_url": "test_url"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Invoke method + response = _service.test_idp( + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_test_idp_all_params_with_retries(self): + # Enable retries and run test_test_idp_all_params. + _service.enable_retries() + self.test_test_idp_all_params() + + # Disable retries and run test_test_idp_all_params. + _service.disable_retries() + self.test_test_idp_all_params() + + @responses.activate + def test_test_idp_value_error(self): + """ + test_test_idp_value_error() + """ + # Set up mock + url = preprocess_url('/v1/idps/testString/test') + mock_response = '{"result": "result", "test_url": "test_url"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.test_idp(**req_copy) + + def test_test_idp_value_error_with_retries(self): + # Enable retries and run test_test_idp_value_error. + _service.enable_retries() + self.test_test_idp_value_error() + + # Disable retries and run test_test_idp_value_error. + _service.disable_retries() + self.test_test_idp_value_error() + + +# endregion +############################################################################## +# End of Service: IDPManagement +############################################################################## + +############################################################################## +# Start of Service: AccountSettingsForIdP +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = IamIdentityV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, IamIdentityV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = IamIdentityV1.new_instance( + service_name='TEST_SERVICE_NOT_FOUND', + ) + + +class TestGetLoginSettings: + """ + Test Class for get_login_settings + """ + + @responses.activate + def test_get_login_settings_all_params(self): + """ + get_login_settings() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString') + mock_response = '{"alias": "alias"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + + # Invoke method + response = _service.get_login_settings( + account_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_login_settings_all_params_with_retries(self): + # Enable retries and run test_get_login_settings_all_params. + _service.enable_retries() + self.test_get_login_settings_all_params() + + # Disable retries and run test_get_login_settings_all_params. + _service.disable_retries() + self.test_get_login_settings_all_params() + + @responses.activate + def test_get_login_settings_value_error(self): + """ + test_get_login_settings_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString') + mock_response = '{"alias": "alias"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_login_settings(**req_copy) + + def test_get_login_settings_value_error_with_retries(self): + # Enable retries and run test_get_login_settings_value_error. + _service.enable_retries() + self.test_get_login_settings_value_error() + + # Disable retries and run test_get_login_settings_value_error. + _service.disable_retries() + self.test_get_login_settings_value_error() + + +class TestUpdateLoginSettings: + """ + Test Class for update_login_settings + """ + + @responses.activate + def test_update_login_settings_all_params(self): + """ + update_login_settings() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString') + mock_response = '{"alias": "alias"}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + alias = 'testString' + + # Invoke method + response = _service.update_login_settings( + account_id, + alias=alias, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['alias'] == 'testString' + + def test_update_login_settings_all_params_with_retries(self): + # Enable retries and run test_update_login_settings_all_params. + _service.enable_retries() + self.test_update_login_settings_all_params() + + # Disable retries and run test_update_login_settings_all_params. + _service.disable_retries() + self.test_update_login_settings_all_params() + + @responses.activate + def test_update_login_settings_value_error(self): + """ + test_update_login_settings_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString') + mock_response = '{"alias": "alias"}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + alias = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_login_settings(**req_copy) + + def test_update_login_settings_value_error_with_retries(self): + # Enable retries and run test_update_login_settings_value_error. + _service.enable_retries() + self.test_update_login_settings_value_error() + + # Disable retries and run test_update_login_settings_value_error. + _service.disable_retries() + self.test_update_login_settings_value_error() + + +class TestListIdPSettings: + """ + Test Class for list_id_p_settings + """ + + @responses.activate + def test_list_id_p_settings_all_params(self): + """ + list_id_p_settings() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps') + mock_response = '{"idps": [{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + type = 'consumable' + include_idp_metadata = 'testString' + + # Invoke method + response = _service.list_id_p_settings( + account_id, + type, + include_idp_metadata=include_idp_metadata, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'type={}'.format(type) in query_string + assert 'include_idp_metadata={}'.format(include_idp_metadata) in query_string + + def test_list_id_p_settings_all_params_with_retries(self): + # Enable retries and run test_list_id_p_settings_all_params. + _service.enable_retries() + self.test_list_id_p_settings_all_params() + + # Disable retries and run test_list_id_p_settings_all_params. + _service.disable_retries() + self.test_list_id_p_settings_all_params() + + @responses.activate + def test_list_id_p_settings_required_params(self): + """ + test_list_id_p_settings_required_params() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps') + mock_response = '{"idps": [{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + type = 'consumable' + + # Invoke method + response = _service.list_id_p_settings( + account_id, + type, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'type={}'.format(type) in query_string + + def test_list_id_p_settings_required_params_with_retries(self): + # Enable retries and run test_list_id_p_settings_required_params. + _service.enable_retries() + self.test_list_id_p_settings_required_params() + + # Disable retries and run test_list_id_p_settings_required_params. + _service.disable_retries() + self.test_list_id_p_settings_required_params() + + @responses.activate + def test_list_id_p_settings_value_error(self): + """ + test_list_id_p_settings_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps') + mock_response = '{"idps": [{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + type = 'consumable' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "type": type, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_id_p_settings(**req_copy) + + def test_list_id_p_settings_value_error_with_retries(self): + # Enable retries and run test_list_id_p_settings_value_error. + _service.enable_retries() + self.test_list_id_p_settings_value_error() + + # Disable retries and run test_list_id_p_settings_value_error. + _service.disable_retries() + self.test_list_id_p_settings_value_error() + + +class TestGetIdPSetting: + """ + Test Class for get_id_p_setting + """ + + @responses.activate + def test_get_id_p_setting_all_params(self): + """ + get_id_p_setting() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + + # Invoke method + response = _service.get_id_p_setting( + account_id, + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_id_p_setting_all_params_with_retries(self): + # Enable retries and run test_get_id_p_setting_all_params. + _service.enable_retries() + self.test_get_id_p_setting_all_params() + + # Disable retries and run test_get_id_p_setting_all_params. + _service.disable_retries() + self.test_get_id_p_setting_all_params() + + @responses.activate + def test_get_id_p_setting_value_error(self): + """ + test_get_id_p_setting_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_id_p_setting(**req_copy) + + def test_get_id_p_setting_value_error_with_retries(self): + # Enable retries and run test_get_id_p_setting_value_error. + _service.enable_retries() + self.test_get_id_p_setting_value_error() + + # Disable retries and run test_get_id_p_setting_value_error. + _service.disable_retries() + self.test_get_id_p_setting_value_error() + + +class TestAddIdPSetting: + """ + Test Class for add_id_p_setting + """ + + @responses.activate + def test_add_id_p_setting_all_params(self): + """ + add_id_p_setting() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + cloud_user_strategy = 'STATIC' + active = True + ui_default = True + + # Invoke method + response = _service.add_id_p_setting( + account_id, + idp_id, + cloud_user_strategy, + active, + ui_default, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['cloud_user_strategy'] == 'STATIC' + assert req_body['active'] == True + assert req_body['ui_default'] == True + + def test_add_id_p_setting_all_params_with_retries(self): + # Enable retries and run test_add_id_p_setting_all_params. + _service.enable_retries() + self.test_add_id_p_setting_all_params() + + # Disable retries and run test_add_id_p_setting_all_params. + _service.disable_retries() + self.test_add_id_p_setting_all_params() + + @responses.activate + def test_add_id_p_setting_value_error(self): + """ + test_add_id_p_setting_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + cloud_user_strategy = 'STATIC' + active = True + ui_default = True + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "idp_id": idp_id, + "cloud_user_strategy": cloud_user_strategy, + "active": active, + "ui_default": ui_default, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.add_id_p_setting(**req_copy) + + def test_add_id_p_setting_value_error_with_retries(self): + # Enable retries and run test_add_id_p_setting_value_error. + _service.enable_retries() + self.test_add_id_p_setting_value_error() + + # Disable retries and run test_add_id_p_setting_value_error. + _service.disable_retries() + self.test_add_id_p_setting_value_error() + + +class TestUpdateIdPSetting: + """ + Test Class for update_id_p_setting + """ + + @responses.activate + def test_update_id_p_setting_all_params(self): + """ + update_id_p_setting() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + cloud_user_strategy = 'STATIC' + active = True + ui_default = True + + # Invoke method + response = _service.update_id_p_setting( + account_id, + idp_id, + cloud_user_strategy=cloud_user_strategy, + active=active, + ui_default=ui_default, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['cloud_user_strategy'] == 'STATIC' + assert req_body['active'] == True + assert req_body['ui_default'] == True + + def test_update_id_p_setting_all_params_with_retries(self): + # Enable retries and run test_update_id_p_setting_all_params. + _service.enable_retries() + self.test_update_id_p_setting_all_params() + + # Disable retries and run test_update_id_p_setting_all_params. + _service.disable_retries() + self.test_update_id_p_setting_all_params() + + @responses.activate + def test_update_id_p_setting_value_error(self): + """ + test_update_id_p_setting_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + mock_response = '{"idp_id": "idp_id", "owner_account": "owner_account", "owner_account_name": "owner_account_name", "idp_name": "idp_name", "idp_type": "idp_type", "cloud_user_strategy": "STATIC", "active": true, "ui_default": true}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + cloud_user_strategy = 'STATIC' + active = True + ui_default = True + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_id_p_setting(**req_copy) + + def test_update_id_p_setting_value_error_with_retries(self): + # Enable retries and run test_update_id_p_setting_value_error. + _service.enable_retries() + self.test_update_id_p_setting_value_error() + + # Disable retries and run test_update_id_p_setting_value_error. + _service.disable_retries() + self.test_update_id_p_setting_value_error() + + +class TestRemoveIdPSetting: + """ + Test Class for remove_id_p_setting + """ + + @responses.activate + def test_remove_id_p_setting_all_params(self): + """ + remove_id_p_setting() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + + # Invoke method + response = _service.remove_id_p_setting( + account_id, + idp_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_remove_id_p_setting_all_params_with_retries(self): + # Enable retries and run test_remove_id_p_setting_all_params. + _service.enable_retries() + self.test_remove_id_p_setting_all_params() + + # Disable retries and run test_remove_id_p_setting_all_params. + _service.disable_retries() + self.test_remove_id_p_setting_all_params() + + @responses.activate + def test_remove_id_p_setting_value_error(self): + """ + test_remove_id_p_setting_value_error() + """ + # Set up mock + url = preprocess_url('/v2/loginsettings/testString/idps/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + account_id = 'testString' + idp_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "account_id": account_id, + "idp_id": idp_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.remove_id_p_setting(**req_copy) + + def test_remove_id_p_setting_value_error_with_retries(self): + # Enable retries and run test_remove_id_p_setting_value_error. + _service.enable_retries() + self.test_remove_id_p_setting_value_error() + + # Disable retries and run test_remove_id_p_setting_value_error. + _service.disable_retries() + self.test_remove_id_p_setting_value_error() + + +# endregion +############################################################################## +# End of Service: AccountSettingsForIdP +############################################################################## + + +############################################################################## +# Start of Model Tests +############################################################################## +# region + + +class TestModel_AccessGroupCount: + """ + Test Class for AccessGroupCount + """ + + def test_access_group_count_serialization(self): + """ + Test serialization/deserialization for AccessGroupCount + """ + + # Construct a json representation of a AccessGroupCount model + access_group_count_model_json = {} + access_group_count_model_json['group_id'] = 'testString' + access_group_count_model_json['count'] = 38 + + # Construct a model instance of AccessGroupCount by calling from_dict on the json representation + access_group_count_model = AccessGroupCount.from_dict(access_group_count_model_json) + assert access_group_count_model != False + + # Construct a model instance of AccessGroupCount by calling from_dict on the json representation + access_group_count_model_dict = AccessGroupCount.from_dict(access_group_count_model_json).__dict__ + access_group_count_model2 = AccessGroupCount(**access_group_count_model_dict) + + # Verify the model instances are equivalent + assert access_group_count_model == access_group_count_model2 + + # Convert model instance back to dict and verify no loss of data + access_group_count_model_json2 = access_group_count_model.to_dict() + assert access_group_count_model_json2 == access_group_count_model_json + + +class TestModel_AccountBasedMfaEnrollment: + """ + Test Class for AccountBasedMfaEnrollment + """ + + def test_account_based_mfa_enrollment_serialization(self): + """ + Test serialization/deserialization for AccountBasedMfaEnrollment + """ + + # Construct dict forms of any model objects needed in order to build this model. + + mfa_enrollment_type_status_model = {} # MfaEnrollmentTypeStatus + mfa_enrollment_type_status_model['required'] = True + mfa_enrollment_type_status_model['enrolled'] = True + + # Construct a json representation of a AccountBasedMfaEnrollment model + account_based_mfa_enrollment_model_json = {} + account_based_mfa_enrollment_model_json['security_questions'] = mfa_enrollment_type_status_model + account_based_mfa_enrollment_model_json['totp'] = mfa_enrollment_type_status_model + account_based_mfa_enrollment_model_json['verisign'] = mfa_enrollment_type_status_model + account_based_mfa_enrollment_model_json['complies'] = True + + # Construct a model instance of AccountBasedMfaEnrollment by calling from_dict on the json representation + account_based_mfa_enrollment_model = AccountBasedMfaEnrollment.from_dict( + account_based_mfa_enrollment_model_json + ) + assert account_based_mfa_enrollment_model != False + + # Construct a model instance of AccountBasedMfaEnrollment by calling from_dict on the json representation + account_based_mfa_enrollment_model_dict = AccountBasedMfaEnrollment.from_dict( + account_based_mfa_enrollment_model_json + ).__dict__ + account_based_mfa_enrollment_model2 = AccountBasedMfaEnrollment(**account_based_mfa_enrollment_model_dict) + + # Verify the model instances are equivalent + assert account_based_mfa_enrollment_model == account_based_mfa_enrollment_model2 + + # Convert model instance back to dict and verify no loss of data + account_based_mfa_enrollment_model_json2 = account_based_mfa_enrollment_model.to_dict() + assert account_based_mfa_enrollment_model_json2 == account_based_mfa_enrollment_model_json + + +class TestModel_AccountIdpSettings: + """ + Test Class for AccountIdpSettings + """ + + def test_account_idp_settings_serialization(self): + """ + Test serialization/deserialization for AccountIdpSettings + """ + + # Construct a json representation of a AccountIdpSettings model + account_idp_settings_model_json = {} + account_idp_settings_model_json['idp_id'] = 'testString' + account_idp_settings_model_json['owner_account'] = 'testString' + account_idp_settings_model_json['owner_account_name'] = 'testString' + account_idp_settings_model_json['idp_name'] = 'testString' + account_idp_settings_model_json['idp_type'] = 'testString' + account_idp_settings_model_json['cloud_user_strategy'] = 'STATIC' + account_idp_settings_model_json['active'] = True + account_idp_settings_model_json['ui_default'] = True + + # Construct a model instance of AccountIdpSettings by calling from_dict on the json representation + account_idp_settings_model = AccountIdpSettings.from_dict(account_idp_settings_model_json) + assert account_idp_settings_model != False + + # Construct a model instance of AccountIdpSettings by calling from_dict on the json representation + account_idp_settings_model_dict = AccountIdpSettings.from_dict(account_idp_settings_model_json).__dict__ + account_idp_settings_model2 = AccountIdpSettings(**account_idp_settings_model_dict) + + # Verify the model instances are equivalent + assert account_idp_settings_model == account_idp_settings_model2 + + # Convert model instance back to dict and verify no loss of data + account_idp_settings_model_json2 = account_idp_settings_model.to_dict() + assert account_idp_settings_model_json2 == account_idp_settings_model_json + + +class TestModel_AccountLoginSettings: + """ + Test Class for AccountLoginSettings + """ + + def test_account_login_settings_serialization(self): + """ + Test serialization/deserialization for AccountLoginSettings + """ + + # Construct a json representation of a AccountLoginSettings model + account_login_settings_model_json = {} + account_login_settings_model_json['alias'] = 'testString' + + # Construct a model instance of AccountLoginSettings by calling from_dict on the json representation + account_login_settings_model = AccountLoginSettings.from_dict(account_login_settings_model_json) + assert account_login_settings_model != False + + # Construct a model instance of AccountLoginSettings by calling from_dict on the json representation + account_login_settings_model_dict = AccountLoginSettings.from_dict(account_login_settings_model_json).__dict__ + account_login_settings_model2 = AccountLoginSettings(**account_login_settings_model_dict) + + # Verify the model instances are equivalent + assert account_login_settings_model == account_login_settings_model2 + + # Convert model instance back to dict and verify no loss of data + account_login_settings_model_json2 = account_login_settings_model.to_dict() + assert account_login_settings_model_json2 == account_login_settings_model_json + + +class TestModel_AccountSettingsAssignedTemplatesSection: + """ + Test Class for AccountSettingsAssignedTemplatesSection + """ + + def test_account_settings_assigned_templates_section_serialization(self): + """ + Test serialization/deserialization for AccountSettingsAssignedTemplatesSection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse + account_settings_user_mfa_response_model['iam_id'] = 'testString' + account_settings_user_mfa_response_model['mfa'] = 'NONE' + account_settings_user_mfa_response_model['name'] = 'testString' + account_settings_user_mfa_response_model['userName'] = 'testString' + account_settings_user_mfa_response_model['email'] = 'testString' + account_settings_user_mfa_response_model['description'] = 'testString' + + account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction + account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model['restrict_invitation'] = True + + assigned_templates_account_settings_restrict_user_domains_model = ( + {} + ) # AssignedTemplatesAccountSettingsRestrictUserDomains + assigned_templates_account_settings_restrict_user_domains_model['account_sufficient'] = True + assigned_templates_account_settings_restrict_user_domains_model['restrictions'] = [ + account_settings_user_domain_restriction_model + ] + + # Construct a json representation of a AccountSettingsAssignedTemplatesSection model + account_settings_assigned_templates_section_model_json = {} + account_settings_assigned_templates_section_model_json['template_id'] = 'testString' + account_settings_assigned_templates_section_model_json['template_version'] = 26 + account_settings_assigned_templates_section_model_json['template_name'] = 'testString' + account_settings_assigned_templates_section_model_json['restrict_create_service_id'] = 'NOT_SET' + account_settings_assigned_templates_section_model_json['restrict_create_platform_apikey'] = 'NOT_SET' + account_settings_assigned_templates_section_model_json['allowed_ip_addresses'] = 'testString' + account_settings_assigned_templates_section_model_json['mfa'] = 'NONE' + account_settings_assigned_templates_section_model_json['session_expiration_in_seconds'] = '86400' + account_settings_assigned_templates_section_model_json['session_invalidation_in_seconds'] = '7200' + account_settings_assigned_templates_section_model_json['max_sessions_per_identity'] = 'testString' + account_settings_assigned_templates_section_model_json['system_access_token_expiration_in_seconds'] = '3600' + account_settings_assigned_templates_section_model_json['system_refresh_token_expiration_in_seconds'] = '259200' + account_settings_assigned_templates_section_model_json['restrict_user_list_visibility'] = 'RESTRICTED' + account_settings_assigned_templates_section_model_json['user_mfa'] = [account_settings_user_mfa_response_model] + account_settings_assigned_templates_section_model_json['restrict_user_domains'] = ( + assigned_templates_account_settings_restrict_user_domains_model + ) + + # Construct a model instance of AccountSettingsAssignedTemplatesSection by calling from_dict on the json representation + account_settings_assigned_templates_section_model = AccountSettingsAssignedTemplatesSection.from_dict( + account_settings_assigned_templates_section_model_json + ) + assert account_settings_assigned_templates_section_model != False + + # Construct a model instance of AccountSettingsAssignedTemplatesSection by calling from_dict on the json representation + account_settings_assigned_templates_section_model_dict = AccountSettingsAssignedTemplatesSection.from_dict( + account_settings_assigned_templates_section_model_json + ).__dict__ + account_settings_assigned_templates_section_model2 = AccountSettingsAssignedTemplatesSection( + **account_settings_assigned_templates_section_model_dict + ) + + # Verify the model instances are equivalent + assert account_settings_assigned_templates_section_model == account_settings_assigned_templates_section_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_assigned_templates_section_model_json2 = ( + account_settings_assigned_templates_section_model.to_dict() + ) + assert ( + account_settings_assigned_templates_section_model_json2 + == account_settings_assigned_templates_section_model_json + ) + + +class TestModel_AccountSettingsEffectiveSection: + """ + Test Class for AccountSettingsEffectiveSection + """ + + def test_account_settings_effective_section_serialization(self): + """ + Test serialization/deserialization for AccountSettingsEffectiveSection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse + account_settings_user_mfa_response_model['iam_id'] = 'testString' + account_settings_user_mfa_response_model['mfa'] = 'NONE' + account_settings_user_mfa_response_model['name'] = 'testString' + account_settings_user_mfa_response_model['userName'] = 'testString' + account_settings_user_mfa_response_model['email'] = 'testString' + account_settings_user_mfa_response_model['description'] = 'testString' + + # Construct a json representation of a AccountSettingsEffectiveSection model + account_settings_effective_section_model_json = {} + account_settings_effective_section_model_json['restrict_create_service_id'] = 'NOT_SET' + account_settings_effective_section_model_json['restrict_create_platform_apikey'] = 'NOT_SET' + account_settings_effective_section_model_json['restrict_user_list_visibility'] = 'NOT_RESTRICTED' + account_settings_effective_section_model_json['allowed_ip_addresses'] = 'testString' + account_settings_effective_section_model_json['mfa'] = 'NONE' + account_settings_effective_section_model_json['user_mfa'] = [account_settings_user_mfa_response_model] + account_settings_effective_section_model_json['session_expiration_in_seconds'] = '86400' + account_settings_effective_section_model_json['session_invalidation_in_seconds'] = '7200' + account_settings_effective_section_model_json['max_sessions_per_identity'] = 'testString' + account_settings_effective_section_model_json['system_access_token_expiration_in_seconds'] = '3600' + account_settings_effective_section_model_json['system_refresh_token_expiration_in_seconds'] = '259200' + + # Construct a model instance of AccountSettingsEffectiveSection by calling from_dict on the json representation + account_settings_effective_section_model = AccountSettingsEffectiveSection.from_dict( + account_settings_effective_section_model_json + ) + assert account_settings_effective_section_model != False # Construct a model instance of AccountSettingsEffectiveSection by calling from_dict on the json representation account_settings_effective_section_model_dict = AccountSettingsEffectiveSection.from_dict( account_settings_effective_section_model_json ).__dict__ - account_settings_effective_section_model2 = AccountSettingsEffectiveSection( - **account_settings_effective_section_model_dict + account_settings_effective_section_model2 = AccountSettingsEffectiveSection( + **account_settings_effective_section_model_dict + ) + + # Verify the model instances are equivalent + assert account_settings_effective_section_model == account_settings_effective_section_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_effective_section_model_json2 = account_settings_effective_section_model.to_dict() + assert account_settings_effective_section_model_json2 == account_settings_effective_section_model_json + + +class TestModel_AccountSettingsResponse: + """ + Test Class for AccountSettingsResponse + """ + + def test_account_settings_response_serialization(self): + """ + Test serialization/deserialization for AccountSettingsResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_context_model = {} # ResponseContext + response_context_model['transaction_id'] = 'testString' + response_context_model['operation'] = 'testString' + response_context_model['user_agent'] = 'testString' + response_context_model['url'] = 'testString' + response_context_model['instance_id'] = 'testString' + response_context_model['thread_id'] = 'testString' + response_context_model['host'] = 'testString' + response_context_model['start_time'] = 'testString' + response_context_model['end_time'] = 'testString' + response_context_model['elapsed_time'] = 'testString' + response_context_model['cluster_name'] = 'testString' + + enity_history_record_model = {} # EnityHistoryRecord + enity_history_record_model['timestamp'] = 'testString' + enity_history_record_model['iam_id'] = 'testString' + enity_history_record_model['iam_id_account'] = 'testString' + enity_history_record_model['action'] = 'testString' + enity_history_record_model['params'] = ['testString'] + enity_history_record_model['message'] = 'testString' + + account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse + account_settings_user_mfa_response_model['iam_id'] = 'testString' + account_settings_user_mfa_response_model['mfa'] = 'NONE' + account_settings_user_mfa_response_model['name'] = 'testString' + account_settings_user_mfa_response_model['userName'] = 'testString' + account_settings_user_mfa_response_model['email'] = 'testString' + account_settings_user_mfa_response_model['description'] = 'testString' + + account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction + account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model['restrict_invitation'] = True + + # Construct a json representation of a AccountSettingsResponse model + account_settings_response_model_json = {} + account_settings_response_model_json['context'] = response_context_model + account_settings_response_model_json['account_id'] = 'testString' + account_settings_response_model_json['entity_tag'] = 'testString' + account_settings_response_model_json['history'] = [enity_history_record_model] + account_settings_response_model_json['restrict_create_service_id'] = 'NOT_SET' + account_settings_response_model_json['restrict_create_platform_apikey'] = 'NOT_SET' + account_settings_response_model_json['allowed_ip_addresses'] = 'testString' + account_settings_response_model_json['mfa'] = 'NONE' + account_settings_response_model_json['session_expiration_in_seconds'] = '86400' + account_settings_response_model_json['session_invalidation_in_seconds'] = '7200' + account_settings_response_model_json['max_sessions_per_identity'] = 'testString' + account_settings_response_model_json['system_access_token_expiration_in_seconds'] = '3600' + account_settings_response_model_json['system_refresh_token_expiration_in_seconds'] = '259200' + account_settings_response_model_json['restrict_user_list_visibility'] = 'NOT_RESTRICTED' + account_settings_response_model_json['user_mfa'] = [account_settings_user_mfa_response_model] + account_settings_response_model_json['restrict_user_domains'] = [account_settings_user_domain_restriction_model] + + # Construct a model instance of AccountSettingsResponse by calling from_dict on the json representation + account_settings_response_model = AccountSettingsResponse.from_dict(account_settings_response_model_json) + assert account_settings_response_model != False + + # Construct a model instance of AccountSettingsResponse by calling from_dict on the json representation + account_settings_response_model_dict = AccountSettingsResponse.from_dict( + account_settings_response_model_json + ).__dict__ + account_settings_response_model2 = AccountSettingsResponse(**account_settings_response_model_dict) + + # Verify the model instances are equivalent + assert account_settings_response_model == account_settings_response_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_response_model_json2 = account_settings_response_model.to_dict() + assert account_settings_response_model_json2 == account_settings_response_model_json + + +class TestModel_AccountSettingsTemplateList: + """ + Test Class for AccountSettingsTemplateList + """ + + def test_account_settings_template_list_serialization(self): + """ + Test serialization/deserialization for AccountSettingsTemplateList + """ + + # Construct dict forms of any model objects needed in order to build this model. + + response_context_model = {} # ResponseContext + response_context_model['transaction_id'] = 'testString' + response_context_model['operation'] = 'testString' + response_context_model['user_agent'] = 'testString' + response_context_model['url'] = 'testString' + response_context_model['instance_id'] = 'testString' + response_context_model['thread_id'] = 'testString' + response_context_model['host'] = 'testString' + response_context_model['start_time'] = 'testString' + response_context_model['end_time'] = 'testString' + response_context_model['elapsed_time'] = 'testString' + response_context_model['cluster_name'] = 'testString' + + user_mfa_model = {} # UserMfa + user_mfa_model['iam_id'] = 'testString' + user_mfa_model['mfa'] = 'NONE' + + account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction + account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model['restrict_invitation'] = True + + template_account_settings_restrict_user_domains_model = {} # TemplateAccountSettingsRestrictUserDomains + template_account_settings_restrict_user_domains_model['account_sufficient'] = True + template_account_settings_restrict_user_domains_model['restrictions'] = [ + account_settings_user_domain_restriction_model + ] + + template_account_settings_model = {} # TemplateAccountSettings + template_account_settings_model['restrict_create_service_id'] = 'NOT_SET' + template_account_settings_model['restrict_create_platform_apikey'] = 'NOT_SET' + template_account_settings_model['allowed_ip_addresses'] = 'testString' + template_account_settings_model['mfa'] = 'NONE' + template_account_settings_model['user_mfa'] = [user_mfa_model] + template_account_settings_model['session_expiration_in_seconds'] = '86400' + template_account_settings_model['session_invalidation_in_seconds'] = '7200' + template_account_settings_model['max_sessions_per_identity'] = 'testString' + template_account_settings_model['system_access_token_expiration_in_seconds'] = '3600' + template_account_settings_model['system_refresh_token_expiration_in_seconds'] = '259200' + template_account_settings_model['restrict_user_list_visibility'] = 'RESTRICTED' + template_account_settings_model['restrict_user_domains'] = template_account_settings_restrict_user_domains_model + + enity_history_record_model = {} # EnityHistoryRecord + enity_history_record_model['timestamp'] = 'testString' + enity_history_record_model['iam_id'] = 'testString' + enity_history_record_model['iam_id_account'] = 'testString' + enity_history_record_model['action'] = 'testString' + enity_history_record_model['params'] = ['testString'] + enity_history_record_model['message'] = 'testString' + + account_settings_template_response_model = {} # AccountSettingsTemplateResponse + account_settings_template_response_model['id'] = 'testString' + account_settings_template_response_model['version'] = 26 + account_settings_template_response_model['account_id'] = 'testString' + account_settings_template_response_model['name'] = 'testString' + account_settings_template_response_model['description'] = 'testString' + account_settings_template_response_model['committed'] = True + account_settings_template_response_model['account_settings'] = template_account_settings_model + account_settings_template_response_model['history'] = [enity_history_record_model] + account_settings_template_response_model['entity_tag'] = 'testString' + account_settings_template_response_model['crn'] = 'testString' + account_settings_template_response_model['created_at'] = 'testString' + account_settings_template_response_model['created_by_id'] = 'testString' + account_settings_template_response_model['last_modified_at'] = 'testString' + account_settings_template_response_model['last_modified_by_id'] = 'testString' + + # Construct a json representation of a AccountSettingsTemplateList model + account_settings_template_list_model_json = {} + account_settings_template_list_model_json['context'] = response_context_model + account_settings_template_list_model_json['offset'] = 26 + account_settings_template_list_model_json['limit'] = 20 + account_settings_template_list_model_json['first'] = 'testString' + account_settings_template_list_model_json['previous'] = 'testString' + account_settings_template_list_model_json['next'] = 'testString' + account_settings_template_list_model_json['account_settings_templates'] = [ + account_settings_template_response_model + ] + + # Construct a model instance of AccountSettingsTemplateList by calling from_dict on the json representation + account_settings_template_list_model = AccountSettingsTemplateList.from_dict( + account_settings_template_list_model_json + ) + assert account_settings_template_list_model != False + + # Construct a model instance of AccountSettingsTemplateList by calling from_dict on the json representation + account_settings_template_list_model_dict = AccountSettingsTemplateList.from_dict( + account_settings_template_list_model_json + ).__dict__ + account_settings_template_list_model2 = AccountSettingsTemplateList(**account_settings_template_list_model_dict) + + # Verify the model instances are equivalent + assert account_settings_template_list_model == account_settings_template_list_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_template_list_model_json2 = account_settings_template_list_model.to_dict() + assert account_settings_template_list_model_json2 == account_settings_template_list_model_json + + +class TestModel_AccountSettingsTemplateResponse: + """ + Test Class for AccountSettingsTemplateResponse + """ + + def test_account_settings_template_response_serialization(self): + """ + Test serialization/deserialization for AccountSettingsTemplateResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + user_mfa_model = {} # UserMfa + user_mfa_model['iam_id'] = 'testString' + user_mfa_model['mfa'] = 'NONE' + + account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction + account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model['restrict_invitation'] = True + + template_account_settings_restrict_user_domains_model = {} # TemplateAccountSettingsRestrictUserDomains + template_account_settings_restrict_user_domains_model['account_sufficient'] = True + template_account_settings_restrict_user_domains_model['restrictions'] = [ + account_settings_user_domain_restriction_model + ] + + template_account_settings_model = {} # TemplateAccountSettings + template_account_settings_model['restrict_create_service_id'] = 'NOT_SET' + template_account_settings_model['restrict_create_platform_apikey'] = 'NOT_SET' + template_account_settings_model['allowed_ip_addresses'] = 'testString' + template_account_settings_model['mfa'] = 'NONE' + template_account_settings_model['user_mfa'] = [user_mfa_model] + template_account_settings_model['session_expiration_in_seconds'] = '86400' + template_account_settings_model['session_invalidation_in_seconds'] = '7200' + template_account_settings_model['max_sessions_per_identity'] = 'testString' + template_account_settings_model['system_access_token_expiration_in_seconds'] = '3600' + template_account_settings_model['system_refresh_token_expiration_in_seconds'] = '259200' + template_account_settings_model['restrict_user_list_visibility'] = 'RESTRICTED' + template_account_settings_model['restrict_user_domains'] = template_account_settings_restrict_user_domains_model + + enity_history_record_model = {} # EnityHistoryRecord + enity_history_record_model['timestamp'] = 'testString' + enity_history_record_model['iam_id'] = 'testString' + enity_history_record_model['iam_id_account'] = 'testString' + enity_history_record_model['action'] = 'testString' + enity_history_record_model['params'] = ['testString'] + enity_history_record_model['message'] = 'testString' + + # Construct a json representation of a AccountSettingsTemplateResponse model + account_settings_template_response_model_json = {} + account_settings_template_response_model_json['id'] = 'testString' + account_settings_template_response_model_json['version'] = 26 + account_settings_template_response_model_json['account_id'] = 'testString' + account_settings_template_response_model_json['name'] = 'testString' + account_settings_template_response_model_json['description'] = 'testString' + account_settings_template_response_model_json['committed'] = True + account_settings_template_response_model_json['account_settings'] = template_account_settings_model + account_settings_template_response_model_json['history'] = [enity_history_record_model] + account_settings_template_response_model_json['entity_tag'] = 'testString' + account_settings_template_response_model_json['crn'] = 'testString' + account_settings_template_response_model_json['created_at'] = 'testString' + account_settings_template_response_model_json['created_by_id'] = 'testString' + account_settings_template_response_model_json['last_modified_at'] = 'testString' + account_settings_template_response_model_json['last_modified_by_id'] = 'testString' + + # Construct a model instance of AccountSettingsTemplateResponse by calling from_dict on the json representation + account_settings_template_response_model = AccountSettingsTemplateResponse.from_dict( + account_settings_template_response_model_json + ) + assert account_settings_template_response_model != False + + # Construct a model instance of AccountSettingsTemplateResponse by calling from_dict on the json representation + account_settings_template_response_model_dict = AccountSettingsTemplateResponse.from_dict( + account_settings_template_response_model_json + ).__dict__ + account_settings_template_response_model2 = AccountSettingsTemplateResponse( + **account_settings_template_response_model_dict ) # Verify the model instances are equivalent - assert account_settings_effective_section_model == account_settings_effective_section_model2 + assert account_settings_template_response_model == account_settings_template_response_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_template_response_model_json2 = account_settings_template_response_model.to_dict() + assert account_settings_template_response_model_json2 == account_settings_template_response_model_json + + +class TestModel_AccountSettingsUserDomainRestriction: + """ + Test Class for AccountSettingsUserDomainRestriction + """ + + def test_account_settings_user_domain_restriction_serialization(self): + """ + Test serialization/deserialization for AccountSettingsUserDomainRestriction + """ + + # Construct a json representation of a AccountSettingsUserDomainRestriction model + account_settings_user_domain_restriction_model_json = {} + account_settings_user_domain_restriction_model_json['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model_json['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model_json['restrict_invitation'] = True + + # Construct a model instance of AccountSettingsUserDomainRestriction by calling from_dict on the json representation + account_settings_user_domain_restriction_model = AccountSettingsUserDomainRestriction.from_dict( + account_settings_user_domain_restriction_model_json + ) + assert account_settings_user_domain_restriction_model != False + + # Construct a model instance of AccountSettingsUserDomainRestriction by calling from_dict on the json representation + account_settings_user_domain_restriction_model_dict = AccountSettingsUserDomainRestriction.from_dict( + account_settings_user_domain_restriction_model_json + ).__dict__ + account_settings_user_domain_restriction_model2 = AccountSettingsUserDomainRestriction( + **account_settings_user_domain_restriction_model_dict + ) + + # Verify the model instances are equivalent + assert account_settings_user_domain_restriction_model == account_settings_user_domain_restriction_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_user_domain_restriction_model_json2 = account_settings_user_domain_restriction_model.to_dict() + assert ( + account_settings_user_domain_restriction_model_json2 == account_settings_user_domain_restriction_model_json + ) + + +class TestModel_AccountSettingsUserMFAResponse: + """ + Test Class for AccountSettingsUserMFAResponse + """ + + def test_account_settings_user_mfa_response_serialization(self): + """ + Test serialization/deserialization for AccountSettingsUserMFAResponse + """ + + # Construct a json representation of a AccountSettingsUserMFAResponse model + account_settings_user_mfa_response_model_json = {} + account_settings_user_mfa_response_model_json['iam_id'] = 'testString' + account_settings_user_mfa_response_model_json['mfa'] = 'NONE' + account_settings_user_mfa_response_model_json['name'] = 'testString' + account_settings_user_mfa_response_model_json['userName'] = 'testString' + account_settings_user_mfa_response_model_json['email'] = 'testString' + account_settings_user_mfa_response_model_json['description'] = 'testString' + + # Construct a model instance of AccountSettingsUserMFAResponse by calling from_dict on the json representation + account_settings_user_mfa_response_model = AccountSettingsUserMFAResponse.from_dict( + account_settings_user_mfa_response_model_json + ) + assert account_settings_user_mfa_response_model != False + + # Construct a model instance of AccountSettingsUserMFAResponse by calling from_dict on the json representation + account_settings_user_mfa_response_model_dict = AccountSettingsUserMFAResponse.from_dict( + account_settings_user_mfa_response_model_json + ).__dict__ + account_settings_user_mfa_response_model2 = AccountSettingsUserMFAResponse( + **account_settings_user_mfa_response_model_dict + ) + + # Verify the model instances are equivalent + assert account_settings_user_mfa_response_model == account_settings_user_mfa_response_model2 + + # Convert model instance back to dict and verify no loss of data + account_settings_user_mfa_response_model_json2 = account_settings_user_mfa_response_model.to_dict() + assert account_settings_user_mfa_response_model_json2 == account_settings_user_mfa_response_model_json + + +class TestModel_ActionControls: + """ + Test Class for ActionControls + """ + + def test_action_controls_serialization(self): + """ + Test serialization/deserialization for ActionControls + """ + + # Construct dict forms of any model objects needed in order to build this model. + + action_controls_identities_model = {} # ActionControlsIdentities + action_controls_identities_model['add'] = True + action_controls_identities_model['remove'] = True + + action_controls_rules_model = {} # ActionControlsRules + action_controls_rules_model['add'] = True + action_controls_rules_model['remove'] = True + + action_controls_policies_model = {} # ActionControlsPolicies + action_controls_policies_model['add'] = True + action_controls_policies_model['remove'] = True + + # Construct a json representation of a ActionControls model + action_controls_model_json = {} + action_controls_model_json['identities'] = action_controls_identities_model + action_controls_model_json['rules'] = action_controls_rules_model + action_controls_model_json['policies'] = action_controls_policies_model + + # Construct a model instance of ActionControls by calling from_dict on the json representation + action_controls_model = ActionControls.from_dict(action_controls_model_json) + assert action_controls_model != False + + # Construct a model instance of ActionControls by calling from_dict on the json representation + action_controls_model_dict = ActionControls.from_dict(action_controls_model_json).__dict__ + action_controls_model2 = ActionControls(**action_controls_model_dict) + + # Verify the model instances are equivalent + assert action_controls_model == action_controls_model2 + + # Convert model instance back to dict and verify no loss of data + action_controls_model_json2 = action_controls_model.to_dict() + assert action_controls_model_json2 == action_controls_model_json + + +class TestModel_ActionControlsIdentities: + """ + Test Class for ActionControlsIdentities + """ + + def test_action_controls_identities_serialization(self): + """ + Test serialization/deserialization for ActionControlsIdentities + """ + + # Construct a json representation of a ActionControlsIdentities model + action_controls_identities_model_json = {} + action_controls_identities_model_json['add'] = True + action_controls_identities_model_json['remove'] = True + + # Construct a model instance of ActionControlsIdentities by calling from_dict on the json representation + action_controls_identities_model = ActionControlsIdentities.from_dict(action_controls_identities_model_json) + assert action_controls_identities_model != False + + # Construct a model instance of ActionControlsIdentities by calling from_dict on the json representation + action_controls_identities_model_dict = ActionControlsIdentities.from_dict( + action_controls_identities_model_json + ).__dict__ + action_controls_identities_model2 = ActionControlsIdentities(**action_controls_identities_model_dict) + + # Verify the model instances are equivalent + assert action_controls_identities_model == action_controls_identities_model2 + + # Convert model instance back to dict and verify no loss of data + action_controls_identities_model_json2 = action_controls_identities_model.to_dict() + assert action_controls_identities_model_json2 == action_controls_identities_model_json + + +class TestModel_ActionControlsPolicies: + """ + Test Class for ActionControlsPolicies + """ + + def test_action_controls_policies_serialization(self): + """ + Test serialization/deserialization for ActionControlsPolicies + """ + + # Construct a json representation of a ActionControlsPolicies model + action_controls_policies_model_json = {} + action_controls_policies_model_json['add'] = True + action_controls_policies_model_json['remove'] = True + + # Construct a model instance of ActionControlsPolicies by calling from_dict on the json representation + action_controls_policies_model = ActionControlsPolicies.from_dict(action_controls_policies_model_json) + assert action_controls_policies_model != False + + # Construct a model instance of ActionControlsPolicies by calling from_dict on the json representation + action_controls_policies_model_dict = ActionControlsPolicies.from_dict( + action_controls_policies_model_json + ).__dict__ + action_controls_policies_model2 = ActionControlsPolicies(**action_controls_policies_model_dict) + + # Verify the model instances are equivalent + assert action_controls_policies_model == action_controls_policies_model2 # Convert model instance back to dict and verify no loss of data - account_settings_effective_section_model_json2 = account_settings_effective_section_model.to_dict() - assert account_settings_effective_section_model_json2 == account_settings_effective_section_model_json + action_controls_policies_model_json2 = action_controls_policies_model.to_dict() + assert action_controls_policies_model_json2 == action_controls_policies_model_json -class TestModel_AccountSettingsResponse: +class TestModel_ActionControlsRules: """ - Test Class for AccountSettingsResponse + Test Class for ActionControlsRules """ - def test_account_settings_response_serialization(self): + def test_action_controls_rules_serialization(self): """ - Test serialization/deserialization for AccountSettingsResponse + Test serialization/deserialization for ActionControlsRules """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a ActionControlsRules model + action_controls_rules_model_json = {} + action_controls_rules_model_json['add'] = True + action_controls_rules_model_json['remove'] = True - response_context_model = {} # ResponseContext - response_context_model['transaction_id'] = 'testString' - response_context_model['operation'] = 'testString' - response_context_model['user_agent'] = 'testString' - response_context_model['url'] = 'testString' - response_context_model['instance_id'] = 'testString' - response_context_model['thread_id'] = 'testString' - response_context_model['host'] = 'testString' - response_context_model['start_time'] = 'testString' - response_context_model['end_time'] = 'testString' - response_context_model['elapsed_time'] = 'testString' - response_context_model['cluster_name'] = 'testString' + # Construct a model instance of ActionControlsRules by calling from_dict on the json representation + action_controls_rules_model = ActionControlsRules.from_dict(action_controls_rules_model_json) + assert action_controls_rules_model != False - enity_history_record_model = {} # EnityHistoryRecord - enity_history_record_model['timestamp'] = 'testString' - enity_history_record_model['iam_id'] = 'testString' - enity_history_record_model['iam_id_account'] = 'testString' - enity_history_record_model['action'] = 'testString' - enity_history_record_model['params'] = ['testString'] - enity_history_record_model['message'] = 'testString' + # Construct a model instance of ActionControlsRules by calling from_dict on the json representation + action_controls_rules_model_dict = ActionControlsRules.from_dict(action_controls_rules_model_json).__dict__ + action_controls_rules_model2 = ActionControlsRules(**action_controls_rules_model_dict) - account_settings_user_mfa_response_model = {} # AccountSettingsUserMFAResponse - account_settings_user_mfa_response_model['iam_id'] = 'testString' - account_settings_user_mfa_response_model['mfa'] = 'NONE' - account_settings_user_mfa_response_model['name'] = 'testString' - account_settings_user_mfa_response_model['userName'] = 'testString' - account_settings_user_mfa_response_model['email'] = 'testString' - account_settings_user_mfa_response_model['description'] = 'testString' + # Verify the model instances are equivalent + assert action_controls_rules_model == action_controls_rules_model2 - account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction - account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model['restrict_invitation'] = True + # Convert model instance back to dict and verify no loss of data + action_controls_rules_model_json2 = action_controls_rules_model.to_dict() + assert action_controls_rules_model_json2 == action_controls_rules_model_json - # Construct a json representation of a AccountSettingsResponse model - account_settings_response_model_json = {} - account_settings_response_model_json['context'] = response_context_model - account_settings_response_model_json['account_id'] = 'testString' - account_settings_response_model_json['entity_tag'] = 'testString' - account_settings_response_model_json['history'] = [enity_history_record_model] - account_settings_response_model_json['restrict_create_service_id'] = 'NOT_SET' - account_settings_response_model_json['restrict_create_platform_apikey'] = 'NOT_SET' - account_settings_response_model_json['allowed_ip_addresses'] = 'testString' - account_settings_response_model_json['mfa'] = 'NONE' - account_settings_response_model_json['session_expiration_in_seconds'] = '86400' - account_settings_response_model_json['session_invalidation_in_seconds'] = '7200' - account_settings_response_model_json['max_sessions_per_identity'] = 'testString' - account_settings_response_model_json['system_access_token_expiration_in_seconds'] = '3600' - account_settings_response_model_json['system_refresh_token_expiration_in_seconds'] = '259200' - account_settings_response_model_json['restrict_user_list_visibility'] = 'NOT_RESTRICTED' - account_settings_response_model_json['user_mfa'] = [account_settings_user_mfa_response_model] - account_settings_response_model_json['restrict_user_domains'] = [account_settings_user_domain_restriction_model] - # Construct a model instance of AccountSettingsResponse by calling from_dict on the json representation - account_settings_response_model = AccountSettingsResponse.from_dict(account_settings_response_model_json) - assert account_settings_response_model != False +class TestModel_Activity: + """ + Test Class for Activity + """ - # Construct a model instance of AccountSettingsResponse by calling from_dict on the json representation - account_settings_response_model_dict = AccountSettingsResponse.from_dict( - account_settings_response_model_json - ).__dict__ - account_settings_response_model2 = AccountSettingsResponse(**account_settings_response_model_dict) + def test_activity_serialization(self): + """ + Test serialization/deserialization for Activity + """ + + # Construct a json representation of a Activity model + activity_model_json = {} + activity_model_json['last_authn'] = 'testString' + activity_model_json['authn_count'] = 26 + + # Construct a model instance of Activity by calling from_dict on the json representation + activity_model = Activity.from_dict(activity_model_json) + assert activity_model != False + + # Construct a model instance of Activity by calling from_dict on the json representation + activity_model_dict = Activity.from_dict(activity_model_json).__dict__ + activity_model2 = Activity(**activity_model_dict) # Verify the model instances are equivalent - assert account_settings_response_model == account_settings_response_model2 + assert activity_model == activity_model2 # Convert model instance back to dict and verify no loss of data - account_settings_response_model_json2 = account_settings_response_model.to_dict() - assert account_settings_response_model_json2 == account_settings_response_model_json + activity_model_json2 = activity_model.to_dict() + assert activity_model_json2 == activity_model_json -class TestModel_AccountSettingsTemplateList: +class TestModel_ApiKey: """ - Test Class for AccountSettingsTemplateList + Test Class for ApiKey """ - def test_account_settings_template_list_serialization(self): + def test_api_key_serialization(self): """ - Test serialization/deserialization for AccountSettingsTemplateList + Test serialization/deserialization for ApiKey """ # Construct dict forms of any model objects needed in order to build this model. @@ -10261,35 +13061,6 @@ def test_account_settings_template_list_serialization(self): response_context_model['elapsed_time'] = 'testString' response_context_model['cluster_name'] = 'testString' - user_mfa_model = {} # UserMfa - user_mfa_model['iam_id'] = 'testString' - user_mfa_model['mfa'] = 'NONE' - - account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction - account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model['restrict_invitation'] = True - - template_account_settings_restrict_user_domains_model = {} # TemplateAccountSettingsRestrictUserDomains - template_account_settings_restrict_user_domains_model['account_sufficient'] = True - template_account_settings_restrict_user_domains_model['restrictions'] = [ - account_settings_user_domain_restriction_model - ] - - template_account_settings_model = {} # TemplateAccountSettings - template_account_settings_model['restrict_create_service_id'] = 'NOT_SET' - template_account_settings_model['restrict_create_platform_apikey'] = 'NOT_SET' - template_account_settings_model['allowed_ip_addresses'] = 'testString' - template_account_settings_model['mfa'] = 'NONE' - template_account_settings_model['user_mfa'] = [user_mfa_model] - template_account_settings_model['session_expiration_in_seconds'] = '86400' - template_account_settings_model['session_invalidation_in_seconds'] = '7200' - template_account_settings_model['max_sessions_per_identity'] = 'testString' - template_account_settings_model['system_access_token_expiration_in_seconds'] = '3600' - template_account_settings_model['system_refresh_token_expiration_in_seconds'] = '259200' - template_account_settings_model['restrict_user_list_visibility'] = 'RESTRICTED' - template_account_settings_model['restrict_user_domains'] = template_account_settings_restrict_user_domains_model - enity_history_record_model = {} # EnityHistoryRecord enity_history_record_model['timestamp'] = 'testString' enity_history_record_model['iam_id'] = 'testString' @@ -10298,94 +13069,115 @@ def test_account_settings_template_list_serialization(self): enity_history_record_model['params'] = ['testString'] enity_history_record_model['message'] = 'testString' - account_settings_template_response_model = {} # AccountSettingsTemplateResponse - account_settings_template_response_model['id'] = 'testString' - account_settings_template_response_model['version'] = 26 - account_settings_template_response_model['account_id'] = 'testString' - account_settings_template_response_model['name'] = 'testString' - account_settings_template_response_model['description'] = 'testString' - account_settings_template_response_model['committed'] = True - account_settings_template_response_model['account_settings'] = template_account_settings_model - account_settings_template_response_model['history'] = [enity_history_record_model] - account_settings_template_response_model['entity_tag'] = 'testString' - account_settings_template_response_model['crn'] = 'testString' - account_settings_template_response_model['created_at'] = 'testString' - account_settings_template_response_model['created_by_id'] = 'testString' - account_settings_template_response_model['last_modified_at'] = 'testString' - account_settings_template_response_model['last_modified_by_id'] = 'testString' + activity_model = {} # Activity + activity_model['last_authn'] = 'testString' + activity_model['authn_count'] = 26 - # Construct a json representation of a AccountSettingsTemplateList model - account_settings_template_list_model_json = {} - account_settings_template_list_model_json['context'] = response_context_model - account_settings_template_list_model_json['offset'] = 26 - account_settings_template_list_model_json['limit'] = 20 - account_settings_template_list_model_json['first'] = 'testString' - account_settings_template_list_model_json['previous'] = 'testString' - account_settings_template_list_model_json['next'] = 'testString' - account_settings_template_list_model_json['account_settings_templates'] = [ - account_settings_template_response_model - ] + # Construct a json representation of a ApiKey model + api_key_model_json = {} + api_key_model_json['context'] = response_context_model + api_key_model_json['id'] = 'testString' + api_key_model_json['entity_tag'] = 'testString' + api_key_model_json['crn'] = 'testString' + api_key_model_json['locked'] = True + api_key_model_json['disabled'] = True + api_key_model_json['created_at'] = '2019-01-01T12:00:00Z' + api_key_model_json['created_by'] = 'testString' + api_key_model_json['modified_at'] = '2019-01-01T12:00:00Z' + api_key_model_json['name'] = 'testString' + api_key_model_json['support_sessions'] = True + api_key_model_json['action_when_leaked'] = 'testString' + api_key_model_json['expires_at'] = 'testString' + api_key_model_json['description'] = 'testString' + api_key_model_json['iam_id'] = 'testString' + api_key_model_json['account_id'] = 'testString' + api_key_model_json['apikey'] = 'testString' + api_key_model_json['history'] = [enity_history_record_model] + api_key_model_json['activity'] = activity_model - # Construct a model instance of AccountSettingsTemplateList by calling from_dict on the json representation - account_settings_template_list_model = AccountSettingsTemplateList.from_dict( - account_settings_template_list_model_json + # Construct a model instance of ApiKey by calling from_dict on the json representation + api_key_model = ApiKey.from_dict(api_key_model_json) + assert api_key_model != False + + # Construct a model instance of ApiKey by calling from_dict on the json representation + api_key_model_dict = ApiKey.from_dict(api_key_model_json).__dict__ + api_key_model2 = ApiKey(**api_key_model_dict) + + # Verify the model instances are equivalent + assert api_key_model == api_key_model2 + + # Convert model instance back to dict and verify no loss of data + api_key_model_json2 = api_key_model.to_dict() + assert api_key_model_json2 == api_key_model_json + + +class TestModel_ApiKeyInsideCreateServiceIdRequest: + """ + Test Class for ApiKeyInsideCreateServiceIdRequest + """ + + def test_api_key_inside_create_service_id_request_serialization(self): + """ + Test serialization/deserialization for ApiKeyInsideCreateServiceIdRequest + """ + + # Construct a json representation of a ApiKeyInsideCreateServiceIdRequest model + api_key_inside_create_service_id_request_model_json = {} + api_key_inside_create_service_id_request_model_json['name'] = 'testString' + api_key_inside_create_service_id_request_model_json['description'] = 'testString' + api_key_inside_create_service_id_request_model_json['apikey'] = 'testString' + api_key_inside_create_service_id_request_model_json['store_value'] = True + api_key_inside_create_service_id_request_model_json['action_when_leaked'] = 'testString' + api_key_inside_create_service_id_request_model_json['expires_at'] = 'testString' + + # Construct a model instance of ApiKeyInsideCreateServiceIdRequest by calling from_dict on the json representation + api_key_inside_create_service_id_request_model = ApiKeyInsideCreateServiceIdRequest.from_dict( + api_key_inside_create_service_id_request_model_json ) - assert account_settings_template_list_model != False + assert api_key_inside_create_service_id_request_model != False - # Construct a model instance of AccountSettingsTemplateList by calling from_dict on the json representation - account_settings_template_list_model_dict = AccountSettingsTemplateList.from_dict( - account_settings_template_list_model_json + # Construct a model instance of ApiKeyInsideCreateServiceIdRequest by calling from_dict on the json representation + api_key_inside_create_service_id_request_model_dict = ApiKeyInsideCreateServiceIdRequest.from_dict( + api_key_inside_create_service_id_request_model_json ).__dict__ - account_settings_template_list_model2 = AccountSettingsTemplateList(**account_settings_template_list_model_dict) + api_key_inside_create_service_id_request_model2 = ApiKeyInsideCreateServiceIdRequest( + **api_key_inside_create_service_id_request_model_dict + ) # Verify the model instances are equivalent - assert account_settings_template_list_model == account_settings_template_list_model2 + assert api_key_inside_create_service_id_request_model == api_key_inside_create_service_id_request_model2 - # Convert model instance back to dict and verify no loss of data - account_settings_template_list_model_json2 = account_settings_template_list_model.to_dict() - assert account_settings_template_list_model_json2 == account_settings_template_list_model_json + # Convert model instance back to dict and verify no loss of data + api_key_inside_create_service_id_request_model_json2 = api_key_inside_create_service_id_request_model.to_dict() + assert ( + api_key_inside_create_service_id_request_model_json2 == api_key_inside_create_service_id_request_model_json + ) -class TestModel_AccountSettingsTemplateResponse: +class TestModel_ApiKeyList: """ - Test Class for AccountSettingsTemplateResponse + Test Class for ApiKeyList """ - def test_account_settings_template_response_serialization(self): + def test_api_key_list_serialization(self): """ - Test serialization/deserialization for AccountSettingsTemplateResponse + Test serialization/deserialization for ApiKeyList """ # Construct dict forms of any model objects needed in order to build this model. - user_mfa_model = {} # UserMfa - user_mfa_model['iam_id'] = 'testString' - user_mfa_model['mfa'] = 'NONE' - - account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction - account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model['restrict_invitation'] = True - - template_account_settings_restrict_user_domains_model = {} # TemplateAccountSettingsRestrictUserDomains - template_account_settings_restrict_user_domains_model['account_sufficient'] = True - template_account_settings_restrict_user_domains_model['restrictions'] = [ - account_settings_user_domain_restriction_model - ] - - template_account_settings_model = {} # TemplateAccountSettings - template_account_settings_model['restrict_create_service_id'] = 'NOT_SET' - template_account_settings_model['restrict_create_platform_apikey'] = 'NOT_SET' - template_account_settings_model['allowed_ip_addresses'] = 'testString' - template_account_settings_model['mfa'] = 'NONE' - template_account_settings_model['user_mfa'] = [user_mfa_model] - template_account_settings_model['session_expiration_in_seconds'] = '86400' - template_account_settings_model['session_invalidation_in_seconds'] = '7200' - template_account_settings_model['max_sessions_per_identity'] = 'testString' - template_account_settings_model['system_access_token_expiration_in_seconds'] = '3600' - template_account_settings_model['system_refresh_token_expiration_in_seconds'] = '259200' - template_account_settings_model['restrict_user_list_visibility'] = 'RESTRICTED' - template_account_settings_model['restrict_user_domains'] = template_account_settings_restrict_user_domains_model + response_context_model = {} # ResponseContext + response_context_model['transaction_id'] = 'testString' + response_context_model['operation'] = 'testString' + response_context_model['user_agent'] = 'testString' + response_context_model['url'] = 'testString' + response_context_model['instance_id'] = 'testString' + response_context_model['thread_id'] = 'testString' + response_context_model['host'] = 'testString' + response_context_model['start_time'] = 'testString' + response_context_model['end_time'] = 'testString' + response_context_model['elapsed_time'] = 'testString' + response_context_model['cluster_name'] = 'testString' enity_history_record_model = {} # EnityHistoryRecord enity_history_record_model['timestamp'] = 'testString' @@ -10395,672 +13187,781 @@ def test_account_settings_template_response_serialization(self): enity_history_record_model['params'] = ['testString'] enity_history_record_model['message'] = 'testString' - # Construct a json representation of a AccountSettingsTemplateResponse model - account_settings_template_response_model_json = {} - account_settings_template_response_model_json['id'] = 'testString' - account_settings_template_response_model_json['version'] = 26 - account_settings_template_response_model_json['account_id'] = 'testString' - account_settings_template_response_model_json['name'] = 'testString' - account_settings_template_response_model_json['description'] = 'testString' - account_settings_template_response_model_json['committed'] = True - account_settings_template_response_model_json['account_settings'] = template_account_settings_model - account_settings_template_response_model_json['history'] = [enity_history_record_model] - account_settings_template_response_model_json['entity_tag'] = 'testString' - account_settings_template_response_model_json['crn'] = 'testString' - account_settings_template_response_model_json['created_at'] = 'testString' - account_settings_template_response_model_json['created_by_id'] = 'testString' - account_settings_template_response_model_json['last_modified_at'] = 'testString' - account_settings_template_response_model_json['last_modified_by_id'] = 'testString' + activity_model = {} # Activity + activity_model['last_authn'] = 'testString' + activity_model['authn_count'] = 26 - # Construct a model instance of AccountSettingsTemplateResponse by calling from_dict on the json representation - account_settings_template_response_model = AccountSettingsTemplateResponse.from_dict( - account_settings_template_response_model_json - ) - assert account_settings_template_response_model != False + api_key_model = {} # ApiKey + api_key_model['context'] = response_context_model + api_key_model['id'] = 'testString' + api_key_model['entity_tag'] = 'testString' + api_key_model['crn'] = 'testString' + api_key_model['locked'] = True + api_key_model['disabled'] = True + api_key_model['created_at'] = '2019-01-01T12:00:00Z' + api_key_model['created_by'] = 'testString' + api_key_model['modified_at'] = '2019-01-01T12:00:00Z' + api_key_model['name'] = 'testString' + api_key_model['support_sessions'] = True + api_key_model['action_when_leaked'] = 'testString' + api_key_model['expires_at'] = 'testString' + api_key_model['description'] = 'testString' + api_key_model['iam_id'] = 'testString' + api_key_model['account_id'] = 'testString' + api_key_model['apikey'] = 'testString' + api_key_model['history'] = [enity_history_record_model] + api_key_model['activity'] = activity_model - # Construct a model instance of AccountSettingsTemplateResponse by calling from_dict on the json representation - account_settings_template_response_model_dict = AccountSettingsTemplateResponse.from_dict( - account_settings_template_response_model_json - ).__dict__ - account_settings_template_response_model2 = AccountSettingsTemplateResponse( - **account_settings_template_response_model_dict - ) + # Construct a json representation of a ApiKeyList model + api_key_list_model_json = {} + api_key_list_model_json['context'] = response_context_model + api_key_list_model_json['offset'] = 26 + api_key_list_model_json['limit'] = 26 + api_key_list_model_json['first'] = 'testString' + api_key_list_model_json['previous'] = 'testString' + api_key_list_model_json['next'] = 'testString' + api_key_list_model_json['apikeys'] = [api_key_model] + + # Construct a model instance of ApiKeyList by calling from_dict on the json representation + api_key_list_model = ApiKeyList.from_dict(api_key_list_model_json) + assert api_key_list_model != False + + # Construct a model instance of ApiKeyList by calling from_dict on the json representation + api_key_list_model_dict = ApiKeyList.from_dict(api_key_list_model_json).__dict__ + api_key_list_model2 = ApiKeyList(**api_key_list_model_dict) # Verify the model instances are equivalent - assert account_settings_template_response_model == account_settings_template_response_model2 + assert api_key_list_model == api_key_list_model2 # Convert model instance back to dict and verify no loss of data - account_settings_template_response_model_json2 = account_settings_template_response_model.to_dict() - assert account_settings_template_response_model_json2 == account_settings_template_response_model_json + api_key_list_model_json2 = api_key_list_model.to_dict() + assert api_key_list_model_json2 == api_key_list_model_json -class TestModel_AccountSettingsUserDomainRestriction: +class TestModel_ApikeyActivity: """ - Test Class for AccountSettingsUserDomainRestriction + Test Class for ApikeyActivity """ - def test_account_settings_user_domain_restriction_serialization(self): + def test_apikey_activity_serialization(self): """ - Test serialization/deserialization for AccountSettingsUserDomainRestriction + Test serialization/deserialization for ApikeyActivity """ - # Construct a json representation of a AccountSettingsUserDomainRestriction model - account_settings_user_domain_restriction_model_json = {} - account_settings_user_domain_restriction_model_json['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model_json['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model_json['restrict_invitation'] = True + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of AccountSettingsUserDomainRestriction by calling from_dict on the json representation - account_settings_user_domain_restriction_model = AccountSettingsUserDomainRestriction.from_dict( - account_settings_user_domain_restriction_model_json - ) - assert account_settings_user_domain_restriction_model != False + apikey_activity_serviceid_model = {} # ApikeyActivityServiceid + apikey_activity_serviceid_model['id'] = 'testString' + apikey_activity_serviceid_model['name'] = 'testString' - # Construct a model instance of AccountSettingsUserDomainRestriction by calling from_dict on the json representation - account_settings_user_domain_restriction_model_dict = AccountSettingsUserDomainRestriction.from_dict( - account_settings_user_domain_restriction_model_json - ).__dict__ - account_settings_user_domain_restriction_model2 = AccountSettingsUserDomainRestriction( - **account_settings_user_domain_restriction_model_dict - ) + apikey_activity_user_model = {} # ApikeyActivityUser + apikey_activity_user_model['iam_id'] = 'testString' + apikey_activity_user_model['name'] = 'testString' + apikey_activity_user_model['username'] = 'testString' + apikey_activity_user_model['email'] = 'testString' + + # Construct a json representation of a ApikeyActivity model + apikey_activity_model_json = {} + apikey_activity_model_json['id'] = 'testString' + apikey_activity_model_json['name'] = 'testString' + apikey_activity_model_json['type'] = 'testString' + apikey_activity_model_json['serviceid'] = apikey_activity_serviceid_model + apikey_activity_model_json['user'] = apikey_activity_user_model + apikey_activity_model_json['last_authn'] = 'testString' + + # Construct a model instance of ApikeyActivity by calling from_dict on the json representation + apikey_activity_model = ApikeyActivity.from_dict(apikey_activity_model_json) + assert apikey_activity_model != False + + # Construct a model instance of ApikeyActivity by calling from_dict on the json representation + apikey_activity_model_dict = ApikeyActivity.from_dict(apikey_activity_model_json).__dict__ + apikey_activity_model2 = ApikeyActivity(**apikey_activity_model_dict) # Verify the model instances are equivalent - assert account_settings_user_domain_restriction_model == account_settings_user_domain_restriction_model2 + assert apikey_activity_model == apikey_activity_model2 # Convert model instance back to dict and verify no loss of data - account_settings_user_domain_restriction_model_json2 = account_settings_user_domain_restriction_model.to_dict() - assert ( - account_settings_user_domain_restriction_model_json2 == account_settings_user_domain_restriction_model_json - ) + apikey_activity_model_json2 = apikey_activity_model.to_dict() + assert apikey_activity_model_json2 == apikey_activity_model_json -class TestModel_AccountSettingsUserMFAResponse: +class TestModel_ApikeyActivityServiceid: """ - Test Class for AccountSettingsUserMFAResponse + Test Class for ApikeyActivityServiceid """ - def test_account_settings_user_mfa_response_serialization(self): + def test_apikey_activity_serviceid_serialization(self): """ - Test serialization/deserialization for AccountSettingsUserMFAResponse + Test serialization/deserialization for ApikeyActivityServiceid """ - # Construct a json representation of a AccountSettingsUserMFAResponse model - account_settings_user_mfa_response_model_json = {} - account_settings_user_mfa_response_model_json['iam_id'] = 'testString' - account_settings_user_mfa_response_model_json['mfa'] = 'NONE' - account_settings_user_mfa_response_model_json['name'] = 'testString' - account_settings_user_mfa_response_model_json['userName'] = 'testString' - account_settings_user_mfa_response_model_json['email'] = 'testString' - account_settings_user_mfa_response_model_json['description'] = 'testString' + # Construct a json representation of a ApikeyActivityServiceid model + apikey_activity_serviceid_model_json = {} + apikey_activity_serviceid_model_json['id'] = 'testString' + apikey_activity_serviceid_model_json['name'] = 'testString' - # Construct a model instance of AccountSettingsUserMFAResponse by calling from_dict on the json representation - account_settings_user_mfa_response_model = AccountSettingsUserMFAResponse.from_dict( - account_settings_user_mfa_response_model_json - ) - assert account_settings_user_mfa_response_model != False + # Construct a model instance of ApikeyActivityServiceid by calling from_dict on the json representation + apikey_activity_serviceid_model = ApikeyActivityServiceid.from_dict(apikey_activity_serviceid_model_json) + assert apikey_activity_serviceid_model != False - # Construct a model instance of AccountSettingsUserMFAResponse by calling from_dict on the json representation - account_settings_user_mfa_response_model_dict = AccountSettingsUserMFAResponse.from_dict( - account_settings_user_mfa_response_model_json + # Construct a model instance of ApikeyActivityServiceid by calling from_dict on the json representation + apikey_activity_serviceid_model_dict = ApikeyActivityServiceid.from_dict( + apikey_activity_serviceid_model_json ).__dict__ - account_settings_user_mfa_response_model2 = AccountSettingsUserMFAResponse( - **account_settings_user_mfa_response_model_dict - ) + apikey_activity_serviceid_model2 = ApikeyActivityServiceid(**apikey_activity_serviceid_model_dict) + + # Verify the model instances are equivalent + assert apikey_activity_serviceid_model == apikey_activity_serviceid_model2 + + # Convert model instance back to dict and verify no loss of data + apikey_activity_serviceid_model_json2 = apikey_activity_serviceid_model.to_dict() + assert apikey_activity_serviceid_model_json2 == apikey_activity_serviceid_model_json + + +class TestModel_ApikeyActivityUser: + """ + Test Class for ApikeyActivityUser + """ + + def test_apikey_activity_user_serialization(self): + """ + Test serialization/deserialization for ApikeyActivityUser + """ + + # Construct a json representation of a ApikeyActivityUser model + apikey_activity_user_model_json = {} + apikey_activity_user_model_json['iam_id'] = 'testString' + apikey_activity_user_model_json['name'] = 'testString' + apikey_activity_user_model_json['username'] = 'testString' + apikey_activity_user_model_json['email'] = 'testString' + + # Construct a model instance of ApikeyActivityUser by calling from_dict on the json representation + apikey_activity_user_model = ApikeyActivityUser.from_dict(apikey_activity_user_model_json) + assert apikey_activity_user_model != False + + # Construct a model instance of ApikeyActivityUser by calling from_dict on the json representation + apikey_activity_user_model_dict = ApikeyActivityUser.from_dict(apikey_activity_user_model_json).__dict__ + apikey_activity_user_model2 = ApikeyActivityUser(**apikey_activity_user_model_dict) # Verify the model instances are equivalent - assert account_settings_user_mfa_response_model == account_settings_user_mfa_response_model2 + assert apikey_activity_user_model == apikey_activity_user_model2 # Convert model instance back to dict and verify no loss of data - account_settings_user_mfa_response_model_json2 = account_settings_user_mfa_response_model.to_dict() - assert account_settings_user_mfa_response_model_json2 == account_settings_user_mfa_response_model_json + apikey_activity_user_model_json2 = apikey_activity_user_model.to_dict() + assert apikey_activity_user_model_json2 == apikey_activity_user_model_json -class TestModel_ActionControls: +class TestModel_AssignedTemplatesAccountSettingsRestrictUserDomains: """ - Test Class for ActionControls + Test Class for AssignedTemplatesAccountSettingsRestrictUserDomains """ - def test_action_controls_serialization(self): + def test_assigned_templates_account_settings_restrict_user_domains_serialization(self): """ - Test serialization/deserialization for ActionControls + Test serialization/deserialization for AssignedTemplatesAccountSettingsRestrictUserDomains """ # Construct dict forms of any model objects needed in order to build this model. - action_controls_identities_model = {} # ActionControlsIdentities - action_controls_identities_model['add'] = True - action_controls_identities_model['remove'] = True - - action_controls_rules_model = {} # ActionControlsRules - action_controls_rules_model['add'] = True - action_controls_rules_model['remove'] = True - - action_controls_policies_model = {} # ActionControlsPolicies - action_controls_policies_model['add'] = True - action_controls_policies_model['remove'] = True + account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction + account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' + account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] + account_settings_user_domain_restriction_model['restrict_invitation'] = True - # Construct a json representation of a ActionControls model - action_controls_model_json = {} - action_controls_model_json['identities'] = action_controls_identities_model - action_controls_model_json['rules'] = action_controls_rules_model - action_controls_model_json['policies'] = action_controls_policies_model + # Construct a json representation of a AssignedTemplatesAccountSettingsRestrictUserDomains model + assigned_templates_account_settings_restrict_user_domains_model_json = {} + assigned_templates_account_settings_restrict_user_domains_model_json['account_sufficient'] = True + assigned_templates_account_settings_restrict_user_domains_model_json['restrictions'] = [ + account_settings_user_domain_restriction_model + ] - # Construct a model instance of ActionControls by calling from_dict on the json representation - action_controls_model = ActionControls.from_dict(action_controls_model_json) - assert action_controls_model != False + # Construct a model instance of AssignedTemplatesAccountSettingsRestrictUserDomains by calling from_dict on the json representation + assigned_templates_account_settings_restrict_user_domains_model = ( + AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( + assigned_templates_account_settings_restrict_user_domains_model_json + ) + ) + assert assigned_templates_account_settings_restrict_user_domains_model != False - # Construct a model instance of ActionControls by calling from_dict on the json representation - action_controls_model_dict = ActionControls.from_dict(action_controls_model_json).__dict__ - action_controls_model2 = ActionControls(**action_controls_model_dict) + # Construct a model instance of AssignedTemplatesAccountSettingsRestrictUserDomains by calling from_dict on the json representation + assigned_templates_account_settings_restrict_user_domains_model_dict = ( + AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( + assigned_templates_account_settings_restrict_user_domains_model_json + ).__dict__ + ) + assigned_templates_account_settings_restrict_user_domains_model2 = ( + AssignedTemplatesAccountSettingsRestrictUserDomains( + **assigned_templates_account_settings_restrict_user_domains_model_dict + ) + ) # Verify the model instances are equivalent - assert action_controls_model == action_controls_model2 + assert ( + assigned_templates_account_settings_restrict_user_domains_model + == assigned_templates_account_settings_restrict_user_domains_model2 + ) # Convert model instance back to dict and verify no loss of data - action_controls_model_json2 = action_controls_model.to_dict() - assert action_controls_model_json2 == action_controls_model_json + assigned_templates_account_settings_restrict_user_domains_model_json2 = ( + assigned_templates_account_settings_restrict_user_domains_model.to_dict() + ) + assert ( + assigned_templates_account_settings_restrict_user_domains_model_json2 + == assigned_templates_account_settings_restrict_user_domains_model_json + ) -class TestModel_ActionControlsIdentities: +class TestModel_ConsumersResponse: """ - Test Class for ActionControlsIdentities + Test Class for ConsumersResponse """ - def test_action_controls_identities_serialization(self): + def test_consumers_response_serialization(self): """ - Test serialization/deserialization for ActionControlsIdentities + Test serialization/deserialization for ConsumersResponse """ - # Construct a json representation of a ActionControlsIdentities model - action_controls_identities_model_json = {} - action_controls_identities_model_json['add'] = True - action_controls_identities_model_json['remove'] = True + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of ActionControlsIdentities by calling from_dict on the json representation - action_controls_identities_model = ActionControlsIdentities.from_dict(action_controls_identities_model_json) - assert action_controls_identities_model != False + share_scope_model = {} # ShareScope + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' - # Construct a model instance of ActionControlsIdentities by calling from_dict on the json representation - action_controls_identities_model_dict = ActionControlsIdentities.from_dict( - action_controls_identities_model_json - ).__dict__ - action_controls_identities_model2 = ActionControlsIdentities(**action_controls_identities_model_dict) + consumers_response_consumers_item_model = {} # ConsumersResponseConsumersItem + consumers_response_consumers_item_model['account_id'] = 'testString' + consumers_response_consumers_item_model['share_scope'] = [share_scope_model] + + # Construct a json representation of a ConsumersResponse model + consumers_response_model_json = {} + consumers_response_model_json['idp_id'] = 'testString' + consumers_response_model_json['consumers'] = [consumers_response_consumers_item_model] + + # Construct a model instance of ConsumersResponse by calling from_dict on the json representation + consumers_response_model = ConsumersResponse.from_dict(consumers_response_model_json) + assert consumers_response_model != False + + # Construct a model instance of ConsumersResponse by calling from_dict on the json representation + consumers_response_model_dict = ConsumersResponse.from_dict(consumers_response_model_json).__dict__ + consumers_response_model2 = ConsumersResponse(**consumers_response_model_dict) # Verify the model instances are equivalent - assert action_controls_identities_model == action_controls_identities_model2 + assert consumers_response_model == consumers_response_model2 # Convert model instance back to dict and verify no loss of data - action_controls_identities_model_json2 = action_controls_identities_model.to_dict() - assert action_controls_identities_model_json2 == action_controls_identities_model_json + consumers_response_model_json2 = consumers_response_model.to_dict() + assert consumers_response_model_json2 == consumers_response_model_json -class TestModel_ActionControlsPolicies: +class TestModel_ConsumersResponseConsumersItem: """ - Test Class for ActionControlsPolicies + Test Class for ConsumersResponseConsumersItem """ - def test_action_controls_policies_serialization(self): + def test_consumers_response_consumers_item_serialization(self): """ - Test serialization/deserialization for ActionControlsPolicies + Test serialization/deserialization for ConsumersResponseConsumersItem """ - # Construct a json representation of a ActionControlsPolicies model - action_controls_policies_model_json = {} - action_controls_policies_model_json['add'] = True - action_controls_policies_model_json['remove'] = True + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of ActionControlsPolicies by calling from_dict on the json representation - action_controls_policies_model = ActionControlsPolicies.from_dict(action_controls_policies_model_json) - assert action_controls_policies_model != False + share_scope_model = {} # ShareScope + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' - # Construct a model instance of ActionControlsPolicies by calling from_dict on the json representation - action_controls_policies_model_dict = ActionControlsPolicies.from_dict( - action_controls_policies_model_json + # Construct a json representation of a ConsumersResponseConsumersItem model + consumers_response_consumers_item_model_json = {} + consumers_response_consumers_item_model_json['account_id'] = 'testString' + consumers_response_consumers_item_model_json['share_scope'] = [share_scope_model] + + # Construct a model instance of ConsumersResponseConsumersItem by calling from_dict on the json representation + consumers_response_consumers_item_model = ConsumersResponseConsumersItem.from_dict( + consumers_response_consumers_item_model_json + ) + assert consumers_response_consumers_item_model != False + + # Construct a model instance of ConsumersResponseConsumersItem by calling from_dict on the json representation + consumers_response_consumers_item_model_dict = ConsumersResponseConsumersItem.from_dict( + consumers_response_consumers_item_model_json ).__dict__ - action_controls_policies_model2 = ActionControlsPolicies(**action_controls_policies_model_dict) + consumers_response_consumers_item_model2 = ConsumersResponseConsumersItem( + **consumers_response_consumers_item_model_dict + ) # Verify the model instances are equivalent - assert action_controls_policies_model == action_controls_policies_model2 + assert consumers_response_consumers_item_model == consumers_response_consumers_item_model2 # Convert model instance back to dict and verify no loss of data - action_controls_policies_model_json2 = action_controls_policies_model.to_dict() - assert action_controls_policies_model_json2 == action_controls_policies_model_json + consumers_response_consumers_item_model_json2 = consumers_response_consumers_item_model.to_dict() + assert consumers_response_consumers_item_model_json2 == consumers_response_consumers_item_model_json -class TestModel_ActionControlsRules: +class TestModel_CreateIdpRequestProperties: """ - Test Class for ActionControlsRules + Test Class for CreateIdpRequestProperties """ - def test_action_controls_rules_serialization(self): + def test_create_idp_request_properties_serialization(self): """ - Test serialization/deserialization for ActionControlsRules + Test serialization/deserialization for CreateIdpRequestProperties """ - # Construct a json representation of a ActionControlsRules model - action_controls_rules_model_json = {} - action_controls_rules_model_json['add'] = True - action_controls_rules_model_json['remove'] = True - - # Construct a model instance of ActionControlsRules by calling from_dict on the json representation - action_controls_rules_model = ActionControlsRules.from_dict(action_controls_rules_model_json) - assert action_controls_rules_model != False + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of ActionControlsRules by calling from_dict on the json representation - action_controls_rules_model_dict = ActionControlsRules.from_dict(action_controls_rules_model_json).__dict__ - action_controls_rules_model2 = ActionControlsRules(**action_controls_rules_model_dict) + create_idp_request_properties_idp_model = {} # CreateIdpRequestPropertiesIdp + create_idp_request_properties_idp_model['xml_import'] = True + create_idp_request_properties_idp_model['entity_id'] = 'testString' + create_idp_request_properties_idp_model['redirect_binding_url'] = 'testString' + create_idp_request_properties_idp_model['want_request_signed'] = True + create_idp_request_properties_idp_model['logout_url'] = 'testString' + + create_idp_request_properties_sp_authn_context_model = {} # CreateIdpRequestPropertiesSpAuthnContext + create_idp_request_properties_sp_authn_context_model['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model['accept'] = ['testString'] + + create_idp_request_properties_sp_model = {} # CreateIdpRequestPropertiesSp + create_idp_request_properties_sp_model['want_assertion_signed'] = True + create_idp_request_properties_sp_model['want_response_signed'] = True + create_idp_request_properties_sp_model['encrypt_response'] = True + create_idp_request_properties_sp_model['idp_initiated_login_enabled'] = True + create_idp_request_properties_sp_model['logout_url_enabled_when_available'] = True + create_idp_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + create_idp_request_properties_sp_model['authn_context'] = create_idp_request_properties_sp_authn_context_model + create_idp_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a json representation of a CreateIdpRequestProperties model + create_idp_request_properties_model_json = {} + create_idp_request_properties_model_json['idp'] = create_idp_request_properties_idp_model + create_idp_request_properties_model_json['sp'] = create_idp_request_properties_sp_model + + # Construct a model instance of CreateIdpRequestProperties by calling from_dict on the json representation + create_idp_request_properties_model = CreateIdpRequestProperties.from_dict( + create_idp_request_properties_model_json + ) + assert create_idp_request_properties_model != False + + # Construct a model instance of CreateIdpRequestProperties by calling from_dict on the json representation + create_idp_request_properties_model_dict = CreateIdpRequestProperties.from_dict( + create_idp_request_properties_model_json + ).__dict__ + create_idp_request_properties_model2 = CreateIdpRequestProperties(**create_idp_request_properties_model_dict) # Verify the model instances are equivalent - assert action_controls_rules_model == action_controls_rules_model2 + assert create_idp_request_properties_model == create_idp_request_properties_model2 # Convert model instance back to dict and verify no loss of data - action_controls_rules_model_json2 = action_controls_rules_model.to_dict() - assert action_controls_rules_model_json2 == action_controls_rules_model_json + create_idp_request_properties_model_json2 = create_idp_request_properties_model.to_dict() + assert create_idp_request_properties_model_json2 == create_idp_request_properties_model_json -class TestModel_Activity: +class TestModel_CreateIdpRequestPropertiesIdp: """ - Test Class for Activity + Test Class for CreateIdpRequestPropertiesIdp """ - def test_activity_serialization(self): + def test_create_idp_request_properties_idp_serialization(self): """ - Test serialization/deserialization for Activity + Test serialization/deserialization for CreateIdpRequestPropertiesIdp """ - # Construct a json representation of a Activity model - activity_model_json = {} - activity_model_json['last_authn'] = 'testString' - activity_model_json['authn_count'] = 26 + # Construct a json representation of a CreateIdpRequestPropertiesIdp model + create_idp_request_properties_idp_model_json = {} + create_idp_request_properties_idp_model_json['xml_import'] = True + create_idp_request_properties_idp_model_json['entity_id'] = 'testString' + create_idp_request_properties_idp_model_json['redirect_binding_url'] = 'testString' + create_idp_request_properties_idp_model_json['want_request_signed'] = True + create_idp_request_properties_idp_model_json['logout_url'] = 'testString' - # Construct a model instance of Activity by calling from_dict on the json representation - activity_model = Activity.from_dict(activity_model_json) - assert activity_model != False + # Construct a model instance of CreateIdpRequestPropertiesIdp by calling from_dict on the json representation + create_idp_request_properties_idp_model = CreateIdpRequestPropertiesIdp.from_dict( + create_idp_request_properties_idp_model_json + ) + assert create_idp_request_properties_idp_model != False - # Construct a model instance of Activity by calling from_dict on the json representation - activity_model_dict = Activity.from_dict(activity_model_json).__dict__ - activity_model2 = Activity(**activity_model_dict) + # Construct a model instance of CreateIdpRequestPropertiesIdp by calling from_dict on the json representation + create_idp_request_properties_idp_model_dict = CreateIdpRequestPropertiesIdp.from_dict( + create_idp_request_properties_idp_model_json + ).__dict__ + create_idp_request_properties_idp_model2 = CreateIdpRequestPropertiesIdp( + **create_idp_request_properties_idp_model_dict + ) # Verify the model instances are equivalent - assert activity_model == activity_model2 + assert create_idp_request_properties_idp_model == create_idp_request_properties_idp_model2 # Convert model instance back to dict and verify no loss of data - activity_model_json2 = activity_model.to_dict() - assert activity_model_json2 == activity_model_json + create_idp_request_properties_idp_model_json2 = create_idp_request_properties_idp_model.to_dict() + assert create_idp_request_properties_idp_model_json2 == create_idp_request_properties_idp_model_json -class TestModel_ApiKey: +class TestModel_CreateIdpRequestPropertiesSp: """ - Test Class for ApiKey + Test Class for CreateIdpRequestPropertiesSp """ - def test_api_key_serialization(self): + def test_create_idp_request_properties_sp_serialization(self): """ - Test serialization/deserialization for ApiKey + Test serialization/deserialization for CreateIdpRequestPropertiesSp """ # Construct dict forms of any model objects needed in order to build this model. - response_context_model = {} # ResponseContext - response_context_model['transaction_id'] = 'testString' - response_context_model['operation'] = 'testString' - response_context_model['user_agent'] = 'testString' - response_context_model['url'] = 'testString' - response_context_model['instance_id'] = 'testString' - response_context_model['thread_id'] = 'testString' - response_context_model['host'] = 'testString' - response_context_model['start_time'] = 'testString' - response_context_model['end_time'] = 'testString' - response_context_model['elapsed_time'] = 'testString' - response_context_model['cluster_name'] = 'testString' - - enity_history_record_model = {} # EnityHistoryRecord - enity_history_record_model['timestamp'] = 'testString' - enity_history_record_model['iam_id'] = 'testString' - enity_history_record_model['iam_id_account'] = 'testString' - enity_history_record_model['action'] = 'testString' - enity_history_record_model['params'] = ['testString'] - enity_history_record_model['message'] = 'testString' - - activity_model = {} # Activity - activity_model['last_authn'] = 'testString' - activity_model['authn_count'] = 26 + create_idp_request_properties_sp_authn_context_model = {} # CreateIdpRequestPropertiesSpAuthnContext + create_idp_request_properties_sp_authn_context_model['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model['accept'] = ['testString'] - # Construct a json representation of a ApiKey model - api_key_model_json = {} - api_key_model_json['context'] = response_context_model - api_key_model_json['id'] = 'testString' - api_key_model_json['entity_tag'] = 'testString' - api_key_model_json['crn'] = 'testString' - api_key_model_json['locked'] = True - api_key_model_json['disabled'] = True - api_key_model_json['created_at'] = '2019-01-01T12:00:00Z' - api_key_model_json['created_by'] = 'testString' - api_key_model_json['modified_at'] = '2019-01-01T12:00:00Z' - api_key_model_json['name'] = 'testString' - api_key_model_json['support_sessions'] = True - api_key_model_json['action_when_leaked'] = 'testString' - api_key_model_json['expires_at'] = 'testString' - api_key_model_json['description'] = 'testString' - api_key_model_json['iam_id'] = 'testString' - api_key_model_json['account_id'] = 'testString' - api_key_model_json['apikey'] = 'testString' - api_key_model_json['history'] = [enity_history_record_model] - api_key_model_json['activity'] = activity_model + # Construct a json representation of a CreateIdpRequestPropertiesSp model + create_idp_request_properties_sp_model_json = {} + create_idp_request_properties_sp_model_json['want_assertion_signed'] = True + create_idp_request_properties_sp_model_json['want_response_signed'] = True + create_idp_request_properties_sp_model_json['encrypt_response'] = True + create_idp_request_properties_sp_model_json['idp_initiated_login_enabled'] = True + create_idp_request_properties_sp_model_json['logout_url_enabled_when_available'] = True + create_idp_request_properties_sp_model_json['idp_initiated_urls'] = ['testString'] + create_idp_request_properties_sp_model_json['authn_context'] = ( + create_idp_request_properties_sp_authn_context_model + ) + create_idp_request_properties_sp_model_json['claims'] = {'key1': 'testString'} - # Construct a model instance of ApiKey by calling from_dict on the json representation - api_key_model = ApiKey.from_dict(api_key_model_json) - assert api_key_model != False + # Construct a model instance of CreateIdpRequestPropertiesSp by calling from_dict on the json representation + create_idp_request_properties_sp_model = CreateIdpRequestPropertiesSp.from_dict( + create_idp_request_properties_sp_model_json + ) + assert create_idp_request_properties_sp_model != False - # Construct a model instance of ApiKey by calling from_dict on the json representation - api_key_model_dict = ApiKey.from_dict(api_key_model_json).__dict__ - api_key_model2 = ApiKey(**api_key_model_dict) + # Construct a model instance of CreateIdpRequestPropertiesSp by calling from_dict on the json representation + create_idp_request_properties_sp_model_dict = CreateIdpRequestPropertiesSp.from_dict( + create_idp_request_properties_sp_model_json + ).__dict__ + create_idp_request_properties_sp_model2 = CreateIdpRequestPropertiesSp( + **create_idp_request_properties_sp_model_dict + ) # Verify the model instances are equivalent - assert api_key_model == api_key_model2 + assert create_idp_request_properties_sp_model == create_idp_request_properties_sp_model2 # Convert model instance back to dict and verify no loss of data - api_key_model_json2 = api_key_model.to_dict() - assert api_key_model_json2 == api_key_model_json + create_idp_request_properties_sp_model_json2 = create_idp_request_properties_sp_model.to_dict() + assert create_idp_request_properties_sp_model_json2 == create_idp_request_properties_sp_model_json -class TestModel_ApiKeyInsideCreateServiceIdRequest: +class TestModel_CreateIdpRequestPropertiesSpAuthnContext: """ - Test Class for ApiKeyInsideCreateServiceIdRequest + Test Class for CreateIdpRequestPropertiesSpAuthnContext """ - def test_api_key_inside_create_service_id_request_serialization(self): + def test_create_idp_request_properties_sp_authn_context_serialization(self): """ - Test serialization/deserialization for ApiKeyInsideCreateServiceIdRequest + Test serialization/deserialization for CreateIdpRequestPropertiesSpAuthnContext """ - # Construct a json representation of a ApiKeyInsideCreateServiceIdRequest model - api_key_inside_create_service_id_request_model_json = {} - api_key_inside_create_service_id_request_model_json['name'] = 'testString' - api_key_inside_create_service_id_request_model_json['description'] = 'testString' - api_key_inside_create_service_id_request_model_json['apikey'] = 'testString' - api_key_inside_create_service_id_request_model_json['store_value'] = True - api_key_inside_create_service_id_request_model_json['action_when_leaked'] = 'testString' - api_key_inside_create_service_id_request_model_json['expires_at'] = 'testString' + # Construct a json representation of a CreateIdpRequestPropertiesSpAuthnContext model + create_idp_request_properties_sp_authn_context_model_json = {} + create_idp_request_properties_sp_authn_context_model_json['request'] = ['testString'] + create_idp_request_properties_sp_authn_context_model_json['accept'] = ['testString'] - # Construct a model instance of ApiKeyInsideCreateServiceIdRequest by calling from_dict on the json representation - api_key_inside_create_service_id_request_model = ApiKeyInsideCreateServiceIdRequest.from_dict( - api_key_inside_create_service_id_request_model_json + # Construct a model instance of CreateIdpRequestPropertiesSpAuthnContext by calling from_dict on the json representation + create_idp_request_properties_sp_authn_context_model = CreateIdpRequestPropertiesSpAuthnContext.from_dict( + create_idp_request_properties_sp_authn_context_model_json ) - assert api_key_inside_create_service_id_request_model != False + assert create_idp_request_properties_sp_authn_context_model != False - # Construct a model instance of ApiKeyInsideCreateServiceIdRequest by calling from_dict on the json representation - api_key_inside_create_service_id_request_model_dict = ApiKeyInsideCreateServiceIdRequest.from_dict( - api_key_inside_create_service_id_request_model_json + # Construct a model instance of CreateIdpRequestPropertiesSpAuthnContext by calling from_dict on the json representation + create_idp_request_properties_sp_authn_context_model_dict = CreateIdpRequestPropertiesSpAuthnContext.from_dict( + create_idp_request_properties_sp_authn_context_model_json ).__dict__ - api_key_inside_create_service_id_request_model2 = ApiKeyInsideCreateServiceIdRequest( - **api_key_inside_create_service_id_request_model_dict + create_idp_request_properties_sp_authn_context_model2 = CreateIdpRequestPropertiesSpAuthnContext( + **create_idp_request_properties_sp_authn_context_model_dict ) # Verify the model instances are equivalent - assert api_key_inside_create_service_id_request_model == api_key_inside_create_service_id_request_model2 + assert ( + create_idp_request_properties_sp_authn_context_model + == create_idp_request_properties_sp_authn_context_model2 + ) # Convert model instance back to dict and verify no loss of data - api_key_inside_create_service_id_request_model_json2 = api_key_inside_create_service_id_request_model.to_dict() + create_idp_request_properties_sp_authn_context_model_json2 = ( + create_idp_request_properties_sp_authn_context_model.to_dict() + ) assert ( - api_key_inside_create_service_id_request_model_json2 == api_key_inside_create_service_id_request_model_json + create_idp_request_properties_sp_authn_context_model_json2 + == create_idp_request_properties_sp_authn_context_model_json ) -class TestModel_ApiKeyList: +class TestModel_CreateIdpRequestSecrets: """ - Test Class for ApiKeyList + Test Class for CreateIdpRequestSecrets """ - def test_api_key_list_serialization(self): + def test_create_idp_request_secrets_serialization(self): """ - Test serialization/deserialization for ApiKeyList + Test serialization/deserialization for CreateIdpRequestSecrets """ # Construct dict forms of any model objects needed in order to build this model. - response_context_model = {} # ResponseContext - response_context_model['transaction_id'] = 'testString' - response_context_model['operation'] = 'testString' - response_context_model['user_agent'] = 'testString' - response_context_model['url'] = 'testString' - response_context_model['instance_id'] = 'testString' - response_context_model['thread_id'] = 'testString' - response_context_model['host'] = 'testString' - response_context_model['start_time'] = 'testString' - response_context_model['end_time'] = 'testString' - response_context_model['elapsed_time'] = 'testString' - response_context_model['cluster_name'] = 'testString' + create_idp_request_secrets_idp_signing_item_model = {} # CreateIdpRequestSecretsIdpSigningItem + create_idp_request_secrets_idp_signing_item_model['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model['type'] = 'primary' - enity_history_record_model = {} # EnityHistoryRecord - enity_history_record_model['timestamp'] = 'testString' - enity_history_record_model['iam_id'] = 'testString' - enity_history_record_model['iam_id_account'] = 'testString' - enity_history_record_model['action'] = 'testString' - enity_history_record_model['params'] = ['testString'] - enity_history_record_model['message'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model = {} # CreateIdpRequestSecretsIdpEncryptingItem + create_idp_request_secrets_idp_encrypting_item_model['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model['type'] = 'primary' - activity_model = {} # Activity - activity_model['last_authn'] = 'testString' - activity_model['authn_count'] = 26 + create_idp_request_secrets_idp_model = {} # CreateIdpRequestSecretsIdp + create_idp_request_secrets_idp_model['xml_import'] = True + create_idp_request_secrets_idp_model['signing'] = [create_idp_request_secrets_idp_signing_item_model] + create_idp_request_secrets_idp_model['encrypting'] = [create_idp_request_secrets_idp_encrypting_item_model] - api_key_model = {} # ApiKey - api_key_model['context'] = response_context_model - api_key_model['id'] = 'testString' - api_key_model['entity_tag'] = 'testString' - api_key_model['crn'] = 'testString' - api_key_model['locked'] = True - api_key_model['disabled'] = True - api_key_model['created_at'] = '2019-01-01T12:00:00Z' - api_key_model['created_by'] = 'testString' - api_key_model['modified_at'] = '2019-01-01T12:00:00Z' - api_key_model['name'] = 'testString' - api_key_model['support_sessions'] = True - api_key_model['action_when_leaked'] = 'testString' - api_key_model['expires_at'] = 'testString' - api_key_model['description'] = 'testString' - api_key_model['iam_id'] = 'testString' - api_key_model['account_id'] = 'testString' - api_key_model['apikey'] = 'testString' - api_key_model['history'] = [enity_history_record_model] - api_key_model['activity'] = activity_model + create_idp_request_secrets_sp_signing_item_model = {} # CreateIdpRequestSecretsSpSigningItem + create_idp_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['type'] = 'primary' - # Construct a json representation of a ApiKeyList model - api_key_list_model_json = {} - api_key_list_model_json['context'] = response_context_model - api_key_list_model_json['offset'] = 26 - api_key_list_model_json['limit'] = 26 - api_key_list_model_json['first'] = 'testString' - api_key_list_model_json['previous'] = 'testString' - api_key_list_model_json['next'] = 'testString' - api_key_list_model_json['apikeys'] = [api_key_model] + create_idp_request_secrets_sp_model = {} # CreateIdpRequestSecretsSp + create_idp_request_secrets_sp_model['signing'] = [create_idp_request_secrets_sp_signing_item_model] - # Construct a model instance of ApiKeyList by calling from_dict on the json representation - api_key_list_model = ApiKeyList.from_dict(api_key_list_model_json) - assert api_key_list_model != False + # Construct a json representation of a CreateIdpRequestSecrets model + create_idp_request_secrets_model_json = {} + create_idp_request_secrets_model_json['idp'] = create_idp_request_secrets_idp_model + create_idp_request_secrets_model_json['sp'] = create_idp_request_secrets_sp_model - # Construct a model instance of ApiKeyList by calling from_dict on the json representation - api_key_list_model_dict = ApiKeyList.from_dict(api_key_list_model_json).__dict__ - api_key_list_model2 = ApiKeyList(**api_key_list_model_dict) + # Construct a model instance of CreateIdpRequestSecrets by calling from_dict on the json representation + create_idp_request_secrets_model = CreateIdpRequestSecrets.from_dict(create_idp_request_secrets_model_json) + assert create_idp_request_secrets_model != False + + # Construct a model instance of CreateIdpRequestSecrets by calling from_dict on the json representation + create_idp_request_secrets_model_dict = CreateIdpRequestSecrets.from_dict( + create_idp_request_secrets_model_json + ).__dict__ + create_idp_request_secrets_model2 = CreateIdpRequestSecrets(**create_idp_request_secrets_model_dict) # Verify the model instances are equivalent - assert api_key_list_model == api_key_list_model2 + assert create_idp_request_secrets_model == create_idp_request_secrets_model2 # Convert model instance back to dict and verify no loss of data - api_key_list_model_json2 = api_key_list_model.to_dict() - assert api_key_list_model_json2 == api_key_list_model_json + create_idp_request_secrets_model_json2 = create_idp_request_secrets_model.to_dict() + assert create_idp_request_secrets_model_json2 == create_idp_request_secrets_model_json -class TestModel_ApikeyActivity: +class TestModel_CreateIdpRequestSecretsIdp: """ - Test Class for ApikeyActivity + Test Class for CreateIdpRequestSecretsIdp """ - def test_apikey_activity_serialization(self): + def test_create_idp_request_secrets_idp_serialization(self): """ - Test serialization/deserialization for ApikeyActivity + Test serialization/deserialization for CreateIdpRequestSecretsIdp """ # Construct dict forms of any model objects needed in order to build this model. - apikey_activity_serviceid_model = {} # ApikeyActivityServiceid - apikey_activity_serviceid_model['id'] = 'testString' - apikey_activity_serviceid_model['name'] = 'testString' + create_idp_request_secrets_idp_signing_item_model = {} # CreateIdpRequestSecretsIdpSigningItem + create_idp_request_secrets_idp_signing_item_model['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model['type'] = 'primary' - apikey_activity_user_model = {} # ApikeyActivityUser - apikey_activity_user_model['iam_id'] = 'testString' - apikey_activity_user_model['name'] = 'testString' - apikey_activity_user_model['username'] = 'testString' - apikey_activity_user_model['email'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model = {} # CreateIdpRequestSecretsIdpEncryptingItem + create_idp_request_secrets_idp_encrypting_item_model['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model['type'] = 'primary' - # Construct a json representation of a ApikeyActivity model - apikey_activity_model_json = {} - apikey_activity_model_json['id'] = 'testString' - apikey_activity_model_json['name'] = 'testString' - apikey_activity_model_json['type'] = 'testString' - apikey_activity_model_json['serviceid'] = apikey_activity_serviceid_model - apikey_activity_model_json['user'] = apikey_activity_user_model - apikey_activity_model_json['last_authn'] = 'testString' + # Construct a json representation of a CreateIdpRequestSecretsIdp model + create_idp_request_secrets_idp_model_json = {} + create_idp_request_secrets_idp_model_json['xml_import'] = True + create_idp_request_secrets_idp_model_json['signing'] = [create_idp_request_secrets_idp_signing_item_model] + create_idp_request_secrets_idp_model_json['encrypting'] = [create_idp_request_secrets_idp_encrypting_item_model] - # Construct a model instance of ApikeyActivity by calling from_dict on the json representation - apikey_activity_model = ApikeyActivity.from_dict(apikey_activity_model_json) - assert apikey_activity_model != False + # Construct a model instance of CreateIdpRequestSecretsIdp by calling from_dict on the json representation + create_idp_request_secrets_idp_model = CreateIdpRequestSecretsIdp.from_dict( + create_idp_request_secrets_idp_model_json + ) + assert create_idp_request_secrets_idp_model != False - # Construct a model instance of ApikeyActivity by calling from_dict on the json representation - apikey_activity_model_dict = ApikeyActivity.from_dict(apikey_activity_model_json).__dict__ - apikey_activity_model2 = ApikeyActivity(**apikey_activity_model_dict) + # Construct a model instance of CreateIdpRequestSecretsIdp by calling from_dict on the json representation + create_idp_request_secrets_idp_model_dict = CreateIdpRequestSecretsIdp.from_dict( + create_idp_request_secrets_idp_model_json + ).__dict__ + create_idp_request_secrets_idp_model2 = CreateIdpRequestSecretsIdp(**create_idp_request_secrets_idp_model_dict) # Verify the model instances are equivalent - assert apikey_activity_model == apikey_activity_model2 + assert create_idp_request_secrets_idp_model == create_idp_request_secrets_idp_model2 # Convert model instance back to dict and verify no loss of data - apikey_activity_model_json2 = apikey_activity_model.to_dict() - assert apikey_activity_model_json2 == apikey_activity_model_json + create_idp_request_secrets_idp_model_json2 = create_idp_request_secrets_idp_model.to_dict() + assert create_idp_request_secrets_idp_model_json2 == create_idp_request_secrets_idp_model_json -class TestModel_ApikeyActivityServiceid: +class TestModel_CreateIdpRequestSecretsIdpEncryptingItem: """ - Test Class for ApikeyActivityServiceid + Test Class for CreateIdpRequestSecretsIdpEncryptingItem """ - def test_apikey_activity_serviceid_serialization(self): + def test_create_idp_request_secrets_idp_encrypting_item_serialization(self): """ - Test serialization/deserialization for ApikeyActivityServiceid + Test serialization/deserialization for CreateIdpRequestSecretsIdpEncryptingItem """ - # Construct a json representation of a ApikeyActivityServiceid model - apikey_activity_serviceid_model_json = {} - apikey_activity_serviceid_model_json['id'] = 'testString' - apikey_activity_serviceid_model_json['name'] = 'testString' + # Construct a json representation of a CreateIdpRequestSecretsIdpEncryptingItem model + create_idp_request_secrets_idp_encrypting_item_model_json = {} + create_idp_request_secrets_idp_encrypting_item_model_json['value'] = 'testString' + create_idp_request_secrets_idp_encrypting_item_model_json['type'] = 'primary' - # Construct a model instance of ApikeyActivityServiceid by calling from_dict on the json representation - apikey_activity_serviceid_model = ApikeyActivityServiceid.from_dict(apikey_activity_serviceid_model_json) - assert apikey_activity_serviceid_model != False + # Construct a model instance of CreateIdpRequestSecretsIdpEncryptingItem by calling from_dict on the json representation + create_idp_request_secrets_idp_encrypting_item_model = CreateIdpRequestSecretsIdpEncryptingItem.from_dict( + create_idp_request_secrets_idp_encrypting_item_model_json + ) + assert create_idp_request_secrets_idp_encrypting_item_model != False - # Construct a model instance of ApikeyActivityServiceid by calling from_dict on the json representation - apikey_activity_serviceid_model_dict = ApikeyActivityServiceid.from_dict( - apikey_activity_serviceid_model_json + # Construct a model instance of CreateIdpRequestSecretsIdpEncryptingItem by calling from_dict on the json representation + create_idp_request_secrets_idp_encrypting_item_model_dict = CreateIdpRequestSecretsIdpEncryptingItem.from_dict( + create_idp_request_secrets_idp_encrypting_item_model_json ).__dict__ - apikey_activity_serviceid_model2 = ApikeyActivityServiceid(**apikey_activity_serviceid_model_dict) + create_idp_request_secrets_idp_encrypting_item_model2 = CreateIdpRequestSecretsIdpEncryptingItem( + **create_idp_request_secrets_idp_encrypting_item_model_dict + ) # Verify the model instances are equivalent - assert apikey_activity_serviceid_model == apikey_activity_serviceid_model2 + assert ( + create_idp_request_secrets_idp_encrypting_item_model + == create_idp_request_secrets_idp_encrypting_item_model2 + ) # Convert model instance back to dict and verify no loss of data - apikey_activity_serviceid_model_json2 = apikey_activity_serviceid_model.to_dict() - assert apikey_activity_serviceid_model_json2 == apikey_activity_serviceid_model_json + create_idp_request_secrets_idp_encrypting_item_model_json2 = ( + create_idp_request_secrets_idp_encrypting_item_model.to_dict() + ) + assert ( + create_idp_request_secrets_idp_encrypting_item_model_json2 + == create_idp_request_secrets_idp_encrypting_item_model_json + ) -class TestModel_ApikeyActivityUser: +class TestModel_CreateIdpRequestSecretsIdpSigningItem: """ - Test Class for ApikeyActivityUser + Test Class for CreateIdpRequestSecretsIdpSigningItem """ - def test_apikey_activity_user_serialization(self): + def test_create_idp_request_secrets_idp_signing_item_serialization(self): """ - Test serialization/deserialization for ApikeyActivityUser + Test serialization/deserialization for CreateIdpRequestSecretsIdpSigningItem """ - # Construct a json representation of a ApikeyActivityUser model - apikey_activity_user_model_json = {} - apikey_activity_user_model_json['iam_id'] = 'testString' - apikey_activity_user_model_json['name'] = 'testString' - apikey_activity_user_model_json['username'] = 'testString' - apikey_activity_user_model_json['email'] = 'testString' + # Construct a json representation of a CreateIdpRequestSecretsIdpSigningItem model + create_idp_request_secrets_idp_signing_item_model_json = {} + create_idp_request_secrets_idp_signing_item_model_json['value'] = 'testString' + create_idp_request_secrets_idp_signing_item_model_json['type'] = 'primary' - # Construct a model instance of ApikeyActivityUser by calling from_dict on the json representation - apikey_activity_user_model = ApikeyActivityUser.from_dict(apikey_activity_user_model_json) - assert apikey_activity_user_model != False + # Construct a model instance of CreateIdpRequestSecretsIdpSigningItem by calling from_dict on the json representation + create_idp_request_secrets_idp_signing_item_model = CreateIdpRequestSecretsIdpSigningItem.from_dict( + create_idp_request_secrets_idp_signing_item_model_json + ) + assert create_idp_request_secrets_idp_signing_item_model != False - # Construct a model instance of ApikeyActivityUser by calling from_dict on the json representation - apikey_activity_user_model_dict = ApikeyActivityUser.from_dict(apikey_activity_user_model_json).__dict__ - apikey_activity_user_model2 = ApikeyActivityUser(**apikey_activity_user_model_dict) + # Construct a model instance of CreateIdpRequestSecretsIdpSigningItem by calling from_dict on the json representation + create_idp_request_secrets_idp_signing_item_model_dict = CreateIdpRequestSecretsIdpSigningItem.from_dict( + create_idp_request_secrets_idp_signing_item_model_json + ).__dict__ + create_idp_request_secrets_idp_signing_item_model2 = CreateIdpRequestSecretsIdpSigningItem( + **create_idp_request_secrets_idp_signing_item_model_dict + ) # Verify the model instances are equivalent - assert apikey_activity_user_model == apikey_activity_user_model2 + assert create_idp_request_secrets_idp_signing_item_model == create_idp_request_secrets_idp_signing_item_model2 # Convert model instance back to dict and verify no loss of data - apikey_activity_user_model_json2 = apikey_activity_user_model.to_dict() - assert apikey_activity_user_model_json2 == apikey_activity_user_model_json + create_idp_request_secrets_idp_signing_item_model_json2 = ( + create_idp_request_secrets_idp_signing_item_model.to_dict() + ) + assert ( + create_idp_request_secrets_idp_signing_item_model_json2 + == create_idp_request_secrets_idp_signing_item_model_json + ) -class TestModel_AssignedTemplatesAccountSettingsRestrictUserDomains: +class TestModel_CreateIdpRequestSecretsSp: """ - Test Class for AssignedTemplatesAccountSettingsRestrictUserDomains + Test Class for CreateIdpRequestSecretsSp """ - def test_assigned_templates_account_settings_restrict_user_domains_serialization(self): + def test_create_idp_request_secrets_sp_serialization(self): """ - Test serialization/deserialization for AssignedTemplatesAccountSettingsRestrictUserDomains + Test serialization/deserialization for CreateIdpRequestSecretsSp """ # Construct dict forms of any model objects needed in order to build this model. - account_settings_user_domain_restriction_model = {} # AccountSettingsUserDomainRestriction - account_settings_user_domain_restriction_model['realm_id'] = 'IBMid' - account_settings_user_domain_restriction_model['invitation_email_allow_patterns'] = [] - account_settings_user_domain_restriction_model['restrict_invitation'] = True + create_idp_request_secrets_sp_signing_item_model = {} # CreateIdpRequestSecretsSpSigningItem + create_idp_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model['type'] = 'primary' - # Construct a json representation of a AssignedTemplatesAccountSettingsRestrictUserDomains model - assigned_templates_account_settings_restrict_user_domains_model_json = {} - assigned_templates_account_settings_restrict_user_domains_model_json['account_sufficient'] = True - assigned_templates_account_settings_restrict_user_domains_model_json['restrictions'] = [ - account_settings_user_domain_restriction_model - ] + # Construct a json representation of a CreateIdpRequestSecretsSp model + create_idp_request_secrets_sp_model_json = {} + create_idp_request_secrets_sp_model_json['signing'] = [create_idp_request_secrets_sp_signing_item_model] - # Construct a model instance of AssignedTemplatesAccountSettingsRestrictUserDomains by calling from_dict on the json representation - assigned_templates_account_settings_restrict_user_domains_model = ( - AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( - assigned_templates_account_settings_restrict_user_domains_model_json - ) + # Construct a model instance of CreateIdpRequestSecretsSp by calling from_dict on the json representation + create_idp_request_secrets_sp_model = CreateIdpRequestSecretsSp.from_dict( + create_idp_request_secrets_sp_model_json ) - assert assigned_templates_account_settings_restrict_user_domains_model != False + assert create_idp_request_secrets_sp_model != False - # Construct a model instance of AssignedTemplatesAccountSettingsRestrictUserDomains by calling from_dict on the json representation - assigned_templates_account_settings_restrict_user_domains_model_dict = ( - AssignedTemplatesAccountSettingsRestrictUserDomains.from_dict( - assigned_templates_account_settings_restrict_user_domains_model_json - ).__dict__ + # Construct a model instance of CreateIdpRequestSecretsSp by calling from_dict on the json representation + create_idp_request_secrets_sp_model_dict = CreateIdpRequestSecretsSp.from_dict( + create_idp_request_secrets_sp_model_json + ).__dict__ + create_idp_request_secrets_sp_model2 = CreateIdpRequestSecretsSp(**create_idp_request_secrets_sp_model_dict) + + # Verify the model instances are equivalent + assert create_idp_request_secrets_sp_model == create_idp_request_secrets_sp_model2 + + # Convert model instance back to dict and verify no loss of data + create_idp_request_secrets_sp_model_json2 = create_idp_request_secrets_sp_model.to_dict() + assert create_idp_request_secrets_sp_model_json2 == create_idp_request_secrets_sp_model_json + + +class TestModel_CreateIdpRequestSecretsSpSigningItem: + """ + Test Class for CreateIdpRequestSecretsSpSigningItem + """ + + def test_create_idp_request_secrets_sp_signing_item_serialization(self): + """ + Test serialization/deserialization for CreateIdpRequestSecretsSpSigningItem + """ + + # Construct a json representation of a CreateIdpRequestSecretsSpSigningItem model + create_idp_request_secrets_sp_signing_item_model_json = {} + create_idp_request_secrets_sp_signing_item_model_json['certificate_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model_json['key_value'] = 'testString' + create_idp_request_secrets_sp_signing_item_model_json['key_encoding'] = 'testString' + create_idp_request_secrets_sp_signing_item_model_json['type'] = 'primary' + + # Construct a model instance of CreateIdpRequestSecretsSpSigningItem by calling from_dict on the json representation + create_idp_request_secrets_sp_signing_item_model = CreateIdpRequestSecretsSpSigningItem.from_dict( + create_idp_request_secrets_sp_signing_item_model_json ) - assigned_templates_account_settings_restrict_user_domains_model2 = ( - AssignedTemplatesAccountSettingsRestrictUserDomains( - **assigned_templates_account_settings_restrict_user_domains_model_dict - ) + assert create_idp_request_secrets_sp_signing_item_model != False + + # Construct a model instance of CreateIdpRequestSecretsSpSigningItem by calling from_dict on the json representation + create_idp_request_secrets_sp_signing_item_model_dict = CreateIdpRequestSecretsSpSigningItem.from_dict( + create_idp_request_secrets_sp_signing_item_model_json + ).__dict__ + create_idp_request_secrets_sp_signing_item_model2 = CreateIdpRequestSecretsSpSigningItem( + **create_idp_request_secrets_sp_signing_item_model_dict ) # Verify the model instances are equivalent - assert ( - assigned_templates_account_settings_restrict_user_domains_model - == assigned_templates_account_settings_restrict_user_domains_model2 - ) + assert create_idp_request_secrets_sp_signing_item_model == create_idp_request_secrets_sp_signing_item_model2 # Convert model instance back to dict and verify no loss of data - assigned_templates_account_settings_restrict_user_domains_model_json2 = ( - assigned_templates_account_settings_restrict_user_domains_model.to_dict() + create_idp_request_secrets_sp_signing_item_model_json2 = ( + create_idp_request_secrets_sp_signing_item_model.to_dict() ) assert ( - assigned_templates_account_settings_restrict_user_domains_model_json2 - == assigned_templates_account_settings_restrict_user_domains_model_json + create_idp_request_secrets_sp_signing_item_model_json2 + == create_idp_request_secrets_sp_signing_item_model_json ) @@ -12050,6 +14951,52 @@ def test_identity_preferences_response_serialization(self): assert identity_preferences_response_model_json2 == identity_preferences_response_model_json +class TestModel_Idp: + """ + Test Class for Idp + """ + + def test_idp_serialization(self): + """ + Test serialization/deserialization for Idp + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_scope_model = {} # ShareScope + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Construct a json representation of a Idp model + idp_model_json = {} + idp_model_json['idp_id'] = 'testString' + idp_model_json['entity_tag'] = 'testString' + idp_model_json['account_id'] = 'testString' + idp_model_json['name'] = 'testString' + idp_model_json['type'] = 'saml' + idp_model_json['properties'] = {'anyKey': 'anyValue'} + idp_model_json['secrets'] = {'anyKey': 'anyValue'} + idp_model_json['share_scope'] = [share_scope_model] + idp_model_json['active'] = True + idp_model_json['created_at'] = '2019-01-01T12:00:00Z' + idp_model_json['modified_at'] = '2019-01-01T12:00:00Z' + + # Construct a model instance of Idp by calling from_dict on the json representation + idp_model = Idp.from_dict(idp_model_json) + assert idp_model != False + + # Construct a model instance of Idp by calling from_dict on the json representation + idp_model_dict = Idp.from_dict(idp_model_json).__dict__ + idp_model2 = Idp(**idp_model_dict) + + # Verify the model instances are equivalent + assert idp_model == idp_model2 + + # Convert model instance back to dict and verify no loss of data + idp_model_json2 = idp_model.to_dict() + assert idp_model_json2 == idp_model_json + + class TestModel_LimitCount: """ Test Class for LimitCount @@ -12081,6 +15028,99 @@ def test_limit_count_serialization(self): assert limit_count_model_json2 == limit_count_model_json +class TestModel_ListIdPSettingsResponse: + """ + Test Class for ListIdPSettingsResponse + """ + + def test_list_id_p_settings_response_serialization(self): + """ + Test serialization/deserialization for ListIdPSettingsResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + account_idp_settings_model = {} # AccountIdpSettings + account_idp_settings_model['idp_id'] = 'testString' + account_idp_settings_model['owner_account'] = 'testString' + account_idp_settings_model['owner_account_name'] = 'testString' + account_idp_settings_model['idp_name'] = 'testString' + account_idp_settings_model['idp_type'] = 'testString' + account_idp_settings_model['cloud_user_strategy'] = 'STATIC' + account_idp_settings_model['active'] = True + account_idp_settings_model['ui_default'] = True + + # Construct a json representation of a ListIdPSettingsResponse model + list_id_p_settings_response_model_json = {} + list_id_p_settings_response_model_json['idps'] = [account_idp_settings_model] + + # Construct a model instance of ListIdPSettingsResponse by calling from_dict on the json representation + list_id_p_settings_response_model = ListIdPSettingsResponse.from_dict(list_id_p_settings_response_model_json) + assert list_id_p_settings_response_model != False + + # Construct a model instance of ListIdPSettingsResponse by calling from_dict on the json representation + list_id_p_settings_response_model_dict = ListIdPSettingsResponse.from_dict( + list_id_p_settings_response_model_json + ).__dict__ + list_id_p_settings_response_model2 = ListIdPSettingsResponse(**list_id_p_settings_response_model_dict) + + # Verify the model instances are equivalent + assert list_id_p_settings_response_model == list_id_p_settings_response_model2 + + # Convert model instance back to dict and verify no loss of data + list_id_p_settings_response_model_json2 = list_id_p_settings_response_model.to_dict() + assert list_id_p_settings_response_model_json2 == list_id_p_settings_response_model_json + + +class TestModel_ListIdpsResponse: + """ + Test Class for ListIdpsResponse + """ + + def test_list_idps_response_serialization(self): + """ + Test serialization/deserialization for ListIdpsResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_scope_model = {} # ShareScope + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + idp_model = {} # Idp + idp_model['idp_id'] = 'testString' + idp_model['entity_tag'] = 'testString' + idp_model['account_id'] = 'testString' + idp_model['name'] = 'testString' + idp_model['type'] = 'saml' + idp_model['properties'] = {'anyKey': 'anyValue'} + idp_model['secrets'] = {'anyKey': 'anyValue'} + idp_model['share_scope'] = [share_scope_model] + idp_model['active'] = True + idp_model['created_at'] = '2019-01-01T12:00:00Z' + idp_model['modified_at'] = '2019-01-01T12:00:00Z' + + # Construct a json representation of a ListIdpsResponse model + list_idps_response_model_json = {} + list_idps_response_model_json['idps'] = [idp_model] + + # Construct a model instance of ListIdpsResponse by calling from_dict on the json representation + list_idps_response_model = ListIdpsResponse.from_dict(list_idps_response_model_json) + assert list_idps_response_model != False + + # Construct a model instance of ListIdpsResponse by calling from_dict on the json representation + list_idps_response_model_dict = ListIdpsResponse.from_dict(list_idps_response_model_json).__dict__ + list_idps_response_model2 = ListIdpsResponse(**list_idps_response_model_dict) + + # Verify the model instances are equivalent + assert list_idps_response_model == list_idps_response_model2 + + # Convert model instance back to dict and verify no loss of data + list_idps_response_model_json2 = list_idps_response_model.to_dict() + assert list_idps_response_model_json2 == list_idps_response_model_json + + class TestModel_MfaEnrollmentTypeStatus: """ Test Class for MfaEnrollmentTypeStatus @@ -12772,6 +15812,58 @@ def test_response_context_serialization(self): assert response_context_model_json2 == response_context_model_json +class TestModel_SamlMetadataImportResponse: + """ + Test Class for SamlMetadataImportResponse + """ + + def test_saml_metadata_import_response_serialization(self): + """ + Test serialization/deserialization for SamlMetadataImportResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_scope_model = {} # ShareScope + share_scope_model['id'] = 'testString' + share_scope_model['type'] = 'account' + + # Construct a json representation of a SamlMetadataImportResponse model + saml_metadata_import_response_model_json = {} + saml_metadata_import_response_model_json['idp_id'] = 'testString' + saml_metadata_import_response_model_json['entity_tag'] = 'testString' + saml_metadata_import_response_model_json['created_at'] = '2019-01-01T12:00:00Z' + saml_metadata_import_response_model_json['modified_at'] = '2019-01-01T12:00:00Z' + saml_metadata_import_response_model_json['account_id'] = 'testString' + saml_metadata_import_response_model_json['name'] = 'testString' + saml_metadata_import_response_model_json['type'] = 'saml' + saml_metadata_import_response_model_json['properties'] = {'anyKey': 'anyValue'} + saml_metadata_import_response_model_json['secrets'] = {'anyKey': 'anyValue'} + saml_metadata_import_response_model_json['history'] = [{'anyKey': 'anyValue'}] + saml_metadata_import_response_model_json['share_scope'] = [share_scope_model] + saml_metadata_import_response_model_json['active'] = True + saml_metadata_import_response_model_json['ui_setup_completed'] = True + + # Construct a model instance of SamlMetadataImportResponse by calling from_dict on the json representation + saml_metadata_import_response_model = SamlMetadataImportResponse.from_dict( + saml_metadata_import_response_model_json + ) + assert saml_metadata_import_response_model != False + + # Construct a model instance of SamlMetadataImportResponse by calling from_dict on the json representation + saml_metadata_import_response_model_dict = SamlMetadataImportResponse.from_dict( + saml_metadata_import_response_model_json + ).__dict__ + saml_metadata_import_response_model2 = SamlMetadataImportResponse(**saml_metadata_import_response_model_dict) + + # Verify the model instances are equivalent + assert saml_metadata_import_response_model == saml_metadata_import_response_model2 + + # Convert model instance back to dict and verify no loss of data + saml_metadata_import_response_model_json2 = saml_metadata_import_response_model.to_dict() + assert saml_metadata_import_response_model_json2 == saml_metadata_import_response_model_json + + class TestModel_ServiceId: """ Test Class for ServiceId @@ -13079,6 +16171,37 @@ def test_service_id_list_serialization(self): assert service_id_list_model_json2 == service_id_list_model_json +class TestModel_ShareScope: + """ + Test Class for ShareScope + """ + + def test_share_scope_serialization(self): + """ + Test serialization/deserialization for ShareScope + """ + + # Construct a json representation of a ShareScope model + share_scope_model_json = {} + share_scope_model_json['id'] = 'testString' + share_scope_model_json['type'] = 'account' + + # Construct a model instance of ShareScope by calling from_dict on the json representation + share_scope_model = ShareScope.from_dict(share_scope_model_json) + assert share_scope_model != False + + # Construct a model instance of ShareScope by calling from_dict on the json representation + share_scope_model_dict = ShareScope.from_dict(share_scope_model_json).__dict__ + share_scope_model2 = ShareScope(**share_scope_model_dict) + + # Verify the model instances are equivalent + assert share_scope_model == share_scope_model2 + + # Convert model instance back to dict and verify no loss of data + share_scope_model_json2 = share_scope_model.to_dict() + assert share_scope_model_json2 == share_scope_model_json + + class TestModel_TemplateAccountSettings: """ Test Class for TemplateAccountSettings @@ -13748,6 +16871,113 @@ def test_template_profile_component_response_serialization(self): assert template_profile_component_response_model_json2 == template_profile_component_response_model_json +class TestModel_TestResult: + """ + Test Class for TestResult + """ + + def test_test_result_serialization(self): + """ + Test serialization/deserialization for TestResult + """ + + # Construct dict forms of any model objects needed in order to build this model. + + test_result_steps_item_model = {} # TestResultStepsItem + test_result_steps_item_model['sequence'] = 38 + test_result_steps_item_model['name'] = 'testString' + test_result_steps_item_model['state'] = 'testString' + test_result_steps_item_model['result'] = 'testString' + + # Construct a json representation of a TestResult model + test_result_model_json = {} + test_result_model_json['idp_id'] = 'testString' + test_result_model_json['entity_tag'] = 'testString' + test_result_model_json['started_at'] = 38 + test_result_model_json['modified_at'] = 'testString' + test_result_model_json['idp_version'] = 'testString' + test_result_model_json['steps'] = [test_result_steps_item_model] + + # Construct a model instance of TestResult by calling from_dict on the json representation + test_result_model = TestResult.from_dict(test_result_model_json) + assert test_result_model != False + + # Construct a model instance of TestResult by calling from_dict on the json representation + test_result_model_dict = TestResult.from_dict(test_result_model_json).__dict__ + test_result_model2 = TestResult(**test_result_model_dict) + + # Verify the model instances are equivalent + assert test_result_model == test_result_model2 + + # Convert model instance back to dict and verify no loss of data + test_result_model_json2 = test_result_model.to_dict() + assert test_result_model_json2 == test_result_model_json + + +class TestModel_TestResultStepsItem: + """ + Test Class for TestResultStepsItem + """ + + def test_test_result_steps_item_serialization(self): + """ + Test serialization/deserialization for TestResultStepsItem + """ + + # Construct a json representation of a TestResultStepsItem model + test_result_steps_item_model_json = {} + test_result_steps_item_model_json['sequence'] = 38 + test_result_steps_item_model_json['name'] = 'testString' + test_result_steps_item_model_json['state'] = 'testString' + test_result_steps_item_model_json['result'] = 'testString' + + # Construct a model instance of TestResultStepsItem by calling from_dict on the json representation + test_result_steps_item_model = TestResultStepsItem.from_dict(test_result_steps_item_model_json) + assert test_result_steps_item_model != False + + # Construct a model instance of TestResultStepsItem by calling from_dict on the json representation + test_result_steps_item_model_dict = TestResultStepsItem.from_dict(test_result_steps_item_model_json).__dict__ + test_result_steps_item_model2 = TestResultStepsItem(**test_result_steps_item_model_dict) + + # Verify the model instances are equivalent + assert test_result_steps_item_model == test_result_steps_item_model2 + + # Convert model instance back to dict and verify no loss of data + test_result_steps_item_model_json2 = test_result_steps_item_model.to_dict() + assert test_result_steps_item_model_json2 == test_result_steps_item_model_json + + +class TestModel_TestTriggerResponse: + """ + Test Class for TestTriggerResponse + """ + + def test_test_trigger_response_serialization(self): + """ + Test serialization/deserialization for TestTriggerResponse + """ + + # Construct a json representation of a TestTriggerResponse model + test_trigger_response_model_json = {} + test_trigger_response_model_json['result'] = 'testString' + test_trigger_response_model_json['test_url'] = 'testString' + + # Construct a model instance of TestTriggerResponse by calling from_dict on the json representation + test_trigger_response_model = TestTriggerResponse.from_dict(test_trigger_response_model_json) + assert test_trigger_response_model != False + + # Construct a model instance of TestTriggerResponse by calling from_dict on the json representation + test_trigger_response_model_dict = TestTriggerResponse.from_dict(test_trigger_response_model_json).__dict__ + test_trigger_response_model2 = TestTriggerResponse(**test_trigger_response_model_dict) + + # Verify the model instances are equivalent + assert test_trigger_response_model == test_trigger_response_model2 + + # Convert model instance back to dict and verify no loss of data + test_trigger_response_model_json2 = test_trigger_response_model.to_dict() + assert test_trigger_response_model_json2 == test_trigger_response_model_json + + class TestModel_TrustedProfile: """ Test Class for TrustedProfile @@ -14186,6 +17416,476 @@ def test_trusted_profiles_list_serialization(self): assert trusted_profiles_list_model_json2 == trusted_profiles_list_model_json +class TestModel_UpdateIdPRequestProperties: + """ + Test Class for UpdateIdPRequestProperties + """ + + def test_update_id_p_request_properties_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestProperties + """ + + # Construct dict forms of any model objects needed in order to build this model. + + update_id_p_request_properties_idp_model = {} # UpdateIdPRequestPropertiesIdp + update_id_p_request_properties_idp_model['entity_id'] = 'testString' + update_id_p_request_properties_idp_model['redirect_binding_url'] = 'testString' + update_id_p_request_properties_idp_model['want_request_signed'] = True + update_id_p_request_properties_idp_model['logout_url'] = 'testString' + + update_id_p_request_properties_sp_authn_context_model = {} # UpdateIdPRequestPropertiesSpAuthnContext + update_id_p_request_properties_sp_authn_context_model['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model['accept'] = ['testString'] + + update_id_p_request_properties_sp_model = {} # UpdateIdPRequestPropertiesSp + update_id_p_request_properties_sp_model['want_assertion_signed'] = True + update_id_p_request_properties_sp_model['want_response_signed'] = True + update_id_p_request_properties_sp_model['encrypt_response'] = True + update_id_p_request_properties_sp_model['idp_initiated_login_enabled'] = True + update_id_p_request_properties_sp_model['logout_url_enabled_when_available'] = True + update_id_p_request_properties_sp_model['idp_initiated_urls'] = ['testString'] + update_id_p_request_properties_sp_model['authn_context'] = update_id_p_request_properties_sp_authn_context_model + update_id_p_request_properties_sp_model['claims'] = {'key1': 'testString'} + + # Construct a json representation of a UpdateIdPRequestProperties model + update_id_p_request_properties_model_json = {} + update_id_p_request_properties_model_json['idp'] = update_id_p_request_properties_idp_model + update_id_p_request_properties_model_json['sp'] = update_id_p_request_properties_sp_model + + # Construct a model instance of UpdateIdPRequestProperties by calling from_dict on the json representation + update_id_p_request_properties_model = UpdateIdPRequestProperties.from_dict( + update_id_p_request_properties_model_json + ) + assert update_id_p_request_properties_model != False + + # Construct a model instance of UpdateIdPRequestProperties by calling from_dict on the json representation + update_id_p_request_properties_model_dict = UpdateIdPRequestProperties.from_dict( + update_id_p_request_properties_model_json + ).__dict__ + update_id_p_request_properties_model2 = UpdateIdPRequestProperties(**update_id_p_request_properties_model_dict) + + # Verify the model instances are equivalent + assert update_id_p_request_properties_model == update_id_p_request_properties_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_properties_model_json2 = update_id_p_request_properties_model.to_dict() + assert update_id_p_request_properties_model_json2 == update_id_p_request_properties_model_json + + +class TestModel_UpdateIdPRequestPropertiesIdp: + """ + Test Class for UpdateIdPRequestPropertiesIdp + """ + + def test_update_id_p_request_properties_idp_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestPropertiesIdp + """ + + # Construct a json representation of a UpdateIdPRequestPropertiesIdp model + update_id_p_request_properties_idp_model_json = {} + update_id_p_request_properties_idp_model_json['entity_id'] = 'testString' + update_id_p_request_properties_idp_model_json['redirect_binding_url'] = 'testString' + update_id_p_request_properties_idp_model_json['want_request_signed'] = True + update_id_p_request_properties_idp_model_json['logout_url'] = 'testString' + + # Construct a model instance of UpdateIdPRequestPropertiesIdp by calling from_dict on the json representation + update_id_p_request_properties_idp_model = UpdateIdPRequestPropertiesIdp.from_dict( + update_id_p_request_properties_idp_model_json + ) + assert update_id_p_request_properties_idp_model != False + + # Construct a model instance of UpdateIdPRequestPropertiesIdp by calling from_dict on the json representation + update_id_p_request_properties_idp_model_dict = UpdateIdPRequestPropertiesIdp.from_dict( + update_id_p_request_properties_idp_model_json + ).__dict__ + update_id_p_request_properties_idp_model2 = UpdateIdPRequestPropertiesIdp( + **update_id_p_request_properties_idp_model_dict + ) + + # Verify the model instances are equivalent + assert update_id_p_request_properties_idp_model == update_id_p_request_properties_idp_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_properties_idp_model_json2 = update_id_p_request_properties_idp_model.to_dict() + assert update_id_p_request_properties_idp_model_json2 == update_id_p_request_properties_idp_model_json + + +class TestModel_UpdateIdPRequestPropertiesSp: + """ + Test Class for UpdateIdPRequestPropertiesSp + """ + + def test_update_id_p_request_properties_sp_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestPropertiesSp + """ + + # Construct dict forms of any model objects needed in order to build this model. + + update_id_p_request_properties_sp_authn_context_model = {} # UpdateIdPRequestPropertiesSpAuthnContext + update_id_p_request_properties_sp_authn_context_model['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model['accept'] = ['testString'] + + # Construct a json representation of a UpdateIdPRequestPropertiesSp model + update_id_p_request_properties_sp_model_json = {} + update_id_p_request_properties_sp_model_json['want_assertion_signed'] = True + update_id_p_request_properties_sp_model_json['want_response_signed'] = True + update_id_p_request_properties_sp_model_json['encrypt_response'] = True + update_id_p_request_properties_sp_model_json['idp_initiated_login_enabled'] = True + update_id_p_request_properties_sp_model_json['logout_url_enabled_when_available'] = True + update_id_p_request_properties_sp_model_json['idp_initiated_urls'] = ['testString'] + update_id_p_request_properties_sp_model_json['authn_context'] = ( + update_id_p_request_properties_sp_authn_context_model + ) + update_id_p_request_properties_sp_model_json['claims'] = {'key1': 'testString'} + + # Construct a model instance of UpdateIdPRequestPropertiesSp by calling from_dict on the json representation + update_id_p_request_properties_sp_model = UpdateIdPRequestPropertiesSp.from_dict( + update_id_p_request_properties_sp_model_json + ) + assert update_id_p_request_properties_sp_model != False + + # Construct a model instance of UpdateIdPRequestPropertiesSp by calling from_dict on the json representation + update_id_p_request_properties_sp_model_dict = UpdateIdPRequestPropertiesSp.from_dict( + update_id_p_request_properties_sp_model_json + ).__dict__ + update_id_p_request_properties_sp_model2 = UpdateIdPRequestPropertiesSp( + **update_id_p_request_properties_sp_model_dict + ) + + # Verify the model instances are equivalent + assert update_id_p_request_properties_sp_model == update_id_p_request_properties_sp_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_properties_sp_model_json2 = update_id_p_request_properties_sp_model.to_dict() + assert update_id_p_request_properties_sp_model_json2 == update_id_p_request_properties_sp_model_json + + +class TestModel_UpdateIdPRequestPropertiesSpAuthnContext: + """ + Test Class for UpdateIdPRequestPropertiesSpAuthnContext + """ + + def test_update_id_p_request_properties_sp_authn_context_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestPropertiesSpAuthnContext + """ + + # Construct a json representation of a UpdateIdPRequestPropertiesSpAuthnContext model + update_id_p_request_properties_sp_authn_context_model_json = {} + update_id_p_request_properties_sp_authn_context_model_json['request'] = ['testString'] + update_id_p_request_properties_sp_authn_context_model_json['accept'] = ['testString'] + + # Construct a model instance of UpdateIdPRequestPropertiesSpAuthnContext by calling from_dict on the json representation + update_id_p_request_properties_sp_authn_context_model = UpdateIdPRequestPropertiesSpAuthnContext.from_dict( + update_id_p_request_properties_sp_authn_context_model_json + ) + assert update_id_p_request_properties_sp_authn_context_model != False + + # Construct a model instance of UpdateIdPRequestPropertiesSpAuthnContext by calling from_dict on the json representation + update_id_p_request_properties_sp_authn_context_model_dict = UpdateIdPRequestPropertiesSpAuthnContext.from_dict( + update_id_p_request_properties_sp_authn_context_model_json + ).__dict__ + update_id_p_request_properties_sp_authn_context_model2 = UpdateIdPRequestPropertiesSpAuthnContext( + **update_id_p_request_properties_sp_authn_context_model_dict + ) + + # Verify the model instances are equivalent + assert ( + update_id_p_request_properties_sp_authn_context_model + == update_id_p_request_properties_sp_authn_context_model2 + ) + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_properties_sp_authn_context_model_json2 = ( + update_id_p_request_properties_sp_authn_context_model.to_dict() + ) + assert ( + update_id_p_request_properties_sp_authn_context_model_json2 + == update_id_p_request_properties_sp_authn_context_model_json + ) + + +class TestModel_UpdateIdPRequestSecrets: + """ + Test Class for UpdateIdPRequestSecrets + """ + + def test_update_id_p_request_secrets_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecrets + """ + + # Construct dict forms of any model objects needed in order to build this model. + + update_id_p_request_secrets_idp_signing_item_model = {} # UpdateIdPRequestSecretsIdpSigningItem + update_id_p_request_secrets_idp_signing_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model['type'] = 'primary' + + update_id_p_request_secrets_idp_encrypting_item_model = {} # UpdateIdPRequestSecretsIdpEncryptingItem + update_id_p_request_secrets_idp_encrypting_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + update_id_p_request_secrets_idp_model = {} # UpdateIdPRequestSecretsIdp + update_id_p_request_secrets_idp_model['signing'] = [update_id_p_request_secrets_idp_signing_item_model] + update_id_p_request_secrets_idp_model['encrypting'] = [update_id_p_request_secrets_idp_encrypting_item_model] + + update_id_p_request_secrets_sp_signing_item_model = {} # UpdateIdPRequestSecretsSpSigningItem + update_id_p_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['type'] = 'primary' + + update_id_p_request_secrets_sp_model = {} # UpdateIdPRequestSecretsSp + update_id_p_request_secrets_sp_model['signing'] = [update_id_p_request_secrets_sp_signing_item_model] + + # Construct a json representation of a UpdateIdPRequestSecrets model + update_id_p_request_secrets_model_json = {} + update_id_p_request_secrets_model_json['idp'] = update_id_p_request_secrets_idp_model + update_id_p_request_secrets_model_json['sp'] = update_id_p_request_secrets_sp_model + + # Construct a model instance of UpdateIdPRequestSecrets by calling from_dict on the json representation + update_id_p_request_secrets_model = UpdateIdPRequestSecrets.from_dict(update_id_p_request_secrets_model_json) + assert update_id_p_request_secrets_model != False + + # Construct a model instance of UpdateIdPRequestSecrets by calling from_dict on the json representation + update_id_p_request_secrets_model_dict = UpdateIdPRequestSecrets.from_dict( + update_id_p_request_secrets_model_json + ).__dict__ + update_id_p_request_secrets_model2 = UpdateIdPRequestSecrets(**update_id_p_request_secrets_model_dict) + + # Verify the model instances are equivalent + assert update_id_p_request_secrets_model == update_id_p_request_secrets_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_model_json2 = update_id_p_request_secrets_model.to_dict() + assert update_id_p_request_secrets_model_json2 == update_id_p_request_secrets_model_json + + +class TestModel_UpdateIdPRequestSecretsIdp: + """ + Test Class for UpdateIdPRequestSecretsIdp + """ + + def test_update_id_p_request_secrets_idp_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecretsIdp + """ + + # Construct dict forms of any model objects needed in order to build this model. + + update_id_p_request_secrets_idp_signing_item_model = {} # UpdateIdPRequestSecretsIdpSigningItem + update_id_p_request_secrets_idp_signing_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model['type'] = 'primary' + + update_id_p_request_secrets_idp_encrypting_item_model = {} # UpdateIdPRequestSecretsIdpEncryptingItem + update_id_p_request_secrets_idp_encrypting_item_model['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model['type'] = 'primary' + + # Construct a json representation of a UpdateIdPRequestSecretsIdp model + update_id_p_request_secrets_idp_model_json = {} + update_id_p_request_secrets_idp_model_json['signing'] = [update_id_p_request_secrets_idp_signing_item_model] + update_id_p_request_secrets_idp_model_json['encrypting'] = [ + update_id_p_request_secrets_idp_encrypting_item_model + ] + + # Construct a model instance of UpdateIdPRequestSecretsIdp by calling from_dict on the json representation + update_id_p_request_secrets_idp_model = UpdateIdPRequestSecretsIdp.from_dict( + update_id_p_request_secrets_idp_model_json + ) + assert update_id_p_request_secrets_idp_model != False + + # Construct a model instance of UpdateIdPRequestSecretsIdp by calling from_dict on the json representation + update_id_p_request_secrets_idp_model_dict = UpdateIdPRequestSecretsIdp.from_dict( + update_id_p_request_secrets_idp_model_json + ).__dict__ + update_id_p_request_secrets_idp_model2 = UpdateIdPRequestSecretsIdp( + **update_id_p_request_secrets_idp_model_dict + ) + + # Verify the model instances are equivalent + assert update_id_p_request_secrets_idp_model == update_id_p_request_secrets_idp_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_idp_model_json2 = update_id_p_request_secrets_idp_model.to_dict() + assert update_id_p_request_secrets_idp_model_json2 == update_id_p_request_secrets_idp_model_json + + +class TestModel_UpdateIdPRequestSecretsIdpEncryptingItem: + """ + Test Class for UpdateIdPRequestSecretsIdpEncryptingItem + """ + + def test_update_id_p_request_secrets_idp_encrypting_item_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecretsIdpEncryptingItem + """ + + # Construct a json representation of a UpdateIdPRequestSecretsIdpEncryptingItem model + update_id_p_request_secrets_idp_encrypting_item_model_json = {} + update_id_p_request_secrets_idp_encrypting_item_model_json['value'] = 'testString' + update_id_p_request_secrets_idp_encrypting_item_model_json['type'] = 'primary' + + # Construct a model instance of UpdateIdPRequestSecretsIdpEncryptingItem by calling from_dict on the json representation + update_id_p_request_secrets_idp_encrypting_item_model = UpdateIdPRequestSecretsIdpEncryptingItem.from_dict( + update_id_p_request_secrets_idp_encrypting_item_model_json + ) + assert update_id_p_request_secrets_idp_encrypting_item_model != False + + # Construct a model instance of UpdateIdPRequestSecretsIdpEncryptingItem by calling from_dict on the json representation + update_id_p_request_secrets_idp_encrypting_item_model_dict = UpdateIdPRequestSecretsIdpEncryptingItem.from_dict( + update_id_p_request_secrets_idp_encrypting_item_model_json + ).__dict__ + update_id_p_request_secrets_idp_encrypting_item_model2 = UpdateIdPRequestSecretsIdpEncryptingItem( + **update_id_p_request_secrets_idp_encrypting_item_model_dict + ) + + # Verify the model instances are equivalent + assert ( + update_id_p_request_secrets_idp_encrypting_item_model + == update_id_p_request_secrets_idp_encrypting_item_model2 + ) + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_idp_encrypting_item_model_json2 = ( + update_id_p_request_secrets_idp_encrypting_item_model.to_dict() + ) + assert ( + update_id_p_request_secrets_idp_encrypting_item_model_json2 + == update_id_p_request_secrets_idp_encrypting_item_model_json + ) + + +class TestModel_UpdateIdPRequestSecretsIdpSigningItem: + """ + Test Class for UpdateIdPRequestSecretsIdpSigningItem + """ + + def test_update_id_p_request_secrets_idp_signing_item_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecretsIdpSigningItem + """ + + # Construct a json representation of a UpdateIdPRequestSecretsIdpSigningItem model + update_id_p_request_secrets_idp_signing_item_model_json = {} + update_id_p_request_secrets_idp_signing_item_model_json['value'] = 'testString' + update_id_p_request_secrets_idp_signing_item_model_json['type'] = 'primary' + + # Construct a model instance of UpdateIdPRequestSecretsIdpSigningItem by calling from_dict on the json representation + update_id_p_request_secrets_idp_signing_item_model = UpdateIdPRequestSecretsIdpSigningItem.from_dict( + update_id_p_request_secrets_idp_signing_item_model_json + ) + assert update_id_p_request_secrets_idp_signing_item_model != False + + # Construct a model instance of UpdateIdPRequestSecretsIdpSigningItem by calling from_dict on the json representation + update_id_p_request_secrets_idp_signing_item_model_dict = UpdateIdPRequestSecretsIdpSigningItem.from_dict( + update_id_p_request_secrets_idp_signing_item_model_json + ).__dict__ + update_id_p_request_secrets_idp_signing_item_model2 = UpdateIdPRequestSecretsIdpSigningItem( + **update_id_p_request_secrets_idp_signing_item_model_dict + ) + + # Verify the model instances are equivalent + assert update_id_p_request_secrets_idp_signing_item_model == update_id_p_request_secrets_idp_signing_item_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_idp_signing_item_model_json2 = ( + update_id_p_request_secrets_idp_signing_item_model.to_dict() + ) + assert ( + update_id_p_request_secrets_idp_signing_item_model_json2 + == update_id_p_request_secrets_idp_signing_item_model_json + ) + + +class TestModel_UpdateIdPRequestSecretsSp: + """ + Test Class for UpdateIdPRequestSecretsSp + """ + + def test_update_id_p_request_secrets_sp_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecretsSp + """ + + # Construct dict forms of any model objects needed in order to build this model. + + update_id_p_request_secrets_sp_signing_item_model = {} # UpdateIdPRequestSecretsSpSigningItem + update_id_p_request_secrets_sp_signing_item_model['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model['type'] = 'primary' + + # Construct a json representation of a UpdateIdPRequestSecretsSp model + update_id_p_request_secrets_sp_model_json = {} + update_id_p_request_secrets_sp_model_json['signing'] = [update_id_p_request_secrets_sp_signing_item_model] + + # Construct a model instance of UpdateIdPRequestSecretsSp by calling from_dict on the json representation + update_id_p_request_secrets_sp_model = UpdateIdPRequestSecretsSp.from_dict( + update_id_p_request_secrets_sp_model_json + ) + assert update_id_p_request_secrets_sp_model != False + + # Construct a model instance of UpdateIdPRequestSecretsSp by calling from_dict on the json representation + update_id_p_request_secrets_sp_model_dict = UpdateIdPRequestSecretsSp.from_dict( + update_id_p_request_secrets_sp_model_json + ).__dict__ + update_id_p_request_secrets_sp_model2 = UpdateIdPRequestSecretsSp(**update_id_p_request_secrets_sp_model_dict) + + # Verify the model instances are equivalent + assert update_id_p_request_secrets_sp_model == update_id_p_request_secrets_sp_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_sp_model_json2 = update_id_p_request_secrets_sp_model.to_dict() + assert update_id_p_request_secrets_sp_model_json2 == update_id_p_request_secrets_sp_model_json + + +class TestModel_UpdateIdPRequestSecretsSpSigningItem: + """ + Test Class for UpdateIdPRequestSecretsSpSigningItem + """ + + def test_update_id_p_request_secrets_sp_signing_item_serialization(self): + """ + Test serialization/deserialization for UpdateIdPRequestSecretsSpSigningItem + """ + + # Construct a json representation of a UpdateIdPRequestSecretsSpSigningItem model + update_id_p_request_secrets_sp_signing_item_model_json = {} + update_id_p_request_secrets_sp_signing_item_model_json['certificate_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model_json['key_value'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model_json['key_encoding'] = 'testString' + update_id_p_request_secrets_sp_signing_item_model_json['type'] = 'primary' + + # Construct a model instance of UpdateIdPRequestSecretsSpSigningItem by calling from_dict on the json representation + update_id_p_request_secrets_sp_signing_item_model = UpdateIdPRequestSecretsSpSigningItem.from_dict( + update_id_p_request_secrets_sp_signing_item_model_json + ) + assert update_id_p_request_secrets_sp_signing_item_model != False + + # Construct a model instance of UpdateIdPRequestSecretsSpSigningItem by calling from_dict on the json representation + update_id_p_request_secrets_sp_signing_item_model_dict = UpdateIdPRequestSecretsSpSigningItem.from_dict( + update_id_p_request_secrets_sp_signing_item_model_json + ).__dict__ + update_id_p_request_secrets_sp_signing_item_model2 = UpdateIdPRequestSecretsSpSigningItem( + **update_id_p_request_secrets_sp_signing_item_model_dict + ) + + # Verify the model instances are equivalent + assert update_id_p_request_secrets_sp_signing_item_model == update_id_p_request_secrets_sp_signing_item_model2 + + # Convert model instance back to dict and verify no loss of data + update_id_p_request_secrets_sp_signing_item_model_json2 = ( + update_id_p_request_secrets_sp_signing_item_model.to_dict() + ) + assert ( + update_id_p_request_secrets_sp_signing_item_model_json2 + == update_id_p_request_secrets_sp_signing_item_model_json + ) + + class TestModel_UserActivity: """ Test Class for UserActivity