diff --git a/ibm_platform_services/context_based_restrictions_v1.py b/ibm_platform_services/context_based_restrictions_v1.py index dbb1964..9bb7deb 100644 --- a/ibm_platform_services/context_based_restrictions_v1.py +++ b/ibm_platform_services/context_based_restrictions_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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.86.0-bc6f14b3-20240221-193958 +# IBM OpenAPI SDK Code Generator Version: 3.108.0-56772134-20251111-102802 """ With the Context Based Restrictions API, you can: @@ -1290,19 +1290,20 @@ class AccountSettings: :param str crn: The account settings CRN. :param int rule_count_limit: the max number of rules allowed for the account. :param int zone_count_limit: the max number of zones allowed for the account. - :param int tags_rule_count_limit: (optional) the max number of rules with tags - allowed for the account. + :param int tags_rule_count_limit: the max number of rules with tags allowed for + the account. :param int current_rule_count: the current number of rules used by the account. :param int current_zone_count: the current number of zones used by the account. - :param int current_tags_rule_count: (optional) the current number of rules with - tags used by the account. + :param int current_tags_rule_count: the current number of rules with tags used + by the account. :param str href: The href link to the resource. - :param datetime created_at: The time the resource was created. - :param str created_by_id: IAM ID of the user or service which created the - resource. - :param datetime last_modified_at: The last time the resource was modified. - :param str last_modified_by_id: IAM ID of the user or service which modified the - resource. + :param datetime created_at: (optional) The time the resource was created. + :param str created_by_id: (optional) IAM ID of the user or service which created + the resource. + :param datetime last_modified_at: (optional) The last time the resource was + modified. + :param str last_modified_by_id: (optional) IAM ID of the user or service which + modified the resource. """ def __init__( @@ -1311,16 +1312,16 @@ def __init__( crn: str, rule_count_limit: int, zone_count_limit: int, + tags_rule_count_limit: int, current_rule_count: int, current_zone_count: int, + current_tags_rule_count: int, href: str, - created_at: datetime, - created_by_id: str, - last_modified_at: datetime, - last_modified_by_id: str, *, - tags_rule_count_limit: Optional[int] = None, - current_tags_rule_count: Optional[int] = None, + created_at: Optional[datetime] = None, + created_by_id: Optional[str] = None, + last_modified_at: Optional[datetime] = None, + last_modified_by_id: Optional[str] = None, ) -> None: """ Initialize a AccountSettings object. @@ -1331,21 +1332,22 @@ def __init__( account. :param int zone_count_limit: the max number of zones allowed for the account. + :param int tags_rule_count_limit: the max number of rules with tags allowed + for the account. :param int current_rule_count: the current number of rules used by the account. :param int current_zone_count: the current number of zones used by the account. + :param int current_tags_rule_count: the current number of rules with tags + used by the account. :param str href: The href link to the resource. - :param datetime created_at: The time the resource was created. - :param str created_by_id: IAM ID of the user or service which created the - resource. - :param datetime last_modified_at: The last time the resource was modified. - :param str last_modified_by_id: IAM ID of the user or service which - modified the resource. - :param int tags_rule_count_limit: (optional) the max number of rules with - tags allowed for the account. - :param int current_tags_rule_count: (optional) the current number of rules - with tags used by the account. + :param datetime created_at: (optional) The time the resource was created. + :param str created_by_id: (optional) IAM ID of the user or service which + created the resource. + :param datetime last_modified_at: (optional) The last time the resource was + modified. + :param str last_modified_by_id: (optional) IAM ID of the user or service + which modified the resource. """ self.id = id self.crn = crn @@ -1383,6 +1385,8 @@ def from_dict(cls, _dict: Dict) -> 'AccountSettings': raise ValueError('Required property \'zone_count_limit\' not present in AccountSettings JSON') if (tags_rule_count_limit := _dict.get('tags_rule_count_limit')) is not None: args['tags_rule_count_limit'] = tags_rule_count_limit + else: + raise ValueError('Required property \'tags_rule_count_limit\' not present in AccountSettings JSON') if (current_rule_count := _dict.get('current_rule_count')) is not None: args['current_rule_count'] = current_rule_count else: @@ -1393,26 +1397,20 @@ def from_dict(cls, _dict: Dict) -> 'AccountSettings': raise ValueError('Required property \'current_zone_count\' not present in AccountSettings JSON') if (current_tags_rule_count := _dict.get('current_tags_rule_count')) is not None: args['current_tags_rule_count'] = current_tags_rule_count + else: + raise ValueError('Required property \'current_tags_rule_count\' not present in AccountSettings JSON') if (href := _dict.get('href')) is not None: args['href'] = href else: raise ValueError('Required property \'href\' not present in AccountSettings 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 AccountSettings 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 AccountSettings JSON') if (last_modified_at := _dict.get('last_modified_at')) is not None: args['last_modified_at'] = string_to_datetime(last_modified_at) - else: - raise ValueError('Required property \'last_modified_at\' not present in AccountSettings 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 AccountSettings JSON') return cls(**args) @classmethod @@ -2462,6 +2460,7 @@ class ServiceRefTarget: :param str service_type: (optional) The type of the service. :param List[ServiceRefTargetLocationsItem] locations: (optional) The locations the service is available. + :param str display_name: (optional) The display name of the service. """ def __init__( @@ -2470,6 +2469,7 @@ def __init__( *, service_type: Optional[str] = None, locations: Optional[List['ServiceRefTargetLocationsItem']] = None, + display_name: Optional[str] = None, ) -> None: """ Initialize a ServiceRefTarget object. @@ -2478,10 +2478,12 @@ def __init__( :param str service_type: (optional) The type of the service. :param List[ServiceRefTargetLocationsItem] locations: (optional) The locations the service is available. + :param str display_name: (optional) The display name of the service. """ self.service_name = service_name self.service_type = service_type self.locations = locations + self.display_name = display_name @classmethod def from_dict(cls, _dict: Dict) -> 'ServiceRefTarget': @@ -2495,6 +2497,8 @@ def from_dict(cls, _dict: Dict) -> 'ServiceRefTarget': args['service_type'] = service_type if (locations := _dict.get('locations')) is not None: args['locations'] = [ServiceRefTargetLocationsItem.from_dict(v) for v in locations] + if (display_name := _dict.get('display_name')) is not None: + args['display_name'] = display_name return cls(**args) @classmethod @@ -2517,6 +2521,8 @@ def to_dict(self) -> Dict: else: locations_list.append(v.to_dict()) _dict['locations'] = locations_list + if hasattr(self, 'display_name') and self.display_name is not None: + _dict['display_name'] = self.display_name return _dict def _to_dict(self): @@ -3251,22 +3257,27 @@ class AddressIPAddress(Address): :param str type: The type of address. :param str value: The IP address. + :param str id: (optional) The address id (for use by terraform only). """ def __init__( self, type: str, value: str, + *, + id: Optional[str] = None, ) -> None: """ Initialize a AddressIPAddress object. :param str type: The type of address. :param str value: The IP address. + :param str id: (optional) The address id (for use by terraform only). """ # pylint: disable=super-init-not-called self.type = type self.value = value + self.id = id @classmethod def from_dict(cls, _dict: Dict) -> 'AddressIPAddress': @@ -3280,6 +3291,8 @@ def from_dict(cls, _dict: Dict) -> 'AddressIPAddress': args['value'] = value else: raise ValueError('Required property \'value\' not present in AddressIPAddress JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod @@ -3294,6 +3307,8 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -3328,22 +3343,27 @@ class AddressIPAddressRange(Address): :param str type: The type of address. :param str value: The ip range in - format. + :param str id: (optional) The address id (for use by terraform only). """ def __init__( self, type: str, value: str, + *, + id: Optional[str] = None, ) -> None: """ Initialize a AddressIPAddressRange object. :param str type: The type of address. :param str value: The ip range in - format. + :param str id: (optional) The address id (for use by terraform only). """ # pylint: disable=super-init-not-called self.type = type self.value = value + self.id = id @classmethod def from_dict(cls, _dict: Dict) -> 'AddressIPAddressRange': @@ -3357,6 +3377,8 @@ def from_dict(cls, _dict: Dict) -> 'AddressIPAddressRange': args['value'] = value else: raise ValueError('Required property \'value\' not present in AddressIPAddressRange JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod @@ -3371,6 +3393,8 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -3405,22 +3429,27 @@ class AddressServiceRef(Address): :param str type: The type of address. :param ServiceRefValue ref: A service reference value. + :param str id: (optional) The address id (for use by terraform only). """ def __init__( self, type: str, ref: 'ServiceRefValue', + *, + id: Optional[str] = None, ) -> None: """ Initialize a AddressServiceRef object. :param str type: The type of address. :param ServiceRefValue ref: A service reference value. + :param str id: (optional) The address id (for use by terraform only). """ # pylint: disable=super-init-not-called self.type = type self.ref = ref + self.id = id @classmethod def from_dict(cls, _dict: Dict) -> 'AddressServiceRef': @@ -3434,6 +3463,8 @@ def from_dict(cls, _dict: Dict) -> 'AddressServiceRef': args['ref'] = ServiceRefValue.from_dict(ref) else: raise ValueError('Required property \'ref\' not present in AddressServiceRef JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod @@ -3451,6 +3482,8 @@ def to_dict(self) -> Dict: _dict['ref'] = self.ref else: _dict['ref'] = self.ref.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -3485,22 +3518,27 @@ class AddressSubnet(Address): :param str type: The type of address. :param str value: The subnet in CIDR format. + :param str id: (optional) The address id (for use by terraform only). """ def __init__( self, type: str, value: str, + *, + id: Optional[str] = None, ) -> None: """ Initialize a AddressSubnet object. :param str type: The type of address. :param str value: The subnet in CIDR format. + :param str id: (optional) The address id (for use by terraform only). """ # pylint: disable=super-init-not-called self.type = type self.value = value + self.id = id @classmethod def from_dict(cls, _dict: Dict) -> 'AddressSubnet': @@ -3514,6 +3552,8 @@ def from_dict(cls, _dict: Dict) -> 'AddressSubnet': args['value'] = value else: raise ValueError('Required property \'value\' not present in AddressSubnet JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod @@ -3528,6 +3568,8 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -3562,22 +3604,27 @@ class AddressVPC(Address): :param str type: The type of address. :param str value: The VPC CRN. + :param str id: (optional) The address id (for use by terraform only). """ def __init__( self, type: str, value: str, + *, + id: Optional[str] = None, ) -> None: """ Initialize a AddressVPC object. :param str type: The type of address. :param str value: The VPC CRN. + :param str id: (optional) The address id (for use by terraform only). """ # pylint: disable=super-init-not-called self.type = type self.value = value + self.id = id @classmethod def from_dict(cls, _dict: Dict) -> 'AddressVPC': @@ -3591,6 +3638,8 @@ def from_dict(cls, _dict: Dict) -> 'AddressVPC': args['value'] = value else: raise ValueError('Required property \'value\' not present in AddressVPC JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id return cls(**args) @classmethod @@ -3605,6 +3654,8 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): diff --git a/test/unit/test_context_based_restrictions_v1.py b/test/unit/test_context_based_restrictions_v1.py index 14d71b4..7d1d923 100644 --- a/test/unit/test_context_based_restrictions_v1.py +++ b/test/unit/test_context_based_restrictions_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,21 +44,12 @@ def preprocess_url(operation_path: str): The returned request URL is used to register the mock response so it needs to match the request URL that is formed by the requests library. """ - # First, unquote the path since it might have some quoted/escaped characters in it - # due to how the generator inserts the operation paths into the unit test - # code. - operation_path = urllib.parse.unquote(operation_path) - # Next, quote the path using urllib so that we approximate what will - # happen during request processing. - operation_path = urllib.parse.quote(operation_path, safe='/') - - # Finally, form the request URL from the base URL and operation path. + # Form the request URL from the base URL and operation path. request_url = _base_url + operation_path # If the request url does NOT end with a /, then just return it as-is. - # Otherwise, return a regular expression that matches one or more trailing - # /. + # Otherwise, return a regular expression that matches one or more trailing /. if not request_url.endswith('/'): return request_url return re.compile(request_url.rstrip('/') + '/+') @@ -735,7 +726,7 @@ def test_list_available_serviceref_targets_all_params(self): """ # Set up mock url = preprocess_url('/v1/zones/serviceref_targets') - mock_response = '{"count": 5, "targets": [{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}]}]}' + mock_response = '{"count": 5, "targets": [{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}], "display_name": "display_name"}]}' responses.add( responses.GET, url, @@ -766,13 +757,11 @@ def test_list_available_serviceref_targets_all_params(self): assert 'type={}'.format(type) in query_string def test_list_available_serviceref_targets_all_params_with_retries(self): - # Enable retries and run - # test_list_available_serviceref_targets_all_params. + # Enable retries and run test_list_available_serviceref_targets_all_params. _service.enable_retries() self.test_list_available_serviceref_targets_all_params() - # Disable retries and run - # test_list_available_serviceref_targets_all_params. + # Disable retries and run test_list_available_serviceref_targets_all_params. _service.disable_retries() self.test_list_available_serviceref_targets_all_params() @@ -783,7 +772,7 @@ def test_list_available_serviceref_targets_required_params(self): """ # Set up mock url = preprocess_url('/v1/zones/serviceref_targets') - mock_response = '{"count": 5, "targets": [{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}]}]}' + mock_response = '{"count": 5, "targets": [{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}], "display_name": "display_name"}]}' responses.add( responses.GET, url, @@ -800,13 +789,11 @@ def test_list_available_serviceref_targets_required_params(self): assert response.status_code == 200 def test_list_available_serviceref_targets_required_params_with_retries(self): - # Enable retries and run - # test_list_available_serviceref_targets_required_params. + # Enable retries and run test_list_available_serviceref_targets_required_params. _service.enable_retries() self.test_list_available_serviceref_targets_required_params() - # Disable retries and run - # test_list_available_serviceref_targets_required_params. + # Disable retries and run test_list_available_serviceref_targets_required_params. _service.disable_retries() self.test_list_available_serviceref_targets_required_params() @@ -823,7 +810,7 @@ def test_get_serviceref_target_all_params(self): """ # Set up mock url = preprocess_url('/v1/zones/serviceref_targets/testString') - mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}]}' + mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}], "display_name": "display_name"}' responses.add( responses.GET, url, @@ -865,7 +852,7 @@ def test_get_serviceref_target_required_params(self): """ # Set up mock url = preprocess_url('/v1/zones/serviceref_targets/testString') - mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}]}' + mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}], "display_name": "display_name"}' responses.add( responses.GET, url, @@ -903,7 +890,7 @@ def test_get_serviceref_target_value_error(self): """ # Set up mock url = preprocess_url('/v1/zones/serviceref_targets/testString') - mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}]}' + mock_response = '{"service_name": "service_name", "service_type": "service_type", "locations": [{"display_name": "display_name", "kind": "kind", "name": "name"}], "display_name": "display_name"}' responses.add( responses.GET, url, @@ -1020,8 +1007,7 @@ def test_create_rule_all_params(self): resource_model['attributes'] = [resource_attribute_model] resource_model['tags'] = [resource_tag_attribute_model] - # Construct a dict representation of a NewRuleOperationsApiTypesItem - # model + # Construct a dict representation of a NewRuleOperationsApiTypesItem model new_rule_operations_api_types_item_model = {} new_rule_operations_api_types_item_model['api_type_id'] = 'testString' @@ -1932,13 +1918,11 @@ def test_list_available_service_operations_all_params(self): assert 'resource_type={}'.format(resource_type) in query_string def test_list_available_service_operations_all_params_with_retries(self): - # Enable retries and run - # test_list_available_service_operations_all_params. + # Enable retries and run test_list_available_service_operations_all_params. _service.enable_retries() self.test_list_available_service_operations_all_params() - # Disable retries and run - # test_list_available_service_operations_all_params. + # Disable retries and run test_list_available_service_operations_all_params. _service.disable_retries() self.test_list_available_service_operations_all_params() @@ -1966,13 +1950,11 @@ def test_list_available_service_operations_required_params(self): assert response.status_code == 200 def test_list_available_service_operations_required_params_with_retries(self): - # Enable retries and run - # test_list_available_service_operations_required_params. + # Enable retries and run test_list_available_service_operations_required_params. _service.enable_retries() self.test_list_available_service_operations_required_params() - # Disable retries and run - # test_list_available_service_operations_required_params. + # Disable retries and run test_list_available_service_operations_required_params. _service.disable_retries() self.test_list_available_service_operations_required_params() @@ -1999,8 +1981,7 @@ def test_api_type_serialization(self): Test serialization/deserialization for APIType """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. action_model = {} # Action action_model['action_id'] = 'testString' @@ -2015,13 +1996,11 @@ def test_api_type_serialization(self): api_type_model_json['actions'] = [action_model] api_type_model_json['enforcement_modes'] = ['testString'] - # Construct a model instance of APIType by calling from_dict on the - # json representation + # Construct a model instance of APIType by calling from_dict on the json representation api_type_model = APIType.from_dict(api_type_model_json) assert api_type_model != False - # Construct a model instance of APIType by calling from_dict on the - # json representation + # Construct a model instance of APIType by calling from_dict on the json representation api_type_model_dict = APIType.from_dict(api_type_model_json).__dict__ api_type_model2 = APIType(**api_type_model_dict) @@ -2059,13 +2038,11 @@ def test_account_settings_serialization(self): account_settings_model_json['last_modified_at'] = '2019-01-01T12:00:00Z' account_settings_model_json['last_modified_by_id'] = 'testString' - # Construct a model instance of AccountSettings by calling from_dict on - # the json representation + # Construct a model instance of AccountSettings by calling from_dict on the json representation account_settings_model = AccountSettings.from_dict(account_settings_model_json) assert account_settings_model != False - # Construct a model instance of AccountSettings by calling from_dict on - # the json representation + # Construct a model instance of AccountSettings by calling from_dict on the json representation account_settings_model_dict = AccountSettings.from_dict(account_settings_model_json).__dict__ account_settings_model2 = AccountSettings(**account_settings_model_dict) @@ -2092,13 +2069,11 @@ def test_action_serialization(self): action_model_json['action_id'] = 'testString' action_model_json['description'] = 'testString' - # Construct a model instance of Action by calling from_dict on the json - # representation + # Construct a model instance of Action by calling from_dict on the json representation action_model = Action.from_dict(action_model_json) assert action_model != False - # Construct a model instance of Action by calling from_dict on the json - # representation + # Construct a model instance of Action by calling from_dict on the json representation action_model_dict = Action.from_dict(action_model_json).__dict__ action_model2 = Action(**action_model_dict) @@ -2120,8 +2095,7 @@ def test_new_rule_operations_serialization(self): Test serialization/deserialization for NewRuleOperations """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. new_rule_operations_api_types_item_model = {} # NewRuleOperationsApiTypesItem new_rule_operations_api_types_item_model['api_type_id'] = 'testString' @@ -2130,13 +2104,11 @@ def test_new_rule_operations_serialization(self): new_rule_operations_model_json = {} new_rule_operations_model_json['api_types'] = [new_rule_operations_api_types_item_model] - # Construct a model instance of NewRuleOperations by calling from_dict - # on the json representation + # Construct a model instance of NewRuleOperations by calling from_dict on the json representation new_rule_operations_model = NewRuleOperations.from_dict(new_rule_operations_model_json) assert new_rule_operations_model != False - # Construct a model instance of NewRuleOperations by calling from_dict - # on the json representation + # Construct a model instance of NewRuleOperations by calling from_dict on the json representation new_rule_operations_model_dict = NewRuleOperations.from_dict(new_rule_operations_model_json).__dict__ new_rule_operations_model2 = NewRuleOperations(**new_rule_operations_model_dict) @@ -2158,20 +2130,17 @@ def test_new_rule_operations_api_types_item_serialization(self): Test serialization/deserialization for NewRuleOperationsApiTypesItem """ - # Construct a json representation of a NewRuleOperationsApiTypesItem - # model + # Construct a json representation of a NewRuleOperationsApiTypesItem model new_rule_operations_api_types_item_model_json = {} new_rule_operations_api_types_item_model_json['api_type_id'] = 'testString' - # Construct a model instance of NewRuleOperationsApiTypesItem by - # calling from_dict on the json representation + # Construct a model instance of NewRuleOperationsApiTypesItem by calling from_dict on the json representation new_rule_operations_api_types_item_model = NewRuleOperationsApiTypesItem.from_dict( new_rule_operations_api_types_item_model_json ) assert new_rule_operations_api_types_item_model != False - # Construct a model instance of NewRuleOperationsApiTypesItem by - # calling from_dict on the json representation + # Construct a model instance of NewRuleOperationsApiTypesItem by calling from_dict on the json representation new_rule_operations_api_types_item_model_dict = NewRuleOperationsApiTypesItem.from_dict( new_rule_operations_api_types_item_model_json ).__dict__ @@ -2197,8 +2166,7 @@ def test_operations_list_serialization(self): Test serialization/deserialization for OperationsList """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. action_model = {} # Action action_model['action_id'] = 'testString' @@ -2216,13 +2184,11 @@ def test_operations_list_serialization(self): operations_list_model_json = {} operations_list_model_json['api_types'] = [api_type_model] - # Construct a model instance of OperationsList by calling from_dict on - # the json representation + # Construct a model instance of OperationsList by calling from_dict on the json representation operations_list_model = OperationsList.from_dict(operations_list_model_json) assert operations_list_model != False - # Construct a model instance of OperationsList by calling from_dict on - # the json representation + # Construct a model instance of OperationsList by calling from_dict on the json representation operations_list_model_dict = OperationsList.from_dict(operations_list_model_json).__dict__ operations_list_model2 = OperationsList(**operations_list_model_dict) @@ -2244,8 +2210,7 @@ def test_resource_serialization(self): Test serialization/deserialization for Resource """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. resource_attribute_model = {} # ResourceAttribute resource_attribute_model['name'] = 'testString' @@ -2262,13 +2227,11 @@ def test_resource_serialization(self): resource_model_json['attributes'] = [resource_attribute_model] resource_model_json['tags'] = [resource_tag_attribute_model] - # Construct a model instance of Resource by calling from_dict on the - # json representation + # Construct a model instance of Resource by calling from_dict on the json representation resource_model = Resource.from_dict(resource_model_json) assert resource_model != False - # Construct a model instance of Resource by calling from_dict on the - # json representation + # Construct a model instance of Resource by calling from_dict on the json representation resource_model_dict = Resource.from_dict(resource_model_json).__dict__ resource_model2 = Resource(**resource_model_dict) @@ -2296,13 +2259,11 @@ def test_resource_attribute_serialization(self): resource_attribute_model_json['value'] = 'testString' resource_attribute_model_json['operator'] = 'testString' - # Construct a model instance of ResourceAttribute by calling from_dict - # on the json representation + # Construct a model instance of ResourceAttribute by calling from_dict on the json representation resource_attribute_model = ResourceAttribute.from_dict(resource_attribute_model_json) assert resource_attribute_model != False - # Construct a model instance of ResourceAttribute by calling from_dict - # on the json representation + # Construct a model instance of ResourceAttribute by calling from_dict on the json representation resource_attribute_model_dict = ResourceAttribute.from_dict(resource_attribute_model_json).__dict__ resource_attribute_model2 = ResourceAttribute(**resource_attribute_model_dict) @@ -2330,13 +2291,11 @@ def test_resource_tag_attribute_serialization(self): resource_tag_attribute_model_json['value'] = 'testString' resource_tag_attribute_model_json['operator'] = 'testString' - # Construct a model instance of ResourceTagAttribute by calling - # from_dict on the json representation + # Construct a model instance of ResourceTagAttribute by calling from_dict on the json representation resource_tag_attribute_model = ResourceTagAttribute.from_dict(resource_tag_attribute_model_json) assert resource_tag_attribute_model != False - # Construct a model instance of ResourceTagAttribute by calling - # from_dict on the json representation + # Construct a model instance of ResourceTagAttribute by calling from_dict on the json representation resource_tag_attribute_model_dict = ResourceTagAttribute.from_dict(resource_tag_attribute_model_json).__dict__ resource_tag_attribute_model2 = ResourceTagAttribute(**resource_tag_attribute_model_dict) @@ -2358,8 +2317,7 @@ def test_rule_serialization(self): Test serialization/deserialization for Rule """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. rule_context_attribute_model = {} # RuleContextAttribute rule_context_attribute_model['name'] = 'testString' @@ -2403,13 +2361,11 @@ def test_rule_serialization(self): rule_model_json['last_modified_at'] = '2019-01-01T12:00:00Z' rule_model_json['last_modified_by_id'] = 'testString' - # Construct a model instance of Rule by calling from_dict on the json - # representation + # Construct a model instance of Rule by calling from_dict on the json representation rule_model = Rule.from_dict(rule_model_json) assert rule_model != False - # Construct a model instance of Rule by calling from_dict on the json - # representation + # Construct a model instance of Rule by calling from_dict on the json representation rule_model_dict = Rule.from_dict(rule_model_json).__dict__ rule_model2 = Rule(**rule_model_dict) @@ -2431,8 +2387,7 @@ def test_rule_context_serialization(self): Test serialization/deserialization for RuleContext """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. rule_context_attribute_model = {} # RuleContextAttribute rule_context_attribute_model['name'] = 'testString' @@ -2442,13 +2397,11 @@ def test_rule_context_serialization(self): rule_context_model_json = {} rule_context_model_json['attributes'] = [rule_context_attribute_model] - # Construct a model instance of RuleContext by calling from_dict on the - # json representation + # Construct a model instance of RuleContext by calling from_dict on the json representation rule_context_model = RuleContext.from_dict(rule_context_model_json) assert rule_context_model != False - # Construct a model instance of RuleContext by calling from_dict on the - # json representation + # Construct a model instance of RuleContext by calling from_dict on the json representation rule_context_model_dict = RuleContext.from_dict(rule_context_model_json).__dict__ rule_context_model2 = RuleContext(**rule_context_model_dict) @@ -2475,13 +2428,11 @@ def test_rule_context_attribute_serialization(self): rule_context_attribute_model_json['name'] = 'testString' rule_context_attribute_model_json['value'] = 'testString' - # Construct a model instance of RuleContextAttribute by calling - # from_dict on the json representation + # Construct a model instance of RuleContextAttribute by calling from_dict on the json representation rule_context_attribute_model = RuleContextAttribute.from_dict(rule_context_attribute_model_json) assert rule_context_attribute_model != False - # Construct a model instance of RuleContextAttribute by calling - # from_dict on the json representation + # Construct a model instance of RuleContextAttribute by calling from_dict on the json representation rule_context_attribute_model_dict = RuleContextAttribute.from_dict(rule_context_attribute_model_json).__dict__ rule_context_attribute_model2 = RuleContextAttribute(**rule_context_attribute_model_dict) @@ -2503,8 +2454,7 @@ def test_rule_list_serialization(self): Test serialization/deserialization for RuleList """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. rule_context_attribute_model = {} # RuleContextAttribute rule_context_attribute_model['name'] = 'testString' @@ -2552,13 +2502,11 @@ def test_rule_list_serialization(self): rule_list_model_json['count'] = 38 rule_list_model_json['rules'] = [rule_model] - # Construct a model instance of RuleList by calling from_dict on the - # json representation + # Construct a model instance of RuleList by calling from_dict on the json representation rule_list_model = RuleList.from_dict(rule_list_model_json) assert rule_list_model != False - # Construct a model instance of RuleList by calling from_dict on the - # json representation + # Construct a model instance of RuleList by calling from_dict on the json representation rule_list_model_dict = RuleList.from_dict(rule_list_model_json).__dict__ rule_list_model2 = RuleList(**rule_list_model_dict) @@ -2580,8 +2528,7 @@ def test_service_ref_target_serialization(self): Test serialization/deserialization for ServiceRefTarget """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. service_ref_target_locations_item_model = {} # ServiceRefTargetLocationsItem service_ref_target_locations_item_model['display_name'] = 'testString' @@ -2593,14 +2540,13 @@ def test_service_ref_target_serialization(self): service_ref_target_model_json['service_name'] = 'testString' service_ref_target_model_json['service_type'] = 'testString' service_ref_target_model_json['locations'] = [service_ref_target_locations_item_model] + service_ref_target_model_json['display_name'] = 'testString' - # Construct a model instance of ServiceRefTarget by calling from_dict - # on the json representation + # Construct a model instance of ServiceRefTarget by calling from_dict on the json representation service_ref_target_model = ServiceRefTarget.from_dict(service_ref_target_model_json) assert service_ref_target_model != False - # Construct a model instance of ServiceRefTarget by calling from_dict - # on the json representation + # Construct a model instance of ServiceRefTarget by calling from_dict on the json representation service_ref_target_model_dict = ServiceRefTarget.from_dict(service_ref_target_model_json).__dict__ service_ref_target_model2 = ServiceRefTarget(**service_ref_target_model_dict) @@ -2622,8 +2568,7 @@ def test_service_ref_target_list_serialization(self): Test serialization/deserialization for ServiceRefTargetList """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. service_ref_target_locations_item_model = {} # ServiceRefTargetLocationsItem service_ref_target_locations_item_model['display_name'] = 'testString' @@ -2634,19 +2579,18 @@ def test_service_ref_target_list_serialization(self): service_ref_target_model['service_name'] = 'testString' service_ref_target_model['service_type'] = 'testString' service_ref_target_model['locations'] = [service_ref_target_locations_item_model] + service_ref_target_model['display_name'] = 'testString' # Construct a json representation of a ServiceRefTargetList model service_ref_target_list_model_json = {} service_ref_target_list_model_json['count'] = 38 service_ref_target_list_model_json['targets'] = [service_ref_target_model] - # Construct a model instance of ServiceRefTargetList by calling - # from_dict on the json representation + # Construct a model instance of ServiceRefTargetList by calling from_dict on the json representation service_ref_target_list_model = ServiceRefTargetList.from_dict(service_ref_target_list_model_json) assert service_ref_target_list_model != False - # Construct a model instance of ServiceRefTargetList by calling - # from_dict on the json representation + # Construct a model instance of ServiceRefTargetList by calling from_dict on the json representation service_ref_target_list_model_dict = ServiceRefTargetList.from_dict(service_ref_target_list_model_json).__dict__ service_ref_target_list_model2 = ServiceRefTargetList(**service_ref_target_list_model_dict) @@ -2668,22 +2612,19 @@ def test_service_ref_target_locations_item_serialization(self): Test serialization/deserialization for ServiceRefTargetLocationsItem """ - # Construct a json representation of a ServiceRefTargetLocationsItem - # model + # Construct a json representation of a ServiceRefTargetLocationsItem model service_ref_target_locations_item_model_json = {} service_ref_target_locations_item_model_json['display_name'] = 'testString' service_ref_target_locations_item_model_json['kind'] = 'testString' service_ref_target_locations_item_model_json['name'] = 'testString' - # Construct a model instance of ServiceRefTargetLocationsItem by - # calling from_dict on the json representation + # Construct a model instance of ServiceRefTargetLocationsItem by calling from_dict on the json representation service_ref_target_locations_item_model = ServiceRefTargetLocationsItem.from_dict( service_ref_target_locations_item_model_json ) assert service_ref_target_locations_item_model != False - # Construct a model instance of ServiceRefTargetLocationsItem by - # calling from_dict on the json representation + # Construct a model instance of ServiceRefTargetLocationsItem by calling from_dict on the json representation service_ref_target_locations_item_model_dict = ServiceRefTargetLocationsItem.from_dict( service_ref_target_locations_item_model_json ).__dict__ @@ -2717,13 +2658,11 @@ def test_service_ref_value_serialization(self): service_ref_value_model_json['service_instance'] = 'testString' service_ref_value_model_json['location'] = 'testString' - # Construct a model instance of ServiceRefValue by calling from_dict on - # the json representation + # Construct a model instance of ServiceRefValue by calling from_dict on the json representation service_ref_value_model = ServiceRefValue.from_dict(service_ref_value_model_json) assert service_ref_value_model != False - # Construct a model instance of ServiceRefValue by calling from_dict on - # the json representation + # Construct a model instance of ServiceRefValue by calling from_dict on the json representation service_ref_value_model_dict = ServiceRefValue.from_dict(service_ref_value_model_json).__dict__ service_ref_value_model2 = ServiceRefValue(**service_ref_value_model_dict) @@ -2745,8 +2684,7 @@ def test_zone_serialization(self): Test serialization/deserialization for Zone """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. address_model = {} # AddressIPAddress address_model['type'] = 'ipAddress' @@ -2769,13 +2707,11 @@ def test_zone_serialization(self): zone_model_json['last_modified_at'] = '2019-01-01T12:00:00Z' zone_model_json['last_modified_by_id'] = 'testString' - # Construct a model instance of Zone by calling from_dict on the json - # representation + # Construct a model instance of Zone by calling from_dict on the json representation zone_model = Zone.from_dict(zone_model_json) assert zone_model != False - # Construct a model instance of Zone by calling from_dict on the json - # representation + # Construct a model instance of Zone by calling from_dict on the json representation zone_model_dict = Zone.from_dict(zone_model_json).__dict__ zone_model2 = Zone(**zone_model_dict) @@ -2797,8 +2733,7 @@ def test_zone_list_serialization(self): Test serialization/deserialization for ZoneList """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. address_model = {} # AddressIPAddress address_model['type'] = 'ipAddress' @@ -2823,13 +2758,11 @@ def test_zone_list_serialization(self): zone_list_model_json['count'] = 38 zone_list_model_json['zones'] = [zone_summary_model] - # Construct a model instance of ZoneList by calling from_dict on the - # json representation + # Construct a model instance of ZoneList by calling from_dict on the json representation zone_list_model = ZoneList.from_dict(zone_list_model_json) assert zone_list_model != False - # Construct a model instance of ZoneList by calling from_dict on the - # json representation + # Construct a model instance of ZoneList by calling from_dict on the json representation zone_list_model_dict = ZoneList.from_dict(zone_list_model_json).__dict__ zone_list_model2 = ZoneList(**zone_list_model_dict) @@ -2851,8 +2784,7 @@ def test_zone_summary_serialization(self): Test serialization/deserialization for ZoneSummary """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. address_model = {} # AddressIPAddress address_model['type'] = 'ipAddress' @@ -2873,13 +2805,11 @@ def test_zone_summary_serialization(self): zone_summary_model_json['last_modified_at'] = '2019-01-01T12:00:00Z' zone_summary_model_json['last_modified_by_id'] = 'testString' - # Construct a model instance of ZoneSummary by calling from_dict on the - # json representation + # Construct a model instance of ZoneSummary by calling from_dict on the json representation zone_summary_model = ZoneSummary.from_dict(zone_summary_model_json) assert zone_summary_model != False - # Construct a model instance of ZoneSummary by calling from_dict on the - # json representation + # Construct a model instance of ZoneSummary by calling from_dict on the json representation zone_summary_model_dict = ZoneSummary.from_dict(zone_summary_model_json).__dict__ zone_summary_model2 = ZoneSummary(**zone_summary_model_dict) @@ -2906,13 +2836,11 @@ def test_address_ip_address_serialization(self): address_ip_address_model_json['type'] = 'ipAddress' address_ip_address_model_json['value'] = 'testString' - # Construct a model instance of AddressIPAddress by calling from_dict - # on the json representation + # Construct a model instance of AddressIPAddress by calling from_dict on the json representation address_ip_address_model = AddressIPAddress.from_dict(address_ip_address_model_json) assert address_ip_address_model != False - # Construct a model instance of AddressIPAddress by calling from_dict - # on the json representation + # Construct a model instance of AddressIPAddress by calling from_dict on the json representation address_ip_address_model_dict = AddressIPAddress.from_dict(address_ip_address_model_json).__dict__ address_ip_address_model2 = AddressIPAddress(**address_ip_address_model_dict) @@ -2939,13 +2867,11 @@ def test_address_ip_address_range_serialization(self): address_ip_address_range_model_json['type'] = 'ipRange' address_ip_address_range_model_json['value'] = 'testString' - # Construct a model instance of AddressIPAddressRange by calling - # from_dict on the json representation + # Construct a model instance of AddressIPAddressRange by calling from_dict on the json representation address_ip_address_range_model = AddressIPAddressRange.from_dict(address_ip_address_range_model_json) assert address_ip_address_range_model != False - # Construct a model instance of AddressIPAddressRange by calling - # from_dict on the json representation + # Construct a model instance of AddressIPAddressRange by calling from_dict on the json representation address_ip_address_range_model_dict = AddressIPAddressRange.from_dict( address_ip_address_range_model_json ).__dict__ @@ -2969,8 +2895,7 @@ def test_address_service_ref_serialization(self): Test serialization/deserialization for AddressServiceRef """ - # Construct dict forms of any model objects needed in order to build - # this model. + # Construct dict forms of any model objects needed in order to build this model. service_ref_value_model = {} # ServiceRefValue service_ref_value_model['account_id'] = 'testString' @@ -2984,13 +2909,11 @@ def test_address_service_ref_serialization(self): address_service_ref_model_json['type'] = 'serviceRef' address_service_ref_model_json['ref'] = service_ref_value_model - # Construct a model instance of AddressServiceRef by calling from_dict - # on the json representation + # Construct a model instance of AddressServiceRef by calling from_dict on the json representation address_service_ref_model = AddressServiceRef.from_dict(address_service_ref_model_json) assert address_service_ref_model != False - # Construct a model instance of AddressServiceRef by calling from_dict - # on the json representation + # Construct a model instance of AddressServiceRef by calling from_dict on the json representation address_service_ref_model_dict = AddressServiceRef.from_dict(address_service_ref_model_json).__dict__ address_service_ref_model2 = AddressServiceRef(**address_service_ref_model_dict) @@ -3017,13 +2940,11 @@ def test_address_subnet_serialization(self): address_subnet_model_json['type'] = 'subnet' address_subnet_model_json['value'] = 'testString' - # Construct a model instance of AddressSubnet by calling from_dict on - # the json representation + # Construct a model instance of AddressSubnet by calling from_dict on the json representation address_subnet_model = AddressSubnet.from_dict(address_subnet_model_json) assert address_subnet_model != False - # Construct a model instance of AddressSubnet by calling from_dict on - # the json representation + # Construct a model instance of AddressSubnet by calling from_dict on the json representation address_subnet_model_dict = AddressSubnet.from_dict(address_subnet_model_json).__dict__ address_subnet_model2 = AddressSubnet(**address_subnet_model_dict) @@ -3050,13 +2971,11 @@ def test_address_vpc_serialization(self): address_vpc_model_json['type'] = 'vpc' address_vpc_model_json['value'] = 'testString' - # Construct a model instance of AddressVPC by calling from_dict on the - # json representation + # Construct a model instance of AddressVPC by calling from_dict on the json representation address_vpc_model = AddressVPC.from_dict(address_vpc_model_json) assert address_vpc_model != False - # Construct a model instance of AddressVPC by calling from_dict on the - # json representation + # Construct a model instance of AddressVPC by calling from_dict on the json representation address_vpc_model_dict = AddressVPC.from_dict(address_vpc_model_json).__dict__ address_vpc_model2 = AddressVPC(**address_vpc_model_dict)