diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index c077c9c..e8f89aa 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2020, 2021. +# (C) Copyright IBM Corp. 2021. # # 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.28.0-55613c9e-20210220-164656 +# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156 """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage infrastructure resources, including virtual server instances, subnets, volumes, @@ -49,7 +49,7 @@ class VpcV1(BaseService): @classmethod def new_instance( cls, - version: str = '2021-03-09', + version: str = '2021-05-06', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -75,7 +75,7 @@ def new_instance( def __init__( self, - version: str = '2021-03-09', + version: str = '2021-05-06', authenticator: Authenticator = None, generation: int = 2, ) -> None: @@ -1948,6 +1948,8 @@ def replace_subnet_network_acl(self, id: str, raise ValueError('id must be provided') if network_acl_identity is None: raise ValueError('network_acl_identity must be provided') + if isinstance(network_acl_identity, NetworkACLIdentity): + network_acl_identity = convert_model(network_acl_identity) headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2077,6 +2079,8 @@ def set_subnet_public_gateway( raise ValueError('id must be provided') if public_gateway_identity is None: raise ValueError('public_gateway_identity must be provided') + if isinstance(public_gateway_identity, PublicGatewayIdentity): + public_gateway_identity = convert_model(public_gateway_identity) headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2169,6 +2173,8 @@ def replace_subnet_routing_table( raise ValueError('id must be provided') if routing_table_identity is None: raise ValueError('routing_table_identity must be provided') + if isinstance(routing_table_identity, RoutingTableIdentity): + routing_table_identity = convert_model(routing_table_identity) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -2573,9 +2579,10 @@ def delete_image(self, id: str, **kwargs) -> DetailedResponse: """ Delete an image. - This request deletes an image. This operation cannot be reversed. System-provided - images are not allowed to be deleted. An image with a `status` of `pending`, - `tentative`, or `deleting` cannot be deleted. + This request deletes an image. This operation cannot be reversed. A + system-provided image is not allowed to be deleted. Additionally, an image cannot + be deleted if it has a + `status` of `pending`, `tentative`, or `deleting`. :param str id: The image identifier. :param dict headers: A `dict` containing the request headers @@ -2653,7 +2660,7 @@ def update_image(self, id: str, image_patch: 'ImagePatch', This request updates an image with the information in a provided image patch. The image patch object is structured in the same way as a retrieved image and contains - only the information to be updated. System-provided images are not allowed to be + only the information to be updated. A system-provided image is not allowed to be updated. An image with a `status` of `deleting` cannot be updated. :param str id: The image identifier. @@ -3630,6 +3637,205 @@ def create_instance_action(self, response = self.send(request) return response + def create_instance_console_access_token(self, + instance_id: str, + console_type: str, + *, + force: bool = None, + **kwargs) -> DetailedResponse: + """ + Create a console access token for an instance. + + This request creates a new single-use console access token for an instance. All + console configuration is provided at token create time, and the token is + subsequently used in the `access_token` query parameter for the WebSocket request. + The access token is only valid for a short period of time, and a maximum of one + token is valid for a given instance at a time. + + :param str instance_id: The instance identifier. + :param str console_type: The instance console type for which this token may + be used. + :param bool force: (optional) Indicates whether to disconnect an existing + serial console session as the serial console cannot be shared. This has no + effect on VNC consoles. + :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 `InstanceConsoleAccessToken` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + if console_type is None: + raise ValueError('console_type must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_instance_console_access_token') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + data = {'console_type': console_type, 'force': force} + 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')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id'] + path_param_values = self.encode_path_vars(instance_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/console_access_token'.format( + **path_param_dict) + request = self.prepare_request(method='POST', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + + def list_instance_disks(self, instance_id: str, + **kwargs) -> DetailedResponse: + """ + List all disks on an instance. + + This request lists all disks on an instance. A disk is a block device that is + locally attached to the instance's physical host and is also referred to as + instance storage. By default, the listed disks are sorted by their `created_at` + property values, with the newest disk first. + + :param str instance_id: The instance identifier. + :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 `InstanceDiskCollection` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_instance_disks') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id'] + path_param_values = self.encode_path_vars(instance_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/disks'.format(**path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def get_instance_disk(self, instance_id: str, id: str, + **kwargs) -> DetailedResponse: + """ + Retrieve an instance disk. + + This request retrieves a single instance disk specified by the identifier in the + URL. + + :param str instance_id: The instance identifier. + :param str id: The instance disk identifier. + :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 `InstanceDisk` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_instance_disk') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/disks/{id}'.format(**path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def update_instance_disk(self, instance_id: str, id: str, + instance_disk_patch: 'InstanceDiskPatch', + **kwargs) -> DetailedResponse: + """ + Update an instance disk. + + This request updates the instance disk with the information in a provided patch. + + :param str instance_id: The instance identifier. + :param str id: The instance disk identifier. + :param InstanceDiskPatch instance_disk_patch: The instance disk patch. + :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 `InstanceDisk` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + if id is None: + raise ValueError('id must be provided') + if instance_disk_patch is None: + raise ValueError('instance_disk_patch must be provided') + if isinstance(instance_disk_patch, InstanceDiskPatch): + instance_disk_patch = convert_model(instance_disk_patch) + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_instance_disk') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + data = json.dumps(instance_disk_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/disks/{id}'.format(**path_param_dict) + request = self.prepare_request(method='PATCH', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + def list_instance_network_interfaces(self, instance_id: str, **kwargs) -> DetailedResponse: """ @@ -3859,10 +4065,10 @@ def update_instance_network_interface( """ Update a network interface. - This request updates a network interface with the information in a provided - network interface patch. The network interface patch object is structured in the - same way as a retrieved network interface and can contain an updated name and/or - port speed. + This request updates a network interface with the information provided in a + network interface patch object. The network interface patch object is structured + in the same way as a retrieved network interface and needs to contain only the + information to be updated. :param str instance_id: The instance identifier. :param str id: The network interface identifier. @@ -4321,9 +4527,10 @@ def update_instance_volume_attachment( """ Update a volume attachment. - This request updates a volume attachment with the information in a provided volume - attachment patch. The volume attachment patch object is structured in the same way - as a retrieved volume attachment and can contain an updated name. + This request updates a volume attachment with the information provided in a volume + attachment patch object. The volume attachment patch object is structured in the + same way as a retrieved volume attachment and needs to contain only the + information to be updated. :param str instance_id: The instance identifier. :param str id: The volume attachment identifier. @@ -4680,7 +4887,11 @@ def delete_instance_group_load_balancer(self, instance_group_id: str, response = self.send(request) return response - def list_instance_group_managers(self, instance_group_id: str, + def list_instance_group_managers(self, + instance_group_id: str, + *, + start: str = None, + limit: int = None, **kwargs) -> DetailedResponse: """ List all managers for an instance group. @@ -4688,6 +4899,9 @@ def list_instance_group_managers(self, instance_group_id: str, This request lists all managers for an instance group. :param str instance_group_id: The instance group identifier. + :param str start: (optional) A server-supplied token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `InstanceGroupManagerCollection` object @@ -4702,7 +4916,12 @@ def list_instance_group_managers(self, instance_group_id: str, operation_id='list_instance_group_managers') headers.update(sdk_headers) - params = {'version': self.version, 'generation': self.generation} + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } if 'headers' in kwargs: headers.update(kwargs.get('headers')) @@ -4922,8 +5141,306 @@ def update_instance_group_manager( response = self.send(request) return response - def list_instance_group_manager_policies(self, instance_group_id: str, + def list_instance_group_manager_actions(self, + instance_group_id: str, + instance_group_manager_id: str, + *, + start: str = None, + limit: int = None, + **kwargs) -> DetailedResponse: + """ + List all actions for an instance group manager. + + This request lists all instance group actions for an instance group manager. + + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param str start: (optional) A server-supplied token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :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 `InstanceGroupManagerActionsCollection` object + """ + + if instance_group_id is None: + raise ValueError('instance_group_id must be provided') + if instance_group_manager_id is None: + raise ValueError('instance_group_manager_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_instance_group_manager_actions') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_group_id', 'instance_group_manager_id'] + path_param_values = self.encode_path_vars(instance_group_id, + instance_group_manager_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions'.format( + **path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def create_instance_group_manager_action( + self, instance_group_id: str, instance_group_manager_id: str, + instance_group_manager_action_prototype: + 'InstanceGroupManagerActionPrototype', **kwargs) -> DetailedResponse: + """ + Create an instance group manager action. + + This request creates a new instance group manager action. + + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param InstanceGroupManagerActionPrototype + instance_group_manager_action_prototype: The instance group manager action + prototype object. + :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 `InstanceGroupManagerAction` object + """ + + if instance_group_id is None: + raise ValueError('instance_group_id must be provided') + if instance_group_manager_id is None: + raise ValueError('instance_group_manager_id must be provided') + if instance_group_manager_action_prototype is None: + raise ValueError( + 'instance_group_manager_action_prototype must be provided') + if isinstance(instance_group_manager_action_prototype, + InstanceGroupManagerActionPrototype): + instance_group_manager_action_prototype = convert_model( + instance_group_manager_action_prototype) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_instance_group_manager_action') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + data = json.dumps(instance_group_manager_action_prototype) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_group_id', 'instance_group_manager_id'] + path_param_values = self.encode_path_vars(instance_group_id, + instance_group_manager_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions'.format( + **path_param_dict) + request = self.prepare_request(method='POST', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + + def delete_instance_group_manager_action(self, instance_group_id: str, + instance_group_manager_id: str, + id: str, + **kwargs) -> DetailedResponse: + """ + Delete specified instance group manager action. + + This request deletes an instance group manager action. This operation cannot be + reversed. + + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param str id: The instance group manager action identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if instance_group_id is None: + raise ValueError('instance_group_id must be provided') + if instance_group_manager_id is None: + raise ValueError('instance_group_manager_id must be provided') + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_instance_group_manager_action') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + + path_param_keys = [ + 'instance_group_id', 'instance_group_manager_id', 'id' + ] + path_param_values = self.encode_path_vars(instance_group_id, + instance_group_manager_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}'.format( + **path_param_dict) + request = self.prepare_request(method='DELETE', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def get_instance_group_manager_action(self, instance_group_id: str, + instance_group_manager_id: str, + id: str, + **kwargs) -> DetailedResponse: + """ + Retrieve specified instance group manager action. + + This request retrieves a single instance group manager action specified by + identifier in the URL. + + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param str id: The instance group manager action identifier. + :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 `InstanceGroupManagerAction` object + """ + + if instance_group_id is None: + raise ValueError('instance_group_id must be provided') + if instance_group_manager_id is None: + raise ValueError('instance_group_manager_id must be provided') + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_instance_group_manager_action') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = [ + 'instance_group_id', 'instance_group_manager_id', 'id' + ] + path_param_values = self.encode_path_vars(instance_group_id, + instance_group_manager_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}'.format( + **path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def update_instance_group_manager_action( + self, instance_group_id: str, instance_group_manager_id: str, + id: str, instance_group_manager_action_patch: + 'InstanceGroupManagerActionPatch', **kwargs) -> DetailedResponse: + """ + Update specified instance group manager action. + + This request updates an instance group manager action. + + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param str id: The instance group manager action identifier. + :param InstanceGroupManagerActionPatch instance_group_manager_action_patch: + The instance group manager action patch. + :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 `InstanceGroupManagerAction` object + """ + + if instance_group_id is None: + raise ValueError('instance_group_id must be provided') + if instance_group_manager_id is None: + raise ValueError('instance_group_manager_id must be provided') + if id is None: + raise ValueError('id must be provided') + if instance_group_manager_action_patch is None: + raise ValueError( + 'instance_group_manager_action_patch must be provided') + if isinstance(instance_group_manager_action_patch, + InstanceGroupManagerActionPatch): + instance_group_manager_action_patch = convert_model( + instance_group_manager_action_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_instance_group_manager_action') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + data = json.dumps(instance_group_manager_action_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = [ + 'instance_group_id', 'instance_group_manager_id', 'id' + ] + path_param_values = self.encode_path_vars(instance_group_id, + instance_group_manager_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}'.format( + **path_param_dict) + request = self.prepare_request(method='PATCH', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + + def list_instance_group_manager_policies(self, + instance_group_id: str, instance_group_manager_id: str, + *, + start: str = None, + limit: int = None, **kwargs) -> DetailedResponse: """ List all policies for an instance group manager. @@ -4933,6 +5450,9 @@ def list_instance_group_manager_policies(self, instance_group_id: str, :param str instance_group_id: The instance group identifier. :param str instance_group_manager_id: The instance group manager identifier. + :param str start: (optional) A server-supplied token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `InstanceGroupManagerPolicyCollection` object @@ -4949,7 +5469,12 @@ def list_instance_group_manager_policies(self, instance_group_id: str, operation_id='list_instance_group_manager_policies') headers.update(sdk_headers) - params = {'version': self.version, 'generation': self.generation} + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } if 'headers' in kwargs: headers.update(kwargs.get('headers')) @@ -5247,7 +5772,11 @@ def delete_instance_group_memberships(self, instance_group_id: str, response = self.send(request) return response - def list_instance_group_memberships(self, instance_group_id: str, + def list_instance_group_memberships(self, + instance_group_id: str, + *, + start: str = None, + limit: int = None, **kwargs) -> DetailedResponse: """ List all memberships for an instance group. @@ -5255,6 +5784,9 @@ def list_instance_group_memberships(self, instance_group_id: str, This request lists all instance group memberships for an instance group. :param str instance_group_id: The instance group identifier. + :param str start: (optional) A server-supplied token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `InstanceGroupMembershipCollection` object @@ -5269,7 +5801,12 @@ def list_instance_group_memberships(self, instance_group_id: str, operation_id='list_instance_group_memberships') headers.update(sdk_headers) - params = {'version': self.version, 'generation': self.generation} + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } if 'headers' in kwargs: headers.update(kwargs.get('headers')) @@ -5888,6 +6425,149 @@ def create_dedicated_host( response = self.send(request) return response + def list_dedicated_host_disks(self, dedicated_host_id: str, + **kwargs) -> DetailedResponse: + """ + List all disks on a dedicated host. + + This request lists all disks on a dedicated host. A disk is a physical device + that is locally attached to the compute node. By default, the listed disks are + sorted by their + `created_at` property values, with the newest disk first. + + :param str dedicated_host_id: The dedicated host identifier. + :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 `DedicatedHostDiskCollection` object + """ + + if dedicated_host_id is None: + raise ValueError('dedicated_host_id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_dedicated_host_disks') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['dedicated_host_id'] + path_param_values = self.encode_path_vars(dedicated_host_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/dedicated_hosts/{dedicated_host_id}/disks'.format( + **path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def get_dedicated_host_disk(self, dedicated_host_id: str, id: str, + **kwargs) -> DetailedResponse: + """ + Retrieve a dedicated host disk. + + This request retrieves a single dedicated host disk specified by the identifier in + the URL. + + :param str dedicated_host_id: The dedicated host identifier. + :param str id: The dedicated host disk identifier. + :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 `DedicatedHostDisk` object + """ + + if dedicated_host_id is None: + raise ValueError('dedicated_host_id must be provided') + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_dedicated_host_disk') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['dedicated_host_id', 'id'] + path_param_values = self.encode_path_vars(dedicated_host_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/dedicated_hosts/{dedicated_host_id}/disks/{id}'.format( + **path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request) + return response + + def update_dedicated_host_disk( + self, dedicated_host_id: str, id: str, + dedicated_host_disk_patch: 'DedicatedHostDiskPatch', + **kwargs) -> DetailedResponse: + """ + Update a dedicated host disk. + + This request updates the dedicated host disk with the information in a provided + patch. + + :param str dedicated_host_id: The dedicated host identifier. + :param str id: The dedicated host disk identifier. + :param DedicatedHostDiskPatch dedicated_host_disk_patch: The dedicated host + disk patch. + :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 `DedicatedHostDisk` object + """ + + if dedicated_host_id is None: + raise ValueError('dedicated_host_id must be provided') + if id is None: + raise ValueError('id must be provided') + if dedicated_host_disk_patch is None: + raise ValueError('dedicated_host_disk_patch must be provided') + if isinstance(dedicated_host_disk_patch, DedicatedHostDiskPatch): + dedicated_host_disk_patch = convert_model(dedicated_host_disk_patch) + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_dedicated_host_disk') + headers.update(sdk_headers) + + params = {'version': self.version, 'generation': self.generation} + + data = json.dumps(dedicated_host_disk_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['dedicated_host_id', 'id'] + path_param_values = self.encode_path_vars(dedicated_host_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/dedicated_hosts/{dedicated_host_id}/disks/{id}'.format( + **path_param_dict) + request = self.prepare_request(method='PATCH', + url=url, + headers=headers, + params=params, + data=data) + + response = self.send(request) + return response + def delete_dedicated_host(self, id: str, **kwargs) -> DetailedResponse: """ Delete a dedicated host. @@ -10277,8 +10957,8 @@ def create_load_balancer_listener( This request creates a new listener for a load balancer. :param str load_balancer_id: The load balancer identifier. - :param int port: The listener port number. Each listener in the load - balancer must have a unique + :param int port: The listener port number, or the inclusive lower bound of + the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. :param str protocol: The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support @@ -10864,9 +11544,18 @@ def create_load_balancer_listener_policy_rule(self, :param str policy_id: The policy identifier. :param str condition: The condition of the rule. :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :param str value: Value to be matched for rule condition. - :param str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :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 `LoadBalancerListenerPolicyRule` object @@ -13158,6 +13847,7 @@ class DedicatedHost(): :attr datetime created_at: The date and time that the dedicated host was created. :attr str crn: The CRN for this dedicated host. + :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. :attr DedicatedHostGroupReference group: The dedicated host group this dedicated host is in. :attr str href: The URL for this dedicated host. @@ -13191,6 +13881,7 @@ class DedicatedHost(): def __init__(self, available_memory: int, available_vcpu: 'VCPU', created_at: datetime, crn: str, + disks: List['DedicatedHostDisk'], group: 'DedicatedHostGroupReference', href: str, id: str, instance_placement_enabled: bool, instances: List['InstanceReference'], lifecycle_state: str, @@ -13209,6 +13900,8 @@ def __init__(self, available_memory: int, available_vcpu: 'VCPU', :param datetime created_at: The date and time that the dedicated host was created. :param str crn: The CRN for this dedicated host. + :param List[DedicatedHostDisk] disks: Collection of the dedicated host's + disks. :param DedicatedHostGroupReference group: The dedicated host group this dedicated host is in. :param str href: The URL for this dedicated host. @@ -13245,6 +13938,7 @@ def __init__(self, available_memory: int, available_vcpu: 'VCPU', self.available_vcpu = available_vcpu self.created_at = created_at self.crn = crn + self.disks = disks self.group = group self.href = href self.id = id @@ -13290,6 +13984,13 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHost': else: raise ValueError( 'Required property \'crn\' not present in DedicatedHost JSON') + if 'disks' in _dict: + args['disks'] = [ + DedicatedHostDisk.from_dict(x) for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in DedicatedHost JSON') if 'group' in _dict: args['group'] = DedicatedHostGroupReference.from_dict( _dict.get('group')) @@ -13413,6 +14114,8 @@ def to_dict(self) -> Dict: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] if hasattr(self, 'group') and self.group is not None: _dict['group'] = self.group.to_dict() if hasattr(self, 'href') and self.href is not None: @@ -13741,6 +14444,374 @@ def __ne__(self, other: 'DedicatedHostCollectionNext') -> bool: return not self == other +class DedicatedHostDisk(): + """ + DedicatedHostDisk. + + :attr int available: The remaining space left for instance placement in GB + (gigabytes). + :attr datetime created_at: The date and time that the disk was created. + :attr str href: The URL for this disk. + :attr str id: The unique identifier for this disk. + :attr List[InstanceDiskReference] instance_disks: Instance disks that are on + this dedicated host disk. + :attr str interface_type: The disk interface used for attaching the disk + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str lifecycle_state: (optional) The lifecycle state of this dedicated host + disk. + :attr str name: The user-defined or system-provided name for this disk. + :attr bool provisionable: Indicates whether this dedicated host disk is + available for instance disk creation. + :attr str resource_type: The type of resource referenced. + :attr int size: The size of the disk in GB (gigabytes). + :attr List[str] supported_instance_interface_types: The instance disk interfaces + supported for this dedicated host disk. + """ + + def __init__(self, + available: int, + created_at: datetime, + href: str, + id: str, + instance_disks: List['InstanceDiskReference'], + interface_type: str, + name: str, + provisionable: bool, + resource_type: str, + size: int, + supported_instance_interface_types: List[str], + *, + lifecycle_state: str = None) -> None: + """ + Initialize a DedicatedHostDisk object. + + :param int available: The remaining space left for instance placement in GB + (gigabytes). + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this disk. + :param str id: The unique identifier for this disk. + :param List[InstanceDiskReference] instance_disks: Instance disks that are + on this dedicated host disk. + :param str interface_type: The disk interface used for attaching the disk + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str name: The user-defined or system-provided name for this disk. + :param bool provisionable: Indicates whether this dedicated host disk is + available for instance disk creation. + :param str resource_type: The type of resource referenced. + :param int size: The size of the disk in GB (gigabytes). + :param List[str] supported_instance_interface_types: The instance disk + interfaces supported for this dedicated host disk. + :param str lifecycle_state: (optional) The lifecycle state of this + dedicated host disk. + """ + self.available = available + self.created_at = created_at + self.href = href + self.id = id + self.instance_disks = instance_disks + self.interface_type = interface_type + self.lifecycle_state = lifecycle_state + self.name = name + self.provisionable = provisionable + self.resource_type = resource_type + self.size = size + self.supported_instance_interface_types = supported_instance_interface_types + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDisk': + """Initialize a DedicatedHostDisk object from a json dictionary.""" + args = {} + if 'available' in _dict: + args['available'] = _dict.get('available') + else: + raise ValueError( + 'Required property \'available\' not present in DedicatedHostDisk JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in DedicatedHostDisk JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in DedicatedHostDisk JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in DedicatedHostDisk JSON' + ) + if 'instance_disks' in _dict: + args['instance_disks'] = [ + InstanceDiskReference.from_dict(x) + for x in _dict.get('instance_disks') + ] + else: + raise ValueError( + 'Required property \'instance_disks\' not present in DedicatedHostDisk JSON' + ) + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError( + 'Required property \'interface_type\' not present in DedicatedHostDisk JSON' + ) + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in DedicatedHostDisk JSON' + ) + if 'provisionable' in _dict: + args['provisionable'] = _dict.get('provisionable') + else: + raise ValueError( + 'Required property \'provisionable\' not present in DedicatedHostDisk JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in DedicatedHostDisk JSON' + ) + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError( + 'Required property \'size\' not present in DedicatedHostDisk JSON' + ) + if 'supported_instance_interface_types' in _dict: + args['supported_instance_interface_types'] = _dict.get( + 'supported_instance_interface_types') + else: + raise ValueError( + 'Required property \'supported_instance_interface_types\' not present in DedicatedHostDisk JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostDisk 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, 'available') and self.available is not None: + _dict['available'] = self.available + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'instance_disks') and self.instance_disks is not None: + _dict['instance_disks'] = [x.to_dict() for x in self.instance_disks] + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type + if hasattr(self, + 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'provisionable') and self.provisionable is not None: + _dict['provisionable'] = self.provisionable + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + if hasattr(self, 'supported_instance_interface_types' + ) and self.supported_instance_interface_types is not None: + _dict[ + 'supported_instance_interface_types'] = self.supported_instance_interface_types + 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 DedicatedHostDisk object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostDisk') -> 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: 'DedicatedHostDisk') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InterfaceTypeEnum(str, Enum): + """ + The disk interface used for attaching the disk + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + NVME = 'nvme' + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of this dedicated host disk. + """ + DELETED = 'deleted' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + UPDATING = 'updating' + WAITING = 'waiting' + SUSPENDED = 'suspended' + + class ResourceTypeEnum(str, Enum): + """ + The type of resource referenced. + """ + DEDICATED_HOST_DISK = 'dedicated_host_disk' + + class SupportedInstanceInterfaceTypesEnum(str, Enum): + """ + The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + VIRTIO_BLK = 'virtio_blk' + NVME = 'nvme' + + +class DedicatedHostDiskCollection(): + """ + DedicatedHostDiskCollection. + + :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. + """ + + def __init__(self, disks: List['DedicatedHostDisk']) -> None: + """ + Initialize a DedicatedHostDiskCollection object. + + :param List[DedicatedHostDisk] disks: Collection of the dedicated host's + disks. + """ + self.disks = disks + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection': + """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" + args = {} + if 'disks' in _dict: + args['disks'] = [ + DedicatedHostDisk.from_dict(x) for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in DedicatedHostDiskCollection JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostDiskCollection 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, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] + 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 DedicatedHostDiskCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostDiskCollection') -> 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: 'DedicatedHostDiskCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class DedicatedHostDiskPatch(): + """ + DedicatedHostDiskPatch. + + :attr str name: (optional) The user-defined name for this disk. + """ + + def __init__(self, *, name: str = None) -> None: + """ + Initialize a DedicatedHostDiskPatch object. + + :param str name: (optional) The user-defined name for this disk. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch': + """Initialize a DedicatedHostDiskPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostDiskPatch 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 + 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 DedicatedHostDiskPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostDiskPatch') -> 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: 'DedicatedHostDiskPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class DedicatedHostGroup(): """ DedicatedHostGroup. @@ -14625,6 +15696,8 @@ class DedicatedHostProfile(): DedicatedHostProfile. :attr str class_: The product class this dedicated host profile belongs to. + :attr List[DedicatedHostProfileDisk] disks: Collection of the dedicated host + profile's disks. :attr str family: The product family this dedicated host profile belongs to The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt @@ -14641,9 +15714,9 @@ class DedicatedHostProfile(): :attr DedicatedHostProfileVCPU vcpu_count: """ - def __init__(self, class_: str, family: str, href: str, - memory: 'DedicatedHostProfileMemory', name: str, - socket_count: 'DedicatedHostProfileSocket', + def __init__(self, class_: str, disks: List['DedicatedHostProfileDisk'], + family: str, href: str, memory: 'DedicatedHostProfileMemory', + name: str, socket_count: 'DedicatedHostProfileSocket', supported_instance_profiles: List['InstanceProfileReference'], vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture', vcpu_count: 'DedicatedHostProfileVCPU') -> None: @@ -14652,6 +15725,8 @@ def __init__(self, class_: str, family: str, href: str, :param str class_: The product class this dedicated host profile belongs to. + :param List[DedicatedHostProfileDisk] disks: Collection of the dedicated + host profile's disks. :param str family: The product family this dedicated host profile belongs to The enumerated values for this property are expected to expand in the @@ -14669,6 +15744,7 @@ def __init__(self, class_: str, family: str, href: str, :param DedicatedHostProfileVCPU vcpu_count: """ self.class_ = class_ + self.disks = disks self.family = family self.href = href self.memory = memory @@ -14688,6 +15764,15 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile': raise ValueError( 'Required property \'class\' not present in DedicatedHostProfile JSON' ) + if 'disks' in _dict: + args['disks'] = [ + DedicatedHostProfileDisk.from_dict(x) + for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in DedicatedHostProfile JSON' + ) if 'family' in _dict: args['family'] = _dict.get('family') else: @@ -14753,6 +15838,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'class_') and self.class_ is not None: _dict['class'] = self.class_ + if hasattr(self, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: @@ -15050,6 +16137,453 @@ def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool: return not self == other +class DedicatedHostProfileDisk(): + """ + Disks provided by this profile. + + :attr DedicatedHostProfileDiskInterface interface_type: + :attr DedicatedHostProfileDiskQuantity quantity: The number of disks of this + type for a dedicated host with this profile. + :attr DedicatedHostProfileDiskSize size: The size of the disk in GB (gigabytes). + :attr DedicatedHostProfileDiskSupportedInterfaces + supported_instance_interface_types: + """ + + def __init__( + self, interface_type: 'DedicatedHostProfileDiskInterface', + quantity: 'DedicatedHostProfileDiskQuantity', + size: 'DedicatedHostProfileDiskSize', + supported_instance_interface_types: + 'DedicatedHostProfileDiskSupportedInterfaces' + ) -> None: + """ + Initialize a DedicatedHostProfileDisk object. + + :param DedicatedHostProfileDiskInterface interface_type: + :param DedicatedHostProfileDiskQuantity quantity: The number of disks of + this type for a dedicated host with this profile. + :param DedicatedHostProfileDiskSize size: The size of the disk in GB + (gigabytes). + :param DedicatedHostProfileDiskSupportedInterfaces + supported_instance_interface_types: + """ + self.interface_type = interface_type + self.quantity = quantity + self.size = size + self.supported_instance_interface_types = supported_instance_interface_types + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDisk': + """Initialize a DedicatedHostProfileDisk object from a json dictionary.""" + args = {} + if 'interface_type' in _dict: + args[ + 'interface_type'] = DedicatedHostProfileDiskInterface.from_dict( + _dict.get('interface_type')) + else: + raise ValueError( + 'Required property \'interface_type\' not present in DedicatedHostProfileDisk JSON' + ) + if 'quantity' in _dict: + args['quantity'] = DedicatedHostProfileDiskQuantity.from_dict( + _dict.get('quantity')) + else: + raise ValueError( + 'Required property \'quantity\' not present in DedicatedHostProfileDisk JSON' + ) + if 'size' in _dict: + args['size'] = DedicatedHostProfileDiskSize.from_dict( + _dict.get('size')) + else: + raise ValueError( + 'Required property \'size\' not present in DedicatedHostProfileDisk JSON' + ) + if 'supported_instance_interface_types' in _dict: + args[ + 'supported_instance_interface_types'] = DedicatedHostProfileDiskSupportedInterfaces.from_dict( + _dict.get('supported_instance_interface_types')) + else: + raise ValueError( + 'Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostProfileDisk 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, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type.to_dict() + if hasattr(self, 'quantity') and self.quantity is not None: + _dict['quantity'] = self.quantity.to_dict() + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size.to_dict() + if hasattr(self, 'supported_instance_interface_types' + ) and self.supported_instance_interface_types is not None: + _dict[ + 'supported_instance_interface_types'] = self.supported_instance_interface_types.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 DedicatedHostProfileDisk object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostProfileDisk') -> 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: 'DedicatedHostProfileDisk') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class DedicatedHostProfileDiskInterface(): + """ + DedicatedHostProfileDiskInterface. + + :attr str type: The type for this profile field. + :attr str value: The interface of the disk for a dedicated host with this + profile + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + + def __init__(self, type: str, value: str) -> None: + """ + Initialize a DedicatedHostProfileDiskInterface object. + + :param str type: The type for this profile field. + :param str value: The interface of the disk for a dedicated host with this + profile + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + """ + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskInterface': + """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in DedicatedHostProfileDiskInterface JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in DedicatedHostProfileDiskInterface JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostProfileDiskInterface 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 DedicatedHostProfileDiskInterface object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> 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: 'DedicatedHostProfileDiskInterface') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + class ValueEnum(str, Enum): + """ + The interface of the disk for a dedicated host with this profile + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + NVME = 'nvme' + + +class DedicatedHostProfileDiskQuantity(): + """ + The number of disks of this type for a dedicated host with this profile. + + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. + """ + + def __init__(self, type: str, value: int) -> None: + """ + Initialize a DedicatedHostProfileDiskQuantity object. + + :param str type: The type for this profile field. + :param int value: The value for this profile field. + """ + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity': + """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in DedicatedHostProfileDiskQuantity JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostProfileDiskQuantity 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 DedicatedHostProfileDiskQuantity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> 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: 'DedicatedHostProfileDiskQuantity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + +class DedicatedHostProfileDiskSize(): + """ + The size of the disk in GB (gigabytes). + + :attr str type: The type for this profile field. + :attr int value: The size of the disk in GB (gigabytes). + """ + + def __init__(self, type: str, value: int) -> None: + """ + Initialize a DedicatedHostProfileDiskSize object. + + :param str type: The type for this profile field. + :param int value: The size of the disk in GB (gigabytes). + """ + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize': + """Initialize a DedicatedHostProfileDiskSize object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in DedicatedHostProfileDiskSize JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in DedicatedHostProfileDiskSize JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostProfileDiskSize 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 DedicatedHostProfileDiskSize object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> 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: 'DedicatedHostProfileDiskSize') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + +class DedicatedHostProfileDiskSupportedInterfaces(): + """ + DedicatedHostProfileDiskSupportedInterfaces. + + :attr str type: The type for this profile field. + :attr List[str] value: The instance disk interfaces supported for a dedicated + host with this profile. + """ + + def __init__(self, type: str, value: List[str]) -> None: + """ + Initialize a DedicatedHostProfileDiskSupportedInterfaces object. + + :param str type: The type for this profile field. + :param List[str] value: The instance disk interfaces supported for a + dedicated host with this profile. + """ + self.type = type + self.value = value + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'DedicatedHostProfileDiskSupportedInterfaces': + """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostProfileDiskSupportedInterfaces 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 DedicatedHostProfileDiskSupportedInterfaces object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'DedicatedHostProfileDiskSupportedInterfaces') -> 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: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + class ValueEnum(str, Enum): + """ + The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + VIRTIO_BLK = 'virtio_blk' + NVME = 'nvme' + + class DedicatedHostProfileIdentity(): """ Identifies a dedicated host profile by a unique property. @@ -21038,6 +22572,7 @@ class Instance(): :attr datetime created_at: The date and time that the virtual server instance was created. :attr str crn: The CRN for this virtual server instance. + :attr List[InstanceDisk] disks: Collection of the instance's disks. :attr InstanceGPU gpu: (optional) The virtual server instance GPU configuration. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. @@ -21056,6 +22591,12 @@ class Instance(): :attr ResourceGroupReference resource_group: The resource group for this instance. :attr str status: The status of the virtual server instance. + :attr List[InstanceStatusReason] status_reasons: Array of reasons for the + current status (if any). + The enumerated reason code values for this property will expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + reason code was encountered. :attr InstanceVCPU vcpu: The virtual server instance VCPU configuration. :attr List[VolumeAttachmentReferenceInstanceContext] volume_attachments: Collection of the virtual server instance's volume attachments, including the @@ -21070,6 +22611,7 @@ def __init__( boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext', created_at: datetime, crn: str, + disks: List['InstanceDisk'], href: str, id: str, memory: int, @@ -21081,6 +22623,7 @@ def __init__( profile: 'InstanceProfileReference', resource_group: 'ResourceGroupReference', status: str, + status_reasons: List['InstanceStatusReason'], vcpu: 'InstanceVCPU', volume_attachments: List[ 'VolumeAttachmentReferenceInstanceContext'], @@ -21099,6 +22642,7 @@ def __init__( :param datetime created_at: The date and time that the virtual server instance was created. :param str crn: The CRN for this virtual server instance. + :param List[InstanceDisk] disks: Collection of the instance's disks. :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. :param int memory: The amount of memory, truncated to whole gibibytes. @@ -21114,6 +22658,12 @@ def __init__( :param ResourceGroupReference resource_group: The resource group for this instance. :param str status: The status of the virtual server instance. + :param List[InstanceStatusReason] status_reasons: Array of reasons for the + current status (if any). + The enumerated reason code values for this property will expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected reason code was encountered. :param InstanceVCPU vcpu: The virtual server instance VCPU configuration. :param List[VolumeAttachmentReferenceInstanceContext] volume_attachments: Collection of the virtual server instance's volume attachments, including @@ -21130,6 +22680,7 @@ def __init__( self.boot_volume_attachment = boot_volume_attachment self.created_at = created_at self.crn = crn + self.disks = disks self.gpu = gpu self.href = href self.id = id @@ -21141,6 +22692,7 @@ def __init__( self.profile = profile self.resource_group = resource_group self.status = status + self.status_reasons = status_reasons self.vcpu = vcpu self.volume_attachments = volume_attachments self.vpc = vpc @@ -21173,6 +22725,13 @@ def from_dict(cls, _dict: Dict) -> 'Instance': else: raise ValueError( 'Required property \'crn\' not present in Instance JSON') + if 'disks' in _dict: + args['disks'] = [ + InstanceDisk.from_dict(x) for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in Instance JSON') if 'gpu' in _dict: args['gpu'] = InstanceGPU.from_dict(_dict.get('gpu')) if 'href' in _dict: @@ -21232,6 +22791,15 @@ def from_dict(cls, _dict: Dict) -> 'Instance': else: raise ValueError( 'Required property \'status\' not present in Instance JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [ + InstanceStatusReason.from_dict(x) + for x in _dict.get('status_reasons') + ] + else: + raise ValueError( + 'Required property \'status_reasons\' not present in Instance JSON' + ) if 'vcpu' in _dict: args['vcpu'] = InstanceVCPU.from_dict(_dict.get('vcpu')) else: @@ -21277,6 +22845,8 @@ def to_dict(self) -> Dict: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] if hasattr(self, 'gpu') and self.gpu is not None: _dict['gpu'] = self.gpu.to_dict() if hasattr(self, 'href') and self.href is not None: @@ -21306,6 +22876,8 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + if hasattr(self, 'status_reasons') and self.status_reasons is not None: + _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] if hasattr(self, 'vcpu') and self.vcpu is not None: _dict['vcpu'] = self.vcpu.to_dict() if hasattr( @@ -21738,6 +23310,573 @@ def __ne__(self, other: 'InstanceCollectionNext') -> bool: return not self == other +class InstanceConsoleAccessToken(): + """ + The instance console access token information. + + :attr str access_token: A URL safe single-use token used to access the console + WebSocket. + :attr str console_type: The instance console type for which this token may be + used. + :attr datetime created_at: The date and time that the access token was created. + :attr datetime expires_at: The date and time that the access token will expire. + :attr bool force: Indicates whether to disconnect an existing serial console + session as the serial console cannot be shared. This has no effect on VNC + consoles. + :attr str href: The URL to access this instance console. + """ + + def __init__(self, access_token: str, console_type: str, + created_at: datetime, expires_at: datetime, force: bool, + href: str) -> None: + """ + Initialize a InstanceConsoleAccessToken object. + + :param str access_token: A URL safe single-use token used to access the + console WebSocket. + :param str console_type: The instance console type for which this token may + be used. + :param datetime created_at: The date and time that the access token was + created. + :param datetime expires_at: The date and time that the access token will + expire. + :param bool force: Indicates whether to disconnect an existing serial + console session as the serial console cannot be shared. This has no effect + on VNC consoles. + :param str href: The URL to access this instance console. + """ + self.access_token = access_token + self.console_type = console_type + self.created_at = created_at + self.expires_at = expires_at + self.force = force + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken': + """Initialize a InstanceConsoleAccessToken object from a json dictionary.""" + args = {} + if 'access_token' in _dict: + args['access_token'] = _dict.get('access_token') + else: + raise ValueError( + 'Required property \'access_token\' not present in InstanceConsoleAccessToken JSON' + ) + if 'console_type' in _dict: + args['console_type'] = _dict.get('console_type') + else: + raise ValueError( + 'Required property \'console_type\' not present in InstanceConsoleAccessToken JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceConsoleAccessToken JSON' + ) + if 'expires_at' in _dict: + args['expires_at'] = string_to_datetime(_dict.get('expires_at')) + else: + raise ValueError( + 'Required property \'expires_at\' not present in InstanceConsoleAccessToken JSON' + ) + if 'force' in _dict: + args['force'] = _dict.get('force') + else: + raise ValueError( + 'Required property \'force\' not present in InstanceConsoleAccessToken JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceConsoleAccessToken JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceConsoleAccessToken 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, 'access_token') and self.access_token is not None: + _dict['access_token'] = self.access_token + if hasattr(self, 'console_type') and self.console_type is not None: + _dict['console_type'] = self.console_type + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = datetime_to_string(self.expires_at) + if hasattr(self, 'force') and self.force is not None: + _dict['force'] = self.force + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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 InstanceConsoleAccessToken object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceConsoleAccessToken') -> 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: 'InstanceConsoleAccessToken') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ConsoleTypeEnum(str, Enum): + """ + The instance console type for which this token may be used. + """ + VNC = 'vnc' + SERIAL = 'serial' + + +class InstanceDisk(): + """ + InstanceDisk. + + :attr datetime created_at: The date and time that the disk was created. + :attr str href: The URL for this instance disk. + :attr str id: The unique identifier for this instance disk. + :attr str interface_type: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str name: The user-defined name for this disk. + :attr str resource_type: The resource type. + :attr int size: The size of the disk in GB (gigabytes). + """ + + def __init__(self, created_at: datetime, href: str, id: str, + interface_type: str, name: str, resource_type: str, + size: int) -> None: + """ + Initialize a InstanceDisk object. + + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this instance disk. + :param str id: The unique identifier for this instance disk. + :param str interface_type: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str name: The user-defined name for this disk. + :param str resource_type: The resource type. + :param int size: The size of the disk in GB (gigabytes). + """ + self.created_at = created_at + self.href = href + self.id = id + self.interface_type = interface_type + self.name = name + self.resource_type = resource_type + self.size = size + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDisk': + """Initialize a InstanceDisk object from a json dictionary.""" + args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceDisk JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceDisk JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in InstanceDisk JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError( + 'Required property \'interface_type\' not present in InstanceDisk JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceDisk JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in InstanceDisk JSON' + ) + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError( + 'Required property \'size\' not present in InstanceDisk JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDisk 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_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + 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 InstanceDisk object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDisk') -> 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: 'InstanceDisk') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InterfaceTypeEnum(str, Enum): + """ + The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + VIRTIO_BLK = 'virtio_blk' + NVME = 'nvme' + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_DISK = 'instance_disk' + + +class InstanceDiskCollection(): + """ + InstanceDiskCollection. + + :attr List[InstanceDisk] disks: Collection of the instance's disks. + """ + + def __init__(self, disks: List['InstanceDisk']) -> None: + """ + Initialize a InstanceDiskCollection object. + + :param List[InstanceDisk] disks: Collection of the instance's disks. + """ + self.disks = disks + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection': + """Initialize a InstanceDiskCollection object from a json dictionary.""" + args = {} + if 'disks' in _dict: + args['disks'] = [ + InstanceDisk.from_dict(x) for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in InstanceDiskCollection JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDiskCollection 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, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] + 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 InstanceDiskCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDiskCollection') -> 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: 'InstanceDiskCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceDiskPatch(): + """ + InstanceDiskPatch. + + :attr str name: (optional) The user-defined name for this disk. + """ + + def __init__(self, *, name: str = None) -> None: + """ + Initialize a InstanceDiskPatch object. + + :param str name: (optional) The user-defined name for this disk. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch': + """Initialize a InstanceDiskPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDiskPatch 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 + 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 InstanceDiskPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDiskPatch') -> 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: 'InstanceDiskPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceDiskReference(): + """ + InstanceDiskReference. + + :attr InstanceDiskReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The URL for this instance disk. + :attr str id: The unique identifier for this instance disk. + :attr str name: The user-defined name for this disk. + :attr str resource_type: The resource type. + """ + + def __init__(self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'InstanceDiskReferenceDeleted' = None) -> None: + """ + Initialize a InstanceDiskReference object. + + :param str href: The URL for this instance disk. + :param str id: The unique identifier for this instance disk. + :param str name: The user-defined name for this disk. + :param str resource_type: The resource type. + :param InstanceDiskReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + """ + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDiskReference': + """Initialize a InstanceDiskReference object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args['deleted'] = InstanceDiskReferenceDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceDiskReference JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in InstanceDiskReference JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceDiskReference JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in InstanceDiskReference JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDiskReference 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, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_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 InstanceDiskReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDiskReference') -> 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: 'InstanceDiskReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_DISK = 'instance_disk' + + +class InstanceDiskReferenceDeleted(): + """ + If present, this property indicates the referenced resource has been deleted and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__(self, more_info: str) -> None: + """ + Initialize a InstanceDiskReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDiskReferenceDeleted': + """Initialize a InstanceDiskReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError( + 'Required property \'more_info\' not present in InstanceDiskReferenceDeleted JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDiskReferenceDeleted 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + 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 InstanceDiskReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDiskReferenceDeleted') -> 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: 'InstanceDiskReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InstanceGPU(): """ The virtual server instance GPU configuration. @@ -21858,6 +23997,8 @@ class InstanceGroup(): - `unhealthy`: Group is unable to reach `membership_count` instances. :attr List[SubnetReference] subnets: Array of references to subnets to use when creating new instances. + :attr datetime updated_at: The date and time that the instance group was + updated. :attr VPCReference vpc: The VPC the instance group resides in. """ @@ -21874,6 +24015,7 @@ def __init__( resource_group: 'ResourceGroupReference', status: str, subnets: List['SubnetReference'], + updated_at: datetime, vpc: 'VPCReference', *, application_port: int = None, @@ -21901,6 +24043,8 @@ def __init__( - `unhealthy`: Group is unable to reach `membership_count` instances. :param List[SubnetReference] subnets: Array of references to subnets to use when creating new instances. + :param datetime updated_at: The date and time that the instance group was + updated. :param VPCReference vpc: The VPC the instance group resides in. :param int application_port: (optional) Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to @@ -21923,6 +24067,7 @@ def __init__( self.resource_group = resource_group self.status = status self.subnets = subnets + self.updated_at = updated_at self.vpc = vpc @classmethod @@ -22003,6 +24148,12 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroup': raise ValueError( 'Required property \'subnets\' not present in InstanceGroup JSON' ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroup JSON' + ) if 'vpc' in _dict: args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) else: @@ -22049,6 +24200,8 @@ def to_dict(self) -> Dict: _dict['status'] = self.status if hasattr(self, 'subnets') and self.subnets is not None: _dict['subnets'] = [x.to_dict() for x in self.subnets] + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'vpc') and self.vpc is not None: _dict['vpc'] = self.vpc.to_dict() return _dict @@ -22325,31 +24478,599 @@ class InstanceGroupManager(): """ InstanceGroupManager. + :attr datetime created_at: The date and time that the instance group manager was + created. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. :attr bool management_enabled: If set to `true`, this manager will control the instance group. :attr str name: The user-defined name for this instance group manager. Names must be unique within the instance group. + :attr datetime updated_at: The date and time that the instance group manager was + updated. """ - def __init__(self, href: str, id: str, management_enabled: bool, - name: str) -> None: + def __init__(self, created_at: datetime, href: str, id: str, + management_enabled: bool, name: str, + updated_at: datetime) -> None: """ Initialize a InstanceGroupManager object. + :param datetime created_at: The date and time that the instance group + manager was created. :param str href: The URL for this instance group manager. :param str id: The unique identifier for this instance group manager. :param bool management_enabled: If set to `true`, this manager will control the instance group. :param str name: The user-defined name for this instance group manager. Names must be unique within the instance group. + :param datetime updated_at: The date and time that the instance group + manager was updated. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerAutoScale', 'InstanceGroupManagerScheduled' + ])) + raise Exception(msg) + + +class InstanceGroupManagerAction(): + """ + InstanceGroupManagerAction. + + :attr bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` time + has passed. + :attr int auto_delete_timeout: Amount of time in hours that are required to pass + before the scheduled action will be automatically deleted once it has finished. + If this value is 0, the action will be deleted on completion. + :attr datetime created_at: The date and time that the instance group manager + action was created. + :attr str href: The URL for this instance group manager action. + :attr str id: The unique identifier for this instance group manager action. + :attr str name: The user-defined name for this instance group manager action. + Names must be unique within the instance group manager. + :attr str resource_type: The resource type. + :attr str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was modified. + """ + + def __init__(self, auto_delete: bool, auto_delete_timeout: int, + created_at: datetime, href: str, id: str, name: str, + resource_type: str, status: str, updated_at: datetime) -> None: + """ + Initialize a InstanceGroupManagerAction object. + + :param bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` + time has passed. + :param int auto_delete_timeout: Amount of time in hours that are required + to pass before the scheduled action will be automatically deleted once it + has finished. If this value is 0, the action will be deleted on completion. + :param datetime created_at: The date and time that the instance group + manager action was created. + :param str href: The URL for this instance group manager action. + :param str id: The unique identifier for this instance group manager + action. + :param str name: The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :param str resource_type: The resource type. + :param str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was modified. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerActionScheduledAction'])) + raise Exception(msg) + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + + class StatusEnum(str, Enum): + """ + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + """ + ACTIVE = 'active' + COMPLETED = 'completed' + FAILED = 'failed' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' + + +class InstanceGroupManagerActionPatch(): + """ + InstanceGroupManagerActionPatch. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + """ + + def __init__(self, *, name: str = None) -> None: + """ + Initialize a InstanceGroupManagerActionPatch object. + + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerActionPatchScheduledActionPatch'])) + raise Exception(msg) + + +class InstanceGroupManagerActionPrototype(): + """ + InstanceGroupManagerActionPrototype. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + """ + + def __init__(self, *, name: str = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototype object. + + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerAutoScale'])) + ", ".join([ + 'InstanceGroupManagerActionPrototypeScheduledActionPrototype' + ])) raise Exception(msg) +class InstanceGroupManagerActionReference(): + """ + InstanceGroupManagerActionReference. + + :attr InstanceGroupManagerActionReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The URL for this instance group manager action. + :attr str id: The unique identifier for this instance group manager action. + :attr str name: The user-defined name for this instance group manager action. + Names must be unique within the instance group manager. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'InstanceGroupManagerActionReferenceDeleted' = None + ) -> None: + """ + Initialize a InstanceGroupManagerActionReference object. + + :param str href: The URL for this instance group manager action. + :param str id: The unique identifier for this instance group manager + action. + :param str name: The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :param str resource_type: The resource type. + :param InstanceGroupManagerActionReferenceDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted + and provides + some supplementary information. + """ + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReference': + """Initialize a InstanceGroupManagerActionReference object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args[ + 'deleted'] = InstanceGroupManagerActionReferenceDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceGroupManagerActionReference JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in InstanceGroupManagerActionReference JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceGroupManagerActionReference JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionReference 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, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_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 InstanceGroupManagerActionReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerActionReference') -> 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: 'InstanceGroupManagerActionReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + + +class InstanceGroupManagerActionReferenceDeleted(): + """ + If present, this property indicates the referenced resource has been deleted and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__(self, more_info: str) -> None: + """ + Initialize a InstanceGroupManagerActionReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'InstanceGroupManagerActionReferenceDeleted': + """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError( + 'Required property \'more_info\' not present in InstanceGroupManagerActionReferenceDeleted JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionReferenceDeleted 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + 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 InstanceGroupManagerActionReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstanceGroupManagerActionReferenceDeleted') -> 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: 'InstanceGroupManagerActionReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionsCollection(): + """ + InstanceGroupManagerActionsCollection. + + :attr List[InstanceGroupManagerAction] actions: Collection of instance group + manager actions. + :attr InstanceGroupManagerActionsCollectionFirst first: A link to the first page + of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr InstanceGroupManagerActionsCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. + :attr int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + actions: List['InstanceGroupManagerAction'], + first: 'InstanceGroupManagerActionsCollectionFirst', + limit: int, + total_count: int, + *, + next: 'InstanceGroupManagerActionsCollectionNext' = None) -> None: + """ + Initialize a InstanceGroupManagerActionsCollection object. + + :param List[InstanceGroupManagerAction] actions: Collection of instance + group manager actions. + :param InstanceGroupManagerActionsCollectionFirst first: A link to the + first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to + the next page of resources. This property is present for all pages + except the last page. + """ + self.actions = actions + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection': + """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary.""" + args = {} + if 'actions' in _dict: + args['actions'] = _dict.get('actions') + else: + raise ValueError( + 'Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON' + ) + if 'first' in _dict: + args[ + 'first'] = InstanceGroupManagerActionsCollectionFirst.from_dict( + _dict.get('first')) + else: + raise ValueError( + 'Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON' + ) + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError( + 'Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON' + ) + if 'next' in _dict: + args['next'] = InstanceGroupManagerActionsCollectionNext.from_dict( + _dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError( + 'Required property \'total_count\' not present in InstanceGroupManagerActionsCollection JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionsCollection 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, 'actions') and self.actions is not None: + actions_list = [] + for x in self.actions: + if isinstance(x, dict): + actions_list.append(x) + else: + actions_list.append(x.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'first') and self.first is not None: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_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 InstanceGroupManagerActionsCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerActionsCollection') -> 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: 'InstanceGroupManagerActionsCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionsCollectionFirst(): + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, href: str) -> None: + """ + Initialize a InstanceGroupManagerActionsCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst': + """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionsCollectionFirst 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, 'href') and self.href is not None: + _dict['href'] = self.href + 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 InstanceGroupManagerActionsCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstanceGroupManagerActionsCollectionFirst') -> 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: 'InstanceGroupManagerActionsCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionsCollectionNext(): + """ + A link to the next page of resources. This property is present for all pages except + the last page. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, href: str) -> None: + """ + Initialize a InstanceGroupManagerActionsCollectionNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext': + """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionsCollectionNext 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, 'href') and self.href is not None: + _dict['href'] = self.href + 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 InstanceGroupManagerActionsCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstanceGroupManagerActionsCollectionNext') -> 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: 'InstanceGroupManagerActionsCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InstanceGroupManagerCollection(): """ InstanceGroupManagerCollection. @@ -22707,21 +25428,30 @@ class InstanceGroupManagerPolicy(): """ InstanceGroupManagerPolicy. + :attr datetime created_at: The date and time that the instance group manager + policy was created. :attr str href: The URL for this instance group manager policy. :attr str id: The unique identifier for this instance group manager policy. :attr str name: The user-defined name for this instance group manager policy. Names must be unique within the instance group manager. + :attr datetime updated_at: The date and time that the instance group manager + policy was updated. """ - def __init__(self, href: str, id: str, name: str) -> None: + def __init__(self, created_at: datetime, href: str, id: str, name: str, + updated_at: datetime) -> None: """ Initialize a InstanceGroupManagerPolicy object. + :param datetime created_at: The date and time that the instance group + manager policy was created. :param str href: The URL for this instance group manager policy. :param str id: The unique identifier for this instance group manager policy. :param str name: The user-defined name for this instance group manager policy. Names must be unique within the instance group manager. + :param datetime updated_at: The date and time that the instance group + manager policy was updated. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join( @@ -23268,7 +25998,8 @@ def __init__(self, """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join([ - 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype' + 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', + 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype' ])) raise Exception(msg) @@ -23433,10 +26164,258 @@ def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool: return not self == other +class InstanceGroupManagerScheduledActionByManagerManager(): + """ + InstanceGroupManagerScheduledActionByManagerManager. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionByManagerManager object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototype' + ])) + raise Exception(msg) + + +class InstanceGroupManagerScheduledActionByManagerPatchManager(): + """ + InstanceGroupManagerScheduledActionByManagerPatchManager. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionByManagerPatchManager object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch' + ])) + raise Exception(msg) + + +class InstanceGroupManagerScheduledActionGroupGroup(): + """ + InstanceGroupManagerScheduledActionGroupGroup. + + :attr int membership_count: The number of members the instance group should have + at the scheduled time. + """ + + def __init__(self, membership_count: int) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionGroupGroup object. + + :param int membership_count: The number of members the instance group + should have at the scheduled time. + """ + self.membership_count = membership_count + + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupGroup': + """Initialize a InstanceGroupManagerScheduledActionGroupGroup object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + else: + raise ValueError( + 'Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupGroup JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerScheduledActionGroupGroup 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, + 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_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 InstanceGroupManagerScheduledActionGroupGroup object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstanceGroupManagerScheduledActionGroupGroup') -> 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: 'InstanceGroupManagerScheduledActionGroupGroup') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionGroupPatch(): + """ + InstanceGroupManagerScheduledActionGroupPatch. + + :attr int membership_count: (optional) The number of members the instance group + should have at the scheduled time. + """ + + def __init__(self, *, membership_count: int = None) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionGroupPatch object. + + :param int membership_count: (optional) The number of members the instance + group should have at the scheduled time. + """ + self.membership_count = membership_count + + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPatch': + """Initialize a InstanceGroupManagerScheduledActionGroupPatch object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerScheduledActionGroupPatch 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, + 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_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 InstanceGroupManagerScheduledActionGroupPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstanceGroupManagerScheduledActionGroupPatch') -> 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: 'InstanceGroupManagerScheduledActionGroupPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionGroupPrototype(): + """ + InstanceGroupManagerScheduledActionGroupPrototype. + + :attr int membership_count: The number of members the instance group should have + at the scheduled time. + """ + + def __init__(self, membership_count: int) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionGroupPrototype object. + + :param int membership_count: The number of members the instance group + should have at the scheduled time. + """ + self.membership_count = membership_count + + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype': + """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + else: + raise ValueError( + 'Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerScheduledActionGroupPrototype 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, + 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_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 InstanceGroupManagerScheduledActionGroupPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> 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: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionManagerManager(): + """ + InstanceGroupManagerScheduledActionManagerManager. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionManagerManager object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join( + ['InstanceGroupManagerScheduledActionManagerManagerAutoScale'])) + raise Exception(msg) + + class InstanceGroupMembership(): """ InstanceGroupMembership. + :attr datetime created_at: The date and time that the instance group manager + policy was created. :attr bool delete_instance_on_membership_delete: If set to true, when deleting the membership the instance will also be deleted. :attr str href: The URL for this instance group membership. @@ -23452,9 +26431,12 @@ class InstanceGroupMembership(): - `healthy`: Membership is active and serving in the group - `pending`: Membership is waiting for dependent resources - `unhealthy`: Membership has unhealthy dependent resources. + :attr datetime updated_at: The date and time that the instance group membership + was updated. """ def __init__(self, + created_at: datetime, delete_instance_on_membership_delete: bool, href: str, id: str, @@ -23462,11 +26444,14 @@ def __init__(self, instance_template: 'InstanceTemplateReference', name: str, status: str, + updated_at: datetime, *, pool_member: 'LoadBalancerPoolMemberReference' = None) -> None: """ Initialize a InstanceGroupMembership object. + :param datetime created_at: The date and time that the instance group + manager policy was created. :param bool delete_instance_on_membership_delete: If set to true, when deleting the membership the instance will also be deleted. :param str href: The URL for this instance group membership. @@ -23481,8 +26466,11 @@ def __init__(self, - `healthy`: Membership is active and serving in the group - `pending`: Membership is waiting for dependent resources - `unhealthy`: Membership has unhealthy dependent resources. + :param datetime updated_at: The date and time that the instance group + membership was updated. :param LoadBalancerPoolMemberReference pool_member: (optional) """ + self.created_at = created_at self.delete_instance_on_membership_delete = delete_instance_on_membership_delete self.href = href self.id = id @@ -23491,11 +26479,18 @@ def __init__(self, self.name = name self.pool_member = pool_member self.status = status + self.updated_at = updated_at @classmethod def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership': """Initialize a InstanceGroupMembership object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceGroupMembership JSON' + ) if 'delete_instance_on_membership_delete' in _dict: args['delete_instance_on_membership_delete'] = _dict.get( 'delete_instance_on_membership_delete') @@ -23544,6 +26539,12 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership': raise ValueError( 'Required property \'status\' not present in InstanceGroupMembership JSON' ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupMembership JSON' + ) return cls(**args) @classmethod @@ -23554,6 +26555,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'delete_instance_on_membership_delete' ) and self.delete_instance_on_membership_delete is not None: _dict[ @@ -23573,6 +26576,8 @@ def to_dict(self) -> Dict: _dict['pool_member'] = self.pool_member.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) return _dict def _to_dict(self): @@ -24383,16 +27388,47 @@ class InstancePatch(): :attr str name: (optional) The user-defined name for this virtual server instance (and default system hostname). + :attr InstancePatchProfile profile: (optional) The profile to use for this + virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the + requested + profile must: + - Match the current profile's instance disk support. (Note: If the current + profile + supports instance storage disks, the requested profile can have a different + instance storage disk configuration.) + - Be compatible with any `placement_target` constraints. For example, if the + instance is placed on a dedicated host, the requested profile `family` must be + the same as the dedicated host `family`. """ - def __init__(self, *, name: str = None) -> None: + def __init__(self, + *, + name: str = None, + profile: 'InstancePatchProfile' = None) -> None: """ Initialize a InstancePatch object. :param str name: (optional) The user-defined name for this virtual server instance (and default system hostname). + :param InstancePatchProfile profile: (optional) The profile to use for this + virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the + requested + profile must: + - Match the current profile's instance disk support. (Note: If the current + profile + supports instance storage disks, the requested profile can have a + different + instance storage disk configuration.) + - Be compatible with any `placement_target` constraints. For example, if + the + instance is placed on a dedicated host, the requested profile `family` + must be + the same as the dedicated host `family`. """ self.name = name + self.profile = profile @classmethod def from_dict(cls, _dict: Dict) -> 'InstancePatch': @@ -24400,6 +27436,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePatch': args = {} if 'name' in _dict: args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') return cls(**args) @classmethod @@ -24412,6 +27450,11 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + 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() return _dict def _to_dict(self): @@ -24433,11 +27476,59 @@ def __ne__(self, other: 'InstancePatch') -> bool: return not self == other +class InstancePatchProfile(): + """ + The profile to use for this virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the requested + profile must: + - Match the current profile's instance disk support. (Note: If the current profile + supports instance storage disks, the requested profile can have a different + instance storage disk configuration.) + - Be compatible with any `placement_target` constraints. For example, if the + instance is placed on a dedicated host, the requested profile `family` must be + the same as the dedicated host `family`. + + """ + + def __init__(self) -> None: + """ + Initialize a InstancePatchProfile object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstancePatchProfileInstanceProfileIdentityByName', + 'InstancePatchProfileInstanceProfileIdentityByHref' + ])) + raise Exception(msg) + + +class InstancePlacementTargetPrototype(): + """ + InstancePlacementTargetPrototype. + + """ + + def __init__(self) -> None: + """ + Initialize a InstancePlacementTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstancePlacementTargetPrototypeDedicatedHostIdentity', + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity' + ])) + raise Exception(msg) + + class InstanceProfile(): """ InstanceProfile. :attr InstanceProfileBandwidth bandwidth: + :attr List[InstanceProfileDisk] disks: Collection of the instance profile's + disks. :attr str family: (optional) The product family this virtual server instance profile belongs to. :attr str href: The URL for this virtual server instance profile. @@ -24452,6 +27543,7 @@ class InstanceProfile(): def __init__(self, bandwidth: 'InstanceProfileBandwidth', + disks: List['InstanceProfileDisk'], href: str, memory: 'InstanceProfileMemory', name: str, @@ -24465,6 +27557,8 @@ def __init__(self, Initialize a InstanceProfile object. :param InstanceProfileBandwidth bandwidth: + :param List[InstanceProfileDisk] disks: Collection of the instance + profile's disks. :param str href: The URL for this virtual server instance profile. :param InstanceProfileMemory memory: :param str name: The globally unique name for this virtual server instance @@ -24477,6 +27571,7 @@ def __init__(self, instance profile belongs to. """ self.bandwidth = bandwidth + self.disks = disks self.family = family self.href = href self.memory = memory @@ -24496,6 +27591,14 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfile': raise ValueError( 'Required property \'bandwidth\' not present in InstanceProfile JSON' ) + if 'disks' in _dict: + args['disks'] = [ + InstanceProfileDisk.from_dict(x) for x in _dict.get('disks') + ] + else: + raise ValueError( + 'Required property \'disks\' not present in InstanceProfile JSON' + ) if 'family' in _dict: args['family'] = _dict.get('family') if 'href' in _dict: @@ -24558,6 +27661,8 @@ def to_dict(self) -> Dict: _dict['bandwidth'] = self.bandwidth else: _dict['bandwidth'] = self.bandwidth.to_dict() + if hasattr(self, 'disks') and self.disks is not None: + _dict['disks'] = [x.to_dict() for x in self.disks] if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: @@ -24688,6 +27793,260 @@ def __ne__(self, other: 'InstanceProfileCollection') -> bool: return not self == other +class InstanceProfileDisk(): + """ + Disks provided by this profile. + + :attr InstanceProfileDiskQuantity quantity: + :attr InstanceProfileDiskSize size: + :attr InstanceProfileDiskSupportedInterfaces supported_interface_types: + """ + + def __init__( + self, quantity: 'InstanceProfileDiskQuantity', + size: 'InstanceProfileDiskSize', + supported_interface_types: 'InstanceProfileDiskSupportedInterfaces' + ) -> None: + """ + Initialize a InstanceProfileDisk object. + + :param InstanceProfileDiskQuantity quantity: + :param InstanceProfileDiskSize size: + :param InstanceProfileDiskSupportedInterfaces supported_interface_types: + """ + self.quantity = quantity + self.size = size + self.supported_interface_types = supported_interface_types + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk': + """Initialize a InstanceProfileDisk object from a json dictionary.""" + args = {} + if 'quantity' in _dict: + args['quantity'] = _dict.get('quantity') + else: + raise ValueError( + 'Required property \'quantity\' not present in InstanceProfileDisk JSON' + ) + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError( + 'Required property \'size\' not present in InstanceProfileDisk JSON' + ) + if 'supported_interface_types' in _dict: + args[ + 'supported_interface_types'] = InstanceProfileDiskSupportedInterfaces.from_dict( + _dict.get('supported_interface_types')) + else: + raise ValueError( + 'Required property \'supported_interface_types\' not present in InstanceProfileDisk JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDisk 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, 'quantity') and self.quantity is not None: + if isinstance(self.quantity, dict): + _dict['quantity'] = self.quantity + else: + _dict['quantity'] = self.quantity.to_dict() + if hasattr(self, 'size') and self.size is not None: + if isinstance(self.size, dict): + _dict['size'] = self.size + else: + _dict['size'] = self.size.to_dict() + if hasattr(self, 'supported_interface_types' + ) and self.supported_interface_types is not None: + _dict[ + 'supported_interface_types'] = self.supported_interface_types.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 InstanceProfileDisk object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileDisk') -> 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: 'InstanceProfileDisk') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceProfileDiskQuantity(): + """ + InstanceProfileDiskQuantity. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceProfileDiskQuantity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceProfileDiskQuantityFixed', + 'InstanceProfileDiskQuantityRange', + 'InstanceProfileDiskQuantityEnum', + 'InstanceProfileDiskQuantityDependent' + ])) + raise Exception(msg) + + +class InstanceProfileDiskSize(): + """ + InstanceProfileDiskSize. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceProfileDiskSize object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceProfileDiskSizeFixed', 'InstanceProfileDiskSizeRange', + 'InstanceProfileDiskSizeEnum', + 'InstanceProfileDiskSizeDependent' + ])) + raise Exception(msg) + + +class InstanceProfileDiskSupportedInterfaces(): + """ + InstanceProfileDiskSupportedInterfaces. + + :attr str default: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str type: The type for this profile field. + :attr List[str] values: The supported disk interfaces used for attaching the + disk. + """ + + def __init__(self, default: str, type: str, values: List[str]) -> None: + """ + Initialize a InstanceProfileDiskSupportedInterfaces object. + + :param str default: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str type: The type for this profile field. + :param List[str] values: The supported disk interfaces used for attaching + the disk. + """ + self.default = default + self.type = type + self.values = values + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces': + """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError( + 'Required property \'default\' not present in InstanceProfileDiskSupportedInterfaces JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileDiskSupportedInterfaces JSON' + ) + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError( + 'Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDiskSupportedInterfaces 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + 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 InstanceProfileDiskSupportedInterfaces object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> 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: 'InstanceProfileDiskSupportedInterfaces') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class DefaultEnum(str, Enum): + """ + The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + VIRTIO_BLK = 'virtio_blk' + NVME = 'nvme' + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + ENUM = 'enum' + + class ValuesEnum(str, Enum): + """ + The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + VIRTIO_BLK = 'virtio_blk' + NVME = 'nvme' + + class InstanceProfileIdentity(): """ Identifies an instance profile by a unique property. @@ -25025,6 +28384,8 @@ class InstancePrototype(): hyphenated list of randomly-selected words. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :attr ResourceGroupIdentity resource_group: (optional) The resource group to @@ -25044,6 +28405,7 @@ def __init__(self, keys: List['KeyIdentity'] = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, user_data: str = None, @@ -25067,6 +28429,8 @@ def __init__(self, :param List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -25259,6 +28623,100 @@ def __ne__(self, other: 'InstanceReferenceDeleted') -> bool: return not self == other +class InstanceStatusReason(): + """ + InstanceStatusReason. + + :attr str code: A snake case string succinctly identifying the status reason. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. + """ + + def __init__(self, + code: str, + message: str, + *, + more_info: str = None) -> None: + """ + Initialize a InstanceStatusReason object. + + :param str code: A snake case string succinctly identifying the status + reason. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. + """ + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason': + """Initialize a InstanceStatusReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError( + 'Required property \'code\' not present in InstanceStatusReason JSON' + ) + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError( + 'Required property \'message\' not present in InstanceStatusReason JSON' + ) + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceStatusReason 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') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + 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 InstanceStatusReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceStatusReason') -> 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: 'InstanceStatusReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CodeEnum(str, Enum): + """ + A snake case string succinctly identifying the status reason. + """ + CANNOT_START = 'cannot_start' + CANNOT_START_CAPACITY = 'cannot_start_capacity' + CANNOT_START_COMPUTE = 'cannot_start_compute' + CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' + CANNOT_START_NETWORK = 'cannot_start_network' + CANNOT_START_STORAGE = 'cannot_start_storage' + ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' + + class InstanceTemplate(): """ InstanceTemplate. @@ -25279,6 +28737,8 @@ class InstanceTemplate(): :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this @@ -25302,6 +28762,7 @@ def __init__(self, *, keys: List['KeyIdentity'] = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, user_data: str = None, volume_attachments: List[ @@ -25329,6 +28790,8 @@ def __init__(self, :param List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :param str user_data: (optional) User data to be made available when @@ -25677,6 +29140,8 @@ class InstanceTemplatePrototype(): hyphenated list of randomly-selected words. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :attr ResourceGroupIdentity resource_group: (optional) The resource group to @@ -25696,6 +29161,7 @@ def __init__(self, keys: List['KeyIdentity'] = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, user_data: str = None, @@ -25719,6 +29185,8 @@ def __init__(self, :param List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -26777,9 +30245,9 @@ class LoadBalancerListener(): :attr str id: The unique identifier for this load balancer listener. :attr List[LoadBalancerListenerPolicyReference] policies: (optional) An array of policies for this listener. - :attr int port: The listener port number. Each listener in the load balancer - must have a unique - `port` and `protocol` combination. + :attr int port: The listener port number, or the inclusive lower bound of the + port range. Each listener in the load balancer must have a unique `port` and + `protocol` combination. :attr str protocol: The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique @@ -26812,8 +30280,8 @@ def __init__( created. :param str href: The listener's canonical URL. :param str id: The unique identifier for this load balancer listener. - :param int port: The listener port number. Each listener in the load - balancer must have a unique + :param int port: The listener port number, or the inclusive lower bound of + the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. :param str protocol: The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support @@ -27060,8 +30528,8 @@ class LoadBalancerListenerPatch(): - Belong to this load balancer - Have the same `protocol` as this listener - Not already be the default pool for another listener. - :attr int port: (optional) The listener port number. Each listener in the load - balancer must have a unique + :attr int port: (optional) The listener port number, or the inclusive lower + bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. :attr str protocol: (optional) The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family @@ -27094,9 +30562,9 @@ def __init__(self, - Belong to this load balancer - Have the same `protocol` as this listener - Not already be the default pool for another listener. - :param int port: (optional) The listener port number. Each listener in the - load balancer must have a unique - `port` and `protocol` combination. + :param int port: (optional) The listener port number, or the inclusive + lower bound of the port range. Each listener in the load balancer must have + a unique `port` and `protocol` combination. :param str protocol: (optional) The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load @@ -27815,13 +31283,22 @@ class LoadBalancerListenerPolicyRule(): :attr str condition: The condition of the rule. :attr datetime created_at: The date and time that this rule was created. - :attr str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :attr str href: The rule's canonical URL. :attr str id: The rule's unique identifier. :attr str provisioning_status: The provisioning status of this rule. :attr str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :attr str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__(self, @@ -27843,9 +31320,18 @@ def __init__(self, :param str id: The rule's unique identifier. :param str provisioning_status: The provisioning status of this rule. :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :param str value: Value to be matched for rule condition. - :param str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. """ self.condition = condition self.created_at = created_at @@ -27974,10 +31460,14 @@ class ProvisioningStatusEnum(str, Enum): class TypeEnum(str, Enum): """ The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. """ HEADER = 'header' HOSTNAME = 'hostname' PATH = 'path' + QUERY = 'query' + BODY = 'body' class LoadBalancerListenerPolicyRuleCollection(): @@ -28047,10 +31537,19 @@ class LoadBalancerListenerPolicyRulePatch(): LoadBalancerListenerPolicyRulePatch. :attr str condition: (optional) The condition of the rule. - :attr str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :attr str type: (optional) The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :attr str value: (optional) Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__(self, @@ -28063,10 +31562,19 @@ def __init__(self, Initialize a LoadBalancerListenerPolicyRulePatch object. :param str condition: (optional) The condition of the rule. - :param str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :param str type: (optional) The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :param str value: (optional) Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. """ self.condition = condition self.field = field @@ -28134,10 +31642,14 @@ class ConditionEnum(str, Enum): class TypeEnum(str, Enum): """ The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. """ HEADER = 'header' HOSTNAME = 'hostname' PATH = 'path' + QUERY = 'query' + BODY = 'body' class LoadBalancerListenerPolicyRulePrototype(): @@ -28145,10 +31657,19 @@ class LoadBalancerListenerPolicyRulePrototype(): LoadBalancerListenerPolicyRulePrototype. :attr str condition: The condition of the rule. - :attr str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :attr str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :attr str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__(self, @@ -28162,9 +31683,18 @@ def __init__(self, :param str condition: The condition of the rule. :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. :param str value: Value to be matched for rule condition. - :param str field: (optional) HTTP header field. This is only applicable to - "header" rule type. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this field is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. """ self.condition = condition self.field = field @@ -28245,10 +31775,14 @@ class ConditionEnum(str, Enum): class TypeEnum(str, Enum): """ The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. """ HEADER = 'header' HOSTNAME = 'hostname' PATH = 'path' + QUERY = 'query' + BODY = 'body' class LoadBalancerListenerPolicyRuleReference(): @@ -28479,9 +32013,9 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): :attr int connection_limit: (optional) The connection limit of the listener. :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool associated with the listener. - :attr int port: The listener port number. Each listener in the load balancer - must have a unique - `port` and `protocol` combination. + :attr int port: The listener port number, or the inclusive lower bound of the + port range. Each listener in the load balancer must have a unique `port` and + `protocol` combination. :attr str protocol: The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique @@ -28498,8 +32032,8 @@ def __init__(self, """ Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object. - :param int port: The listener port number. Each listener in the load - balancer must have a unique + :param int port: The listener port number, or the inclusive lower bound of + the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. :param str protocol: The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support @@ -28968,6 +32502,11 @@ class LoadBalancerPool(): `disabled`). :attr LoadBalancerPoolSessionPersistence session_persistence: (optional) The session persistence of this pool. + The enumerated values for this property are expected to expand in the future. + When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. """ def __init__( @@ -29014,6 +32553,12 @@ def __init__( backend server members of the pool. :param LoadBalancerPoolSessionPersistence session_persistence: (optional) The session persistence of this pool. + The enumerated values for this property are expected to expand in the + future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the + unexpected + property value was encountered. """ self.algorithm = algorithm self.created_at = created_at @@ -34730,6 +38275,8 @@ class OperatingSystem(): OperatingSystem. :attr str architecture: The operating system architecture. + :attr bool dedicated_host_only: Images with this operating system can only be + used on dedicated hosts or dedicated host groups. :attr str display_name: A unique, display-friendly name for the operating system. :attr str family: The name of the software family this operating system belongs @@ -34740,12 +38287,15 @@ class OperatingSystem(): :attr str version: The major release version of this operating system. """ - def __init__(self, architecture: str, display_name: str, family: str, - href: str, name: str, vendor: str, version: str) -> None: + def __init__(self, architecture: str, dedicated_host_only: bool, + display_name: str, family: str, href: str, name: str, + vendor: str, version: str) -> None: """ Initialize a OperatingSystem object. :param str architecture: The operating system architecture. + :param bool dedicated_host_only: Images with this operating system can only + be used on dedicated hosts or dedicated host groups. :param str display_name: A unique, display-friendly name for the operating system. :param str family: The name of the software family this operating system @@ -34756,6 +38306,7 @@ def __init__(self, architecture: str, display_name: str, family: str, :param str version: The major release version of this operating system. """ self.architecture = architecture + self.dedicated_host_only = dedicated_host_only self.display_name = display_name self.family = family self.href = href @@ -34773,6 +38324,12 @@ def from_dict(cls, _dict: Dict) -> 'OperatingSystem': raise ValueError( 'Required property \'architecture\' not present in OperatingSystem JSON' ) + if 'dedicated_host_only' in _dict: + args['dedicated_host_only'] = _dict.get('dedicated_host_only') + else: + raise ValueError( + 'Required property \'dedicated_host_only\' not present in OperatingSystem JSON' + ) if 'display_name' in _dict: args['display_name'] = _dict.get('display_name') else: @@ -34821,6 +38378,10 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'architecture') and self.architecture is not None: _dict['architecture'] = self.architecture + if hasattr( + self, + 'dedicated_host_only') and self.dedicated_host_only is not None: + _dict['dedicated_host_only'] = self.dedicated_host_only if hasattr(self, 'display_name') and self.display_name is not None: _dict['display_name'] = self.display_name if hasattr(self, 'family') and self.family is not None: @@ -36882,6 +40443,11 @@ class ReservedIPReference(): """ ReservedIPReference. + :attr str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify that + the address is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected IP address format was encountered. :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and provides some supplementary information. @@ -36892,6 +40458,7 @@ class ReservedIPReference(): """ def __init__(self, + address: str, href: str, id: str, name: str, @@ -36901,6 +40468,11 @@ def __init__(self, """ Initialize a ReservedIPReference object. + :param str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify + that the address is in an expected format. If it is not, log an error. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected IP address format was encountered. :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. :param str name: The user-defined or system-provided name for this reserved @@ -36910,6 +40482,7 @@ def __init__(self, property indicates the referenced resource has been deleted and provides some supplementary information. """ + self.address = address self.deleted = deleted self.href = href self.id = id @@ -36920,6 +40493,12 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'ReservedIPReference': """Initialize a ReservedIPReference object from a json dictionary.""" args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + else: + raise ValueError( + 'Required property \'address\' not present in ReservedIPReference JSON' + ) if 'deleted' in _dict: args['deleted'] = ReservedIPReferenceDeleted.from_dict( _dict.get('deleted')) @@ -36957,6 +40536,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address if hasattr(self, 'deleted') and self.deleted is not None: _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: @@ -39650,7 +43231,8 @@ class SecurityGroupRulePatch(): """ SecurityGroupRulePatch. - :attr int code: (optional) The ICMP traffic code to allow. + :attr int code: (optional) The ICMP traffic code to allow. Specify `null` to + remove an existing ICMP traffic code value. :attr str direction: (optional) The direction of traffic to enforce, either `inbound` or `outbound`. :attr str ip_version: (optional) The IP version to enforce. The format of @@ -39658,8 +43240,12 @@ class SecurityGroupRulePatch(): Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. - :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. + :attr int port_max: (optional) The inclusive upper bound of the protocol port + range. Specify `null` to clear an existing upper bound. If a lower bound has + been set, the upper bound must also be set, and must not be smaller. + :attr int port_min: (optional) The inclusive lower bound of the protocol port + range. Specify `null` to clear an existing lower bound. If an upper bound has + been set, the lower bound must also be set, and must not be larger. :attr SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or @@ -39667,7 +43253,8 @@ class SecurityGroupRulePatch(): security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to any source, for outbound rules). - :attr int type: (optional) The ICMP traffic type to allow. + :attr int type: (optional) The ICMP traffic type to allow. Specify `null` to + remove an existing ICMP traffic type value. """ def __init__(self, @@ -39682,7 +43269,8 @@ def __init__(self, """ Initialize a SecurityGroupRulePatch object. - :param int code: (optional) The ICMP traffic code to allow. + :param int code: (optional) The ICMP traffic code to allow. Specify `null` + to remove an existing ICMP traffic code value. :param str direction: (optional) The direction of traffic to enforce, either `inbound` or `outbound`. :param str ip_version: (optional) The IP version to enforce. The format of @@ -39690,10 +43278,14 @@ def __init__(self, used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :param int port_max: (optional) The inclusive upper bound of TCP/UDP port - range. - :param int port_min: (optional) The inclusive lower bound of TCP/UDP port - range. + :param int port_max: (optional) The inclusive upper bound of the protocol + port range. Specify `null` to clear an existing upper bound. If a lower + bound has been set, the upper bound must also be set, and must not be + smaller. + :param int port_min: (optional) The inclusive lower bound of the protocol + port range. Specify `null` to clear an existing lower bound. If an upper + bound has been set, the lower bound must also be set, and must not be + larger. :param SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR @@ -39701,7 +43293,8 @@ def __init__(self, security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to any source, for outbound rules). - :param int type: (optional) The ICMP traffic type to allow. + :param int type: (optional) The ICMP traffic type to allow. Specify `null` + to remove an existing ICMP traffic type value. """ self.code = code self.direction = direction @@ -40219,7 +43812,10 @@ def __ne__(self, other: 'SecurityGroupTargetCollectionNext') -> bool: class SecurityGroupTargetReference(): """ - SecurityGroupTargetReference. + The resource types that can be security group targets are expected to expand in the + future. When iterating over security group targets, do not assume that every target + resource will be from a known set of resource types. Optionally halt processing and + surface an error, or bypass resources of unrecognized types. """ @@ -43499,8 +47095,8 @@ class StatusEnum(str, Enum): AVAILABLE = 'available' FAILED = 'failed' PENDING = 'pending' - UNUSABLE = 'unusable' PENDING_DELETION = 'pending_deletion' + UNUSABLE = 'unusable' class VolumeAttachment(): @@ -45181,10 +48777,6 @@ class VolumePrototype(): """ VolumePrototype. - :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root - key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will be - `provider_managed`. :attr int iops: (optional) The bandwidth for the volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. @@ -45198,7 +48790,6 @@ def __init__(self, profile: 'VolumeProfileIdentity', zone: 'ZoneIdentity', *, - encryption_key: 'EncryptionKeyIdentity' = None, iops: int = None, name: str = None, resource_group: 'ResourceGroupIdentity' = None) -> None: @@ -45207,11 +48798,6 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. - :param EncryptionKeyIdentity encryption_key: (optional) The identity of the - root key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will - be - `provider_managed`. :param int iops: (optional) The bandwidth for the volume. :param str name: (optional) The unique user-defined name for this volume. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -49750,16 +53336,279 @@ def __ne__(self, other: 'ImagePrototypeImageByFile') -> bool: return not self == other +class InstanceGroupManagerActionPatchScheduledActionPatch( + InstanceGroupManagerActionPatch): + """ + InstanceGroupManagerActionPatchScheduledActionPatch. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr InstanceGroupManagerScheduledActionGroupPatch group: (optional) + :attr InstanceGroupManagerScheduledActionByManagerPatchManager manager: + (optional) + :attr datetime run_at: (optional) The date and time the scheduled action will + run. + """ + + def __init__( + self, + *, + name: str = None, + cron_spec: str = None, + group: 'InstanceGroupManagerScheduledActionGroupPatch' = None, + manager: + 'InstanceGroupManagerScheduledActionByManagerPatchManager' = None, + run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionPatchScheduledActionPatch object. + + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + :param InstanceGroupManagerScheduledActionGroupPatch group: (optional) + :param InstanceGroupManagerScheduledActionByManagerPatchManager manager: + (optional) + :param datetime run_at: (optional) The date and time the scheduled action + will run. + """ + # pylint: disable=super-init-not-called + self.name = name + self.cron_spec = cron_spec + self.group = group + self.manager = manager + self.run_at = run_at + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerActionPatchScheduledActionPatch': + """Initialize a InstanceGroupManagerActionPatchScheduledActionPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'group' in _dict: + args[ + 'group'] = InstanceGroupManagerScheduledActionGroupPatch.from_dict( + _dict.get('group')) + if 'manager' in _dict: + args['manager'] = _dict.get('manager') + if 'run_at' in _dict: + args['run_at'] = string_to_datetime(_dict.get('run_at')) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionPatchScheduledActionPatch 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, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'group') and self.group is not None: + _dict['group'] = self.group.to_dict() + if hasattr(self, 'manager') and self.manager is not None: + if isinstance(self.manager, dict): + _dict['manager'] = self.manager + else: + _dict['manager'] = self.manager.to_dict() + if hasattr(self, 'run_at') and self.run_at is not None: + _dict['run_at'] = datetime_to_string(self.run_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 InstanceGroupManagerActionPatchScheduledActionPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: 'InstanceGroupManagerActionPatchScheduledActionPatch' + ) -> 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: 'InstanceGroupManagerActionPatchScheduledActionPatch' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototype( + InstanceGroupManagerActionPrototype): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototype. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + """ + + def __init__(self, *, name: str = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object. + + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt', + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec' + ])) + raise Exception(msg) + + +class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction): + """ + InstanceGroupManagerActionScheduledAction. + + :attr bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` time + has passed. + :attr int auto_delete_timeout: Amount of time in hours that are required to pass + before the scheduled action will be automatically deleted once it has finished. + If this value is 0, the action will be deleted on completion. + :attr datetime created_at: The date and time that the instance group manager + action was created. + :attr str href: The URL for this instance group manager action. + :attr str id: The unique identifier for this instance group manager action. + :attr str name: The user-defined name for this instance group manager action. + Names must be unique within the instance group manager. + :attr str resource_type: The resource type. + :attr str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was modified. + :attr str action_type: The type of action for the instance group. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :attr datetime next_run_at: (optional) The date and time the scheduled action + will next run. If empty the system is currently calculating the next run time. + """ + + def __init__(self, + auto_delete: bool, + auto_delete_timeout: int, + created_at: datetime, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + updated_at: datetime, + action_type: str, + *, + cron_spec: str = None, + last_applied_at: datetime = None, + next_run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionScheduledAction object. + + :param bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` + time has passed. + :param int auto_delete_timeout: Amount of time in hours that are required + to pass before the scheduled action will be automatically deleted once it + has finished. If this value is 0, the action will be deleted on completion. + :param datetime created_at: The date and time that the instance group + manager action was created. + :param str href: The URL for this instance group manager action. + :param str id: The unique identifier for this instance group manager + action. + :param str name: The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :param str resource_type: The resource type. + :param str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was modified. + :param str action_type: The type of action for the instance group. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + :param datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :param datetime next_run_at: (optional) The date and time the scheduled + action will next run. If empty the system is currently calculating the next + run time. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerActionScheduledActionGroup', + 'InstanceGroupManagerActionScheduledActionManager' + ])) + raise Exception(msg) + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + + class StatusEnum(str, Enum): + """ + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + """ + ACTIVE = 'active' + COMPLETED = 'completed' + FAILED = 'failed' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' + + class ActionTypeEnum(str, Enum): + """ + The type of action for the instance group. + """ + SCHEDULED = 'scheduled' + + class InstanceGroupManagerAutoScale(InstanceGroupManager): """ InstanceGroupManagerAutoScale. + :attr datetime created_at: The date and time that the instance group manager was + created. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. :attr bool management_enabled: If set to `true`, this manager will control the instance group. :attr str name: The user-defined name for this instance group manager. Names must be unique within the instance group. + :attr datetime updated_at: The date and time that the instance group manager was + updated. :attr int aggregation_window: The time window in seconds to aggregate metrics prior to evaluation. :attr int cooldown: The duration of time in seconds to pause further scale @@ -49773,19 +53622,24 @@ class InstanceGroupManagerAutoScale(InstanceGroupManager): instance group manager. """ - def __init__(self, href: str, id: str, management_enabled: bool, name: str, + def __init__(self, created_at: datetime, href: str, id: str, + management_enabled: bool, name: str, updated_at: datetime, aggregation_window: int, cooldown: int, manager_type: str, max_membership_count: int, min_membership_count: int, policies: List['InstanceGroupManagerPolicyReference']) -> None: """ Initialize a InstanceGroupManagerAutoScale object. + :param datetime created_at: The date and time that the instance group + manager was created. :param str href: The URL for this instance group manager. :param str id: The unique identifier for this instance group manager. :param bool management_enabled: If set to `true`, this manager will control the instance group. :param str name: The user-defined name for this instance group manager. Names must be unique within the instance group. + :param datetime updated_at: The date and time that the instance group + manager was updated. :param int aggregation_window: The time window in seconds to aggregate metrics prior to evaluation. :param int cooldown: The duration of time in seconds to pause further scale @@ -49799,10 +53653,12 @@ def __init__(self, href: str, id: str, management_enabled: bool, name: str, the instance group manager. """ # pylint: disable=super-init-not-called + self.created_at = created_at self.href = href self.id = id self.management_enabled = management_enabled self.name = name + self.updated_at = updated_at self.aggregation_window = aggregation_window self.cooldown = cooldown self.manager_type = manager_type @@ -49814,6 +53670,12 @@ def __init__(self, href: str, id: str, management_enabled: bool, name: str, def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale': """Initialize a InstanceGroupManagerAutoScale object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceGroupManagerAutoScale JSON' + ) if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -49838,6 +53700,12 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale': raise ValueError( 'Required property \'name\' not present in InstanceGroupManagerAutoScale JSON' ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupManagerAutoScale JSON' + ) if 'aggregation_window' in _dict: args['aggregation_window'] = _dict.get('aggregation_window') else: @@ -49887,6 +53755,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -49897,6 +53767,8 @@ def to_dict(self) -> Dict: _dict['management_enabled'] = self.management_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr( self, 'aggregation_window') and self.aggregation_window is not None: @@ -50064,33 +53936,44 @@ class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy( """ InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy. + :attr datetime created_at: The date and time that the instance group manager + policy was created. :attr str href: The URL for this instance group manager policy. :attr str id: The unique identifier for this instance group manager policy. :attr str name: The user-defined name for this instance group manager policy. Names must be unique within the instance group manager. + :attr datetime updated_at: The date and time that the instance group manager + policy was updated. :attr str metric_type: The type of metric to be evaluated. :attr int metric_value: The metric value to be evaluated. :attr str policy_type: The type of policy for the instance group. """ - def __init__(self, href: str, id: str, name: str, metric_type: str, - metric_value: int, policy_type: str) -> None: + def __init__(self, created_at: datetime, href: str, id: str, name: str, + updated_at: datetime, metric_type: str, metric_value: int, + policy_type: str) -> None: """ Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object. + :param datetime created_at: The date and time that the instance group + manager policy was created. :param str href: The URL for this instance group manager policy. :param str id: The unique identifier for this instance group manager policy. :param str name: The user-defined name for this instance group manager policy. Names must be unique within the instance group manager. + :param datetime updated_at: The date and time that the instance group + manager policy was updated. :param str metric_type: The type of metric to be evaluated. :param int metric_value: The metric value to be evaluated. :param str policy_type: The type of policy for the instance group. """ # pylint: disable=super-init-not-called + self.created_at = created_at self.href = href self.id = id self.name = name + self.updated_at = updated_at self.metric_type = metric_type self.metric_value = metric_value self.policy_type = policy_type @@ -50101,6 +53984,12 @@ def from_dict( ) -> 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy': """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON' + ) if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -50119,6 +54008,12 @@ def from_dict( raise ValueError( 'Required property \'name\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON' ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON' + ) if 'metric_type' in _dict: args['metric_type'] = _dict.get('metric_type') else: @@ -50147,12 +54042,16 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href 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, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'metric_type') and self.metric_type is not None: _dict['metric_type'] = self.metric_type if hasattr(self, 'metric_value') and self.metric_value is not None: @@ -50347,45 +54246,71 @@ class ManagerTypeEnum(str, Enum): AUTOSCALE = 'autoscale' -class InstanceProfileBandwidthDependent(InstanceProfileBandwidth): +class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype( + InstanceGroupManagerPrototype): """ - The total bandwidth shared across the network interfaces of an instance with this - profile depends on its configuration. + InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype. - :attr str type: The type for this profile field. + :attr bool management_enabled: (optional) If set to `true`, this manager will + control the instance group. + :attr str name: (optional) The user-defined name for this instance group + manager. Names must be unique within the instance group. + :attr str manager_type: The type of instance group manager. """ - def __init__(self, type: str) -> None: + def __init__(self, + manager_type: str, + *, + management_enabled: bool = None, + name: str = None) -> None: """ - Initialize a InstanceProfileBandwidthDependent object. + Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object. - :param str type: The type for this profile field. + :param str manager_type: The type of instance group manager. + :param bool management_enabled: (optional) If set to `true`, this manager + will control the instance group. + :param str name: (optional) The user-defined name for this instance group + manager. Names must be unique within the instance group. """ # pylint: disable=super-init-not-called - self.type = type + self.management_enabled = management_enabled + self.name = name + self.manager_type = manager_type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent': - """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype': + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'manager_type' in _dict: + args['manager_type'] = _dict.get('manager_type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileBandwidthDependent JSON' + 'Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype 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, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr( + self, + 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'manager_type') and self.manager_type is not None: + _dict['manager_type'] = self.manager_type return _dict def _to_dict(self): @@ -50393,87 +54318,165 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthDependent object.""" + """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> bool: + def __eq__( + self, other: + 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype' + ) -> 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: 'InstanceProfileBandwidthDependent') -> bool: + def __ne__( + self, other: + 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ManagerTypeEnum(str, Enum): """ - The type for this profile field. + The type of instance group manager. """ - DEPENDENT = 'dependent' + SCHEDULED = 'scheduled' -class InstanceProfileBandwidthEnum(InstanceProfileBandwidth): +class InstanceGroupManagerScheduled(InstanceGroupManager): """ - The permitted total bandwidth values (in megabits per second) shared across the - network interfaces of an instance with this profile. + InstanceGroupManagerScheduled. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr datetime created_at: The date and time that the instance group manager was + created. + :attr str href: The URL for this instance group manager. + :attr str id: The unique identifier for this instance group manager. + :attr bool management_enabled: If set to `true`, this manager will control the + instance group. + :attr str name: The user-defined name for this instance group manager. Names + must be unique within the instance group. + :attr datetime updated_at: The date and time that the instance group manager was + updated. + :attr List[InstanceGroupManagerActionReference] actions: The actions of the + instance group manager. + :attr str manager_type: The type of instance group manager. """ - def __init__(self, default: int, type: str, values: List[int]) -> None: + def __init__(self, created_at: datetime, href: str, id: str, + management_enabled: bool, name: str, updated_at: datetime, + actions: List['InstanceGroupManagerActionReference'], + manager_type: str) -> None: """ - Initialize a InstanceProfileBandwidthEnum object. + Initialize a InstanceGroupManagerScheduled object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param datetime created_at: The date and time that the instance group + manager was created. + :param str href: The URL for this instance group manager. + :param str id: The unique identifier for this instance group manager. + :param bool management_enabled: If set to `true`, this manager will control + the instance group. + :param str name: The user-defined name for this instance group manager. + Names must be unique within the instance group. + :param datetime updated_at: The date and time that the instance group + manager was updated. + :param List[InstanceGroupManagerActionReference] actions: The actions of + the instance group manager. + :param str manager_type: The type of instance group manager. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.created_at = created_at + self.href = href + self.id = id + self.management_enabled = management_enabled + self.name = name + self.updated_at = updated_at + self.actions = actions + self.manager_type = manager_type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum': - """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled': + """Initialize a InstanceGroupManagerScheduled object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError( - 'Required property \'default\' not present in InstanceProfileBandwidthEnum JSON' + 'Required property \'created_at\' not present in InstanceGroupManagerScheduled JSON' ) - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileBandwidthEnum JSON' + 'Required property \'href\' not present in InstanceGroupManagerScheduled JSON' ) - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'values\' not present in InstanceProfileBandwidthEnum JSON' + 'Required property \'id\' not present in InstanceGroupManagerScheduled JSON' + ) + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') + else: + raise ValueError( + 'Required property \'management_enabled\' not present in InstanceGroupManagerScheduled JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceGroupManagerScheduled JSON' + ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON' + ) + if 'actions' in _dict: + args['actions'] = [ + InstanceGroupManagerActionReference.from_dict(x) + for x in _dict.get('actions') + ] + else: + raise ValueError( + 'Required property \'actions\' not present in InstanceGroupManagerScheduled JSON' + ) + if 'manager_type' in _dict: + args['manager_type'] = _dict.get('manager_type') + else: + raise ValueError( + 'Required property \'manager_type\' not present in InstanceGroupManagerScheduled JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduled 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr( + self, + 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'actions') and self.actions is not None: + _dict['actions'] = [x.to_dict() for x in self.actions] + if hasattr(self, 'manager_type') and self.manager_type is not None: + _dict['manager_type'] = self.manager_type return _dict def _to_dict(self): @@ -50481,76 +54484,113 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthEnum object.""" + """Return a `str` version of this InstanceGroupManagerScheduled object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> bool: + def __eq__(self, other: 'InstanceGroupManagerScheduled') -> 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: 'InstanceProfileBandwidthEnum') -> bool: + def __ne__(self, other: 'InstanceGroupManagerScheduled') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ManagerTypeEnum(str, Enum): """ - The type for this profile field. + The type of instance group manager. """ - ENUM = 'enum' + SCHEDULED = 'scheduled' -class InstanceProfileBandwidthFixed(InstanceProfileBandwidth): +class InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototype( + InstanceGroupManagerScheduledActionByManagerManager): """ - The total bandwidth (in megabits per second) shared across the network interfaces of - an instance with this profile. + The identity of the auto scale manager to update and the property or properties to be + updated. Exactly one of `id` or `href` must be provided in addition to at least one of + `min_membership_count` and `max_membership_count`. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr int max_membership_count: (optional) The maximum number of members the + instance group should have at the scheduled time. + :attr int min_membership_count: (optional) The minimum number of members the + instance group should have at the scheduled time. """ - def __init__(self, type: str, value: int) -> None: + def __init__(self, + *, + max_membership_count: int = None, + min_membership_count: int = None) -> None: """ - Initialize a InstanceProfileBandwidthFixed object. + Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototype object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param int max_membership_count: (optional) The maximum number of members + the instance group should have at the scheduled time. + :param int min_membership_count: (optional) The minimum number of members + the instance group should have at the scheduled time. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById', + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref' + ])) + raise Exception(msg) + + +class InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch( + InstanceGroupManagerScheduledActionByManagerPatchManager): + """ + InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch. + + :attr int max_membership_count: (optional) The maximum number of members the + instance group should have at the scheduled time. + :attr int min_membership_count: (optional) The minimum number of members the + instance group should have at the scheduled time. + """ + + def __init__(self, + *, + max_membership_count: int = None, + min_membership_count: int = None) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch object. + + :param int max_membership_count: (optional) The maximum number of members + the instance group should have at the scheduled time. + :param int min_membership_count: (optional) The minimum number of members + the instance group should have at the scheduled time. + """ + # pylint: disable=super-init-not-called + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed': - """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch': + """Initialize a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError( - 'Required property \'type\' not present in InstanceProfileBandwidthFixed JSON' - ) - if 'value' in _dict: - args['value'] = _dict.get('value') - else: - raise ValueError( - 'Required property \'value\' not present in InstanceProfileBandwidthFixed JSON' - ) + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch 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, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'max_membership_count' + ) and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count' + ) and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count return _dict def _to_dict(self): @@ -50558,110 +54598,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthFixed object.""" + """Return a `str` version of this InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> bool: + def __eq__( + self, other: + 'InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch' + ) -> 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: 'InstanceProfileBandwidthFixed') -> bool: + def __ne__( + self, other: + 'InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - FIXED = 'fixed' - -class InstanceProfileBandwidthRange(InstanceProfileBandwidth): +class InstanceGroupManagerScheduledActionManagerManagerAutoScale( + InstanceGroupManagerScheduledActionManagerManager): """ - The permitted total bandwidth range (in megabits per second) shared across the network - interfaces of an instance with this profile. + InstanceGroupManagerScheduledActionManagerManagerAutoScale. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The URL for this instance group manager. + :attr str id: The unique identifier for this instance group manager. + :attr str name: The user-defined name for this instance group manager. Names + must be unique within the instance group. + :attr int max_membership_count: (optional) The maximum number of members the + instance group should have at the scheduled time. + :attr int min_membership_count: (optional) The minimum number of members the + instance group should have at the scheduled time. """ - def __init__(self, default: int, max: int, min: int, step: int, - type: str) -> None: + def __init__(self, + href: str, + id: str, + name: str, + *, + deleted: 'InstanceGroupManagerReferenceDeleted' = None, + max_membership_count: int = None, + min_membership_count: int = None) -> None: """ - Initialize a InstanceProfileBandwidthRange object. + Initialize a InstanceGroupManagerScheduledActionManagerManagerAutoScale object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param str href: The URL for this instance group manager. + :param str id: The unique identifier for this instance group manager. + :param str name: The user-defined name for this instance group manager. + Names must be unique within the instance group. + :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted and + provides + some supplementary information. + :param int max_membership_count: (optional) The maximum number of members + the instance group should have at the scheduled time. + :param int min_membership_count: (optional) The minimum number of members + the instance group should have at the scheduled time. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange': - """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerScheduledActionManagerManagerAutoScale': + """Initialize a InstanceGroupManagerScheduledActionManagerManagerAutoScale object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError( - 'Required property \'default\' not present in InstanceProfileBandwidthRange JSON' - ) - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError( - 'Required property \'max\' not present in InstanceProfileBandwidthRange JSON' - ) - if 'min' in _dict: - args['min'] = _dict.get('min') + if 'deleted' in _dict: + args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'min\' not present in InstanceProfileBandwidthRange JSON' + 'Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerManagerAutoScale JSON' ) - if 'step' in _dict: - args['step'] = _dict.get('step') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'step\' not present in InstanceProfileBandwidthRange JSON' + 'Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerManagerAutoScale JSON' ) - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileBandwidthRange JSON' + 'Required property \'name\' not present in InstanceGroupManagerScheduledActionManagerManagerAutoScale JSON' ) + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduledActionManagerManagerAutoScale 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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, 'max_membership_count' + ) and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count' + ) and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count return _dict def _to_dict(self): @@ -50669,36 +54730,36 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthRange object.""" + """Return a `str` version of this InstanceGroupManagerScheduledActionManagerManagerAutoScale object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthRange') -> bool: + def __eq__( + self, + other: 'InstanceGroupManagerScheduledActionManagerManagerAutoScale' + ) -> 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: 'InstanceProfileBandwidthRange') -> bool: + def __ne__( + self, + other: 'InstanceGroupManagerScheduledActionManagerManagerAutoScale' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - RANGE = 'range' - -class InstanceProfileIdentityByHref(InstanceProfileIdentity): +class InstancePatchProfileInstanceProfileIdentityByHref(InstancePatchProfile): """ - InstanceProfileIdentityByHref. + InstancePatchProfileInstanceProfileIdentityByHref. :attr str href: The URL for this virtual server instance profile. """ def __init__(self, href: str) -> None: """ - Initialize a InstanceProfileIdentityByHref object. + Initialize a InstancePatchProfileInstanceProfileIdentityByHref object. :param str href: The URL for this virtual server instance profile. """ @@ -50706,20 +54767,22 @@ def __init__(self, href: str) -> None: self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref': - """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByHref': + """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in InstanceProfileIdentityByHref JSON' + 'Required property \'href\' not present in InstancePatchProfileInstanceProfileIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" + """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -50734,23 +54797,27 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileIdentityByHref object.""" + """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileIdentityByHref') -> bool: + def __eq__( + self, + other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> 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: 'InstanceProfileIdentityByHref') -> bool: + def __ne__( + self, + other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileIdentityByName(InstanceProfileIdentity): +class InstancePatchProfileInstanceProfileIdentityByName(InstancePatchProfile): """ - InstanceProfileIdentityByName. + InstancePatchProfileInstanceProfileIdentityByName. :attr str name: The globally unique name for this virtual server instance profile. @@ -50758,7 +54825,7 @@ class InstanceProfileIdentityByName(InstanceProfileIdentity): def __init__(self, name: str) -> None: """ - Initialize a InstanceProfileIdentityByName object. + Initialize a InstancePatchProfileInstanceProfileIdentityByName object. :param str name: The globally unique name for this virtual server instance profile. @@ -50767,20 +54834,22 @@ def __init__(self, name: str) -> None: self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName': - """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByName': + """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'name\' not present in InstanceProfileIdentityByName JSON' + 'Required property \'name\' not present in InstancePatchProfileInstanceProfileIdentityByName JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" + """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -50795,30 +54864,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileIdentityByName object.""" + """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileIdentityByName') -> bool: + def __eq__( + self, + other: 'InstancePatchProfileInstanceProfileIdentityByName') -> 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: 'InstanceProfileIdentityByName') -> bool: + def __ne__( + self, + other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileMemoryDependent(InstanceProfileMemory): +class InstancePlacementTargetPrototypeDedicatedHostGroupIdentity( + InstancePlacementTargetPrototype): + """ + Identifies a dedicated host group by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref' + ])) + raise Exception(msg) + + +class InstancePlacementTargetPrototypeDedicatedHostIdentity( + InstancePlacementTargetPrototype): + """ + Identifies a dedicated host by a unique property. + """ - The memory value for an instance with this profile depends on its configuration. + + def __init__(self) -> None: + """ + Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref' + ])) + raise Exception(msg) + + +class InstanceProfileBandwidthDependent(InstanceProfileBandwidth): + """ + The total bandwidth shared across the network interfaces and storage volumes of an + instance with this profile depends on its configuration. :attr str type: The type for this profile field. """ def __init__(self, type: str) -> None: """ - Initialize a InstanceProfileMemoryDependent object. + Initialize a InstanceProfileBandwidthDependent object. :param str type: The type for this profile field. """ @@ -50826,20 +54944,20 @@ def __init__(self, type: str) -> None: self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent': - """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent': + """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileMemoryDependent JSON' + 'Required property \'type\' not present in InstanceProfileBandwidthDependent JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -50854,16 +54972,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryDependent object.""" + """Return a `str` version of this InstanceProfileBandwidthDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryDependent') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> 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: 'InstanceProfileMemoryDependent') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -50874,9 +54992,10 @@ class TypeEnum(str, Enum): DEPENDENT = 'dependent' -class InstanceProfileMemoryEnum(InstanceProfileMemory): +class InstanceProfileBandwidthEnum(InstanceProfileBandwidth): """ - The permitted memory values (in gibibytes) for an instance with this profile. + The permitted total bandwidth values (in megabits per second) shared across the + network interfaces of an instance with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -50885,7 +55004,7 @@ class InstanceProfileMemoryEnum(InstanceProfileMemory): def __init__(self, default: int, type: str, values: List[int]) -> None: """ - Initialize a InstanceProfileMemoryEnum object. + Initialize a InstanceProfileBandwidthEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -50897,32 +55016,32 @@ def __init__(self, default: int, type: str, values: List[int]) -> None: self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum': - """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum': + """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'default\' not present in InstanceProfileMemoryEnum JSON' + 'Required property \'default\' not present in InstanceProfileBandwidthEnum JSON' ) if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileMemoryEnum JSON' + 'Required property \'type\' not present in InstanceProfileBandwidthEnum JSON' ) if 'values' in _dict: args['values'] = _dict.get('values') else: raise ValueError( - 'Required property \'values\' not present in InstanceProfileMemoryEnum JSON' + 'Required property \'values\' not present in InstanceProfileBandwidthEnum JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -50941,16 +55060,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryEnum object.""" + """Return a `str` version of this InstanceProfileBandwidthEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryEnum') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> 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: 'InstanceProfileMemoryEnum') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -50961,9 +55080,10 @@ class TypeEnum(str, Enum): ENUM = 'enum' -class InstanceProfileMemoryFixed(InstanceProfileMemory): +class InstanceProfileBandwidthFixed(InstanceProfileBandwidth): """ - The memory (in gibibytes) for an instance with this profile. + The total bandwidth (in megabits per second) shared across the network interfaces and + storage volumes of an instance with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -50971,7 +55091,7 @@ class InstanceProfileMemoryFixed(InstanceProfileMemory): def __init__(self, type: str, value: int) -> None: """ - Initialize a InstanceProfileMemoryFixed object. + Initialize a InstanceProfileBandwidthFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -50981,26 +55101,26 @@ def __init__(self, type: str, value: int) -> None: self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed': - """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed': + """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileMemoryFixed JSON' + 'Required property \'type\' not present in InstanceProfileBandwidthFixed JSON' ) if 'value' in _dict: args['value'] = _dict.get('value') else: raise ValueError( - 'Required property \'value\' not present in InstanceProfileMemoryFixed JSON' + 'Required property \'value\' not present in InstanceProfileBandwidthFixed JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51017,16 +55137,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryFixed object.""" + """Return a `str` version of this InstanceProfileBandwidthFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryFixed') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> 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: 'InstanceProfileMemoryFixed') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51037,9 +55157,10 @@ class TypeEnum(str, Enum): FIXED = 'fixed' -class InstanceProfileMemoryRange(InstanceProfileMemory): +class InstanceProfileBandwidthRange(InstanceProfileBandwidth): """ - The permitted memory range (in gibibytes) for an instance with this profile. + The permitted total bandwidth range (in megabits per second) shared across the network + interfaces and storage volumes of an instance with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -51051,7 +55172,7 @@ class InstanceProfileMemoryRange(InstanceProfileMemory): def __init__(self, default: int, max: int, min: int, step: int, type: str) -> None: """ - Initialize a InstanceProfileMemoryRange object. + Initialize a InstanceProfileBandwidthRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -51067,44 +55188,44 @@ def __init__(self, default: int, max: int, min: int, step: int, self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange': - """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange': + """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'default\' not present in InstanceProfileMemoryRange JSON' + 'Required property \'default\' not present in InstanceProfileBandwidthRange JSON' ) if 'max' in _dict: args['max'] = _dict.get('max') else: raise ValueError( - 'Required property \'max\' not present in InstanceProfileMemoryRange JSON' + 'Required property \'max\' not present in InstanceProfileBandwidthRange JSON' ) if 'min' in _dict: args['min'] = _dict.get('min') else: raise ValueError( - 'Required property \'min\' not present in InstanceProfileMemoryRange JSON' + 'Required property \'min\' not present in InstanceProfileBandwidthRange JSON' ) if 'step' in _dict: args['step'] = _dict.get('step') else: raise ValueError( - 'Required property \'step\' not present in InstanceProfileMemoryRange JSON' + 'Required property \'step\' not present in InstanceProfileBandwidthRange JSON' ) if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileMemoryRange JSON' + 'Required property \'type\' not present in InstanceProfileBandwidthRange JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51127,16 +55248,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryRange object.""" + """Return a `str` version of this InstanceProfileBandwidthRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryRange') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthRange') -> 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: 'InstanceProfileMemoryRange') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51147,17 +55268,17 @@ class TypeEnum(str, Enum): RANGE = 'range' -class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed): +class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity): """ - The port speed of each network interface of an instance with this profile depends on - its configuration. + The number of disks of this configuration for an instance with this profile depends on + its instance configuration. :attr str type: The type for this profile field. """ def __init__(self, type: str) -> None: """ - Initialize a InstanceProfilePortSpeedDependent object. + Initialize a InstanceProfileDiskQuantityDependent object. :param str type: The type for this profile field. """ @@ -51165,20 +55286,20 @@ def __init__(self, type: str) -> None: self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent': - """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityDependent': + """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON' + 'Required property \'type\' not present in InstanceProfileDiskQuantityDependent JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51193,16 +55314,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfilePortSpeedDependent object.""" + """Return a `str` version of this InstanceProfileDiskQuantityDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityDependent') -> 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: 'InstanceProfilePortSpeedDependent') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51213,10 +55334,97 @@ class TypeEnum(str, Enum): DEPENDENT = 'dependent' -class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed): +class InstanceProfileDiskQuantityEnum(InstanceProfileDiskQuantity): """ - The maximum speed (in megabits per second) of each network interface of an instance - with this profile. + The permitted the number of disks of this configuration for an instance with this + profile. + + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. + """ + + def __init__(self, default: int, type: str, values: List[int]) -> None: + """ + Initialize a InstanceProfileDiskQuantityEnum object. + + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. + """ + # pylint: disable=super-init-not-called + self.default = default + self.type = type + self.values = values + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityEnum': + """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError( + 'Required property \'default\' not present in InstanceProfileDiskQuantityEnum JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileDiskQuantityEnum JSON' + ) + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError( + 'Required property \'values\' not present in InstanceProfileDiskQuantityEnum JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDiskQuantityEnum 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + 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 InstanceProfileDiskQuantityEnum object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileDiskQuantityEnum') -> 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: 'InstanceProfileDiskQuantityEnum') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + ENUM = 'enum' + + +class InstanceProfileDiskQuantityFixed(InstanceProfileDiskQuantity): + """ + The number of disks of this configuration for an instance with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -51224,7 +55432,7 @@ class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed): def __init__(self, type: str, value: int) -> None: """ - Initialize a InstanceProfilePortSpeedFixed object. + Initialize a InstanceProfileDiskQuantityFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -51234,26 +55442,26 @@ def __init__(self, type: str, value: int) -> None: self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed': - """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityFixed': + """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON' + 'Required property \'type\' not present in InstanceProfileDiskQuantityFixed JSON' ) if 'value' in _dict: args['value'] = _dict.get('value') else: raise ValueError( - 'Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON' + 'Required property \'value\' not present in InstanceProfileDiskQuantityFixed JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51270,16 +55478,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfilePortSpeedFixed object.""" + """Return a `str` version of this InstanceProfileDiskQuantityFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityFixed') -> 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: 'InstanceProfilePortSpeedFixed') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51290,16 +55498,128 @@ class TypeEnum(str, Enum): FIXED = 'fixed' -class InstanceProfileVCPUDependent(InstanceProfileVCPU): +class InstanceProfileDiskQuantityRange(InstanceProfileDiskQuantity): """ - The VCPU count for an instance with this profile depends on its configuration. + The permitted range for the number of disks of this configuration for an instance with + this profile. + + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. + """ + + def __init__(self, default: int, max: int, min: int, step: int, + type: str) -> None: + """ + Initialize a InstanceProfileDiskQuantityRange object. + + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityRange': + """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError( + 'Required property \'default\' not present in InstanceProfileDiskQuantityRange JSON' + ) + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError( + 'Required property \'max\' not present in InstanceProfileDiskQuantityRange JSON' + ) + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError( + 'Required property \'min\' not present in InstanceProfileDiskQuantityRange JSON' + ) + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError( + 'Required property \'step\' not present in InstanceProfileDiskQuantityRange JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileDiskQuantityRange JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDiskQuantityRange 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + 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 InstanceProfileDiskQuantityRange object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileDiskQuantityRange') -> 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: 'InstanceProfileDiskQuantityRange') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + RANGE = 'range' + + +class InstanceProfileDiskSizeDependent(InstanceProfileDiskSize): + """ + The disk size in GB (gigabytes) of this configuration for an instance with this + profile depends on its instance configuration. :attr str type: The type for this profile field. """ def __init__(self, type: str) -> None: """ - Initialize a InstanceProfileVCPUDependent object. + Initialize a InstanceProfileDiskSizeDependent object. :param str type: The type for this profile field. """ @@ -51307,20 +55627,20 @@ def __init__(self, type: str) -> None: self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent': - """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeDependent': + """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileVCPUDependent JSON' + 'Required property \'type\' not present in InstanceProfileDiskSizeDependent JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51335,16 +55655,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUDependent object.""" + """Return a `str` version of this InstanceProfileDiskSizeDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUDependent') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeDependent') -> 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: 'InstanceProfileVCPUDependent') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51355,9 +55675,10 @@ class TypeEnum(str, Enum): DEPENDENT = 'dependent' -class InstanceProfileVCPUEnum(InstanceProfileVCPU): +class InstanceProfileDiskSizeEnum(InstanceProfileDiskSize): """ - The permitted values for VCPU count for an instance with this profile. + The permitted disk size in GB (gigabytes) of this configuration for an instance with + this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -51366,7 +55687,7 @@ class InstanceProfileVCPUEnum(InstanceProfileVCPU): def __init__(self, default: int, type: str, values: List[int]) -> None: """ - Initialize a InstanceProfileVCPUEnum object. + Initialize a InstanceProfileDiskSizeEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -51378,32 +55699,32 @@ def __init__(self, default: int, type: str, values: List[int]) -> None: self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum': - """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeEnum': + """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'default\' not present in InstanceProfileVCPUEnum JSON' + 'Required property \'default\' not present in InstanceProfileDiskSizeEnum JSON' ) if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileVCPUEnum JSON' + 'Required property \'type\' not present in InstanceProfileDiskSizeEnum JSON' ) if 'values' in _dict: args['values'] = _dict.get('values') else: raise ValueError( - 'Required property \'values\' not present in InstanceProfileVCPUEnum JSON' + 'Required property \'values\' not present in InstanceProfileDiskSizeEnum JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51422,16 +55743,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUEnum object.""" + """Return a `str` version of this InstanceProfileDiskSizeEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUEnum') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeEnum') -> 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: 'InstanceProfileVCPUEnum') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51442,9 +55763,9 @@ class TypeEnum(str, Enum): ENUM = 'enum' -class InstanceProfileVCPUFixed(InstanceProfileVCPU): +class InstanceProfileDiskSizeFixed(InstanceProfileDiskSize): """ - The VCPU count for an instance with this profile. + The size of the disk in GB (gigabytes). :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -51452,7 +55773,7 @@ class InstanceProfileVCPUFixed(InstanceProfileVCPU): def __init__(self, type: str, value: int) -> None: """ - Initialize a InstanceProfileVCPUFixed object. + Initialize a InstanceProfileDiskSizeFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -51462,26 +55783,26 @@ def __init__(self, type: str, value: int) -> None: self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed': - """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeFixed': + """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileVCPUFixed JSON' + 'Required property \'type\' not present in InstanceProfileDiskSizeFixed JSON' ) if 'value' in _dict: args['value'] = _dict.get('value') else: raise ValueError( - 'Required property \'value\' not present in InstanceProfileVCPUFixed JSON' + 'Required property \'value\' not present in InstanceProfileDiskSizeFixed JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51498,16 +55819,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUFixed object.""" + """Return a `str` version of this InstanceProfileDiskSizeFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUFixed') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeFixed') -> 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: 'InstanceProfileVCPUFixed') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51518,9 +55839,10 @@ class TypeEnum(str, Enum): FIXED = 'fixed' -class InstanceProfileVCPURange(InstanceProfileVCPU): +class InstanceProfileDiskSizeRange(InstanceProfileDiskSize): """ - The permitted range for VCPU count for an instance with this profile. + The permitted range for the disk size of this configuration in GB (gigabytes) for an + instance with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -51532,7 +55854,7 @@ class InstanceProfileVCPURange(InstanceProfileVCPU): def __init__(self, default: int, max: int, min: int, step: int, type: str) -> None: """ - Initialize a InstanceProfileVCPURange object. + Initialize a InstanceProfileDiskSizeRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -51548,44 +55870,44 @@ def __init__(self, default: int, max: int, min: int, step: int, self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange': - """Initialize a InstanceProfileVCPURange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeRange': + """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'default\' not present in InstanceProfileVCPURange JSON' + 'Required property \'default\' not present in InstanceProfileDiskSizeRange JSON' ) if 'max' in _dict: args['max'] = _dict.get('max') else: raise ValueError( - 'Required property \'max\' not present in InstanceProfileVCPURange JSON' + 'Required property \'max\' not present in InstanceProfileDiskSizeRange JSON' ) if 'min' in _dict: args['min'] = _dict.get('min') else: raise ValueError( - 'Required property \'min\' not present in InstanceProfileVCPURange JSON' + 'Required property \'min\' not present in InstanceProfileDiskSizeRange JSON' ) if 'step' in _dict: args['step'] = _dict.get('step') else: raise ValueError( - 'Required property \'step\' not present in InstanceProfileVCPURange JSON' + 'Required property \'step\' not present in InstanceProfileDiskSizeRange JSON' ) if 'type' in _dict: args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'type\' not present in InstanceProfileVCPURange JSON' + 'Required property \'type\' not present in InstanceProfileDiskSizeRange JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPURange object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -51608,16 +55930,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPURange object.""" + """Return a `str` version of this InstanceProfileDiskSizeRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPURange') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeRange') -> 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: 'InstanceProfileVCPURange') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -51628,230 +55950,44 @@ class TypeEnum(str, Enum): RANGE = 'range' -class InstancePrototypeInstanceByImage(InstancePrototype): +class InstanceProfileIdentityByHref(InstanceProfileIdentity): """ - InstancePrototypeInstanceByImage. + InstanceProfileIdentityByHref. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init vendor - data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - :attr str name: (optional) The unique user-defined name for this virtual server - instance (and default system hostname). If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection - of additional network interfaces to create for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupIdentity resource_group: (optional) - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If provided, must match the VPC tied to the subnets of the instance's - network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: The identity of the image to use when provisioning - the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str href: The URL for this virtual server instance profile. """ - def __init__( - self, - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - keys: List['KeyIdentity'] = None, - name: str = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - user_data: str = None, - volume_attachments: List[ - 'VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: - 'VolumeAttachmentPrototypeInstanceByImageContext' = None - ) -> None: + def __init__(self, href: str) -> None: """ - Initialize a InstancePrototypeInstanceByImage object. + Initialize a InstanceProfileIdentityByHref object. - :param ImageIdentity image: The identity of the image to use when - provisioning the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added - as SSH authorized keys for the administrative user. - :param str name: (optional) The unique user-defined name for this virtual - server instance (and default system hostname). If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) - Collection of additional network interfaces to create for the virtual - server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param ResourceGroupIdentity resource_group: (optional) - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If provided, must match the VPC tied to the subnets of the - instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. + :param str href: The URL for this virtual server instance profile. """ # pylint: disable=super-init-not-called - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.profile = profile - self.resource_group = resource_group - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.zone = zone + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': - """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref': + """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" args = {} - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [ - NetworkInterfacePrototype.from_dict(x) - for x in _dict.get('network_interfaces') - ] - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [ - VolumeAttachmentPrototypeInstanceContext.from_dict(x) - for x in _dict.get('volume_attachments') - ] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args[ - 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - _dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError( - 'Required property \'image\' not present in InstancePrototypeInstanceByImage JSON' - ) - if 'primary_network_interface' in _dict: - args[ - 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( - _dict.get('primary_network_interface')) - else: - raise ValueError( - 'Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImage JSON' - ) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'zone\' not present in InstancePrototypeInstanceByImage JSON' + 'Required property \'href\' not present in InstanceProfileIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" + """Initialize a InstanceProfileIdentityByHref 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, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr( - self, - 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [ - x.to_dict() for x in self.network_interfaces - ] - 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr( - self, - 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [ - x.to_dict() for x in self.volume_attachments - ] - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'boot_volume_attachment' - ) and self.boot_volume_attachment is not None: - _dict[ - 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( - ) - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'primary_network_interface' - ) and self.primary_network_interface is not None: - _dict[ - 'primary_network_interface'] = self.primary_network_interface.to_dict( - ) - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -51859,250 +55995,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceByImage object.""" + """Return a `str` version of this InstanceProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceByImage') -> bool: + def __eq__(self, other: 'InstanceProfileIdentityByHref') -> 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: 'InstancePrototypeInstanceByImage') -> bool: + def __ne__(self, other: 'InstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): +class InstanceProfileIdentityByName(InstanceProfileIdentity): """ - InstancePrototypeInstanceBySourceTemplate. + InstanceProfileIdentityByName. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init vendor - data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - :attr str name: (optional) The unique user-defined name for this virtual server - instance (and default system hostname). If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection - of additional network interfaces to create for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupIdentity resource_group: (optional) - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If provided, must match the VPC tied to the subnets of the instance's - network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: (optional) The identity of the image to use when - provisioning the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary - network interface. - :attr InstanceTemplateIdentity source_template: Identifies an instance template - by a unique property. - :attr ZoneIdentity zone: (optional) The zone this virtual server instance will - reside in. + :attr str name: The globally unique name for this virtual server instance + profile. """ - def __init__(self, - source_template: 'InstanceTemplateIdentity', - *, - keys: List['KeyIdentity'] = None, - name: str = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - user_data: str = None, - volume_attachments: List[ - 'VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: - 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - image: 'ImageIdentity' = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None) -> None: + def __init__(self, name: str) -> None: """ - Initialize a InstancePrototypeInstanceBySourceTemplate object. + Initialize a InstanceProfileIdentityByName object. - :param InstanceTemplateIdentity source_template: Identifies an instance - template by a unique property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added - as SSH authorized keys for the administrative user. - :param str name: (optional) The unique user-defined name for this virtual - server instance (and default system hostname). If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) - Collection of additional network interfaces to create for the virtual - server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param ResourceGroupIdentity resource_group: (optional) - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If provided, must match the VPC tied to the subnets of the - instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. - :param ImageIdentity image: (optional) The identity of the image to use - when provisioning the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) - Primary network interface. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. + :param str name: The globally unique name for this virtual server instance + profile. """ # pylint: disable=super-init-not-called - self.keys = keys self.name = name - self.network_interfaces = network_interfaces - self.profile = profile - self.resource_group = resource_group - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.source_template = source_template - self.zone = zone @classmethod - def from_dict(cls, - _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName': + """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" args = {} - if 'keys' in _dict: - args['keys'] = _dict.get('keys') if 'name' in _dict: args['name'] = _dict.get('name') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [ - NetworkInterfacePrototype.from_dict(x) - for x in _dict.get('network_interfaces') - ] - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [ - VolumeAttachmentPrototypeInstanceContext.from_dict(x) - for x in _dict.get('volume_attachments') - ] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args[ - 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - _dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - if 'primary_network_interface' in _dict: - args[ - 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( - _dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') else: raise ValueError( - 'Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON' + 'Required property \'name\' not present in InstanceProfileIdentityByName JSON' ) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + """Initialize a InstanceProfileIdentityByName 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, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr( - self, - 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [ - x.to_dict() for x in self.network_interfaces - ] - 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr( - self, - 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [ - x.to_dict() for x in self.volume_attachments - ] - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'boot_volume_attachment' - ) and self.boot_volume_attachment is not None: - _dict[ - 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( - ) - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'primary_network_interface' - ) and self.primary_network_interface is not None: - _dict[ - 'primary_network_interface'] = self.primary_network_interface.to_dict( - ) - if hasattr(self, - 'source_template') and self.source_template is not None: - if isinstance(self.source_template, dict): - _dict['source_template'] = self.source_template - else: - _dict['source_template'] = self.source_template.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -52110,60 +56056,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object.""" + """Return a `str` version of this InstanceProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __eq__(self, other: 'InstanceProfileIdentityByName') -> 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: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __ne__(self, other: 'InstanceProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity): +class InstanceProfileMemoryDependent(InstanceProfileMemory): """ - InstanceTemplateIdentityByCRN. + The memory value for an instance with this profile depends on its configuration. - :attr str crn: The CRN for this instance template. + :attr str type: The type for this profile field. """ - def __init__(self, crn: str) -> None: + def __init__(self, type: str) -> None: """ - Initialize a InstanceTemplateIdentityByCRN object. + Initialize a InstanceProfileMemoryDependent object. - :param str crn: The CRN for this instance template. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN': - """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent': + """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON' + 'Required property \'type\' not present in InstanceProfileMemoryDependent JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" + """Initialize a InstanceProfileMemoryDependent 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, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -52171,58 +56115,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityByCRN object.""" + """Return a `str` version of this InstanceProfileMemoryDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryDependent') -> 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: 'InstanceTemplateIdentityByCRN') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + DEPENDENT = 'dependent' + -class InstanceTemplateIdentityByHref(InstanceTemplateIdentity): +class InstanceProfileMemoryEnum(InstanceProfileMemory): """ - InstanceTemplateIdentityByHref. + The permitted memory values (in gibibytes) for an instance with this profile. - :attr str href: The URL for this instance template. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ - def __init__(self, href: str) -> None: + def __init__(self, default: int, type: str, values: List[int]) -> None: """ - Initialize a InstanceTemplateIdentityByHref object. + Initialize a InstanceProfileMemoryEnum object. - :param str href: The URL for this instance template. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref': - """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum': + """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'href\' not present in InstanceTemplateIdentityByHref JSON' + 'Required property \'default\' not present in InstanceProfileMemoryEnum JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileMemoryEnum JSON' + ) + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError( + 'Required property \'values\' not present in InstanceProfileMemoryEnum JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" + """Initialize a InstanceProfileMemoryEnum 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -52230,58 +56202,75 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityByHref object.""" + """Return a `str` version of this InstanceProfileMemoryEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryEnum') -> 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: 'InstanceTemplateIdentityByHref') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + ENUM = 'enum' + -class InstanceTemplateIdentityById(InstanceTemplateIdentity): +class InstanceProfileMemoryFixed(InstanceProfileMemory): """ - InstanceTemplateIdentityById. + The memory (in gibibytes) for an instance with this profile. - :attr str id: The unique identifier for this instance template. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ - def __init__(self, id: str) -> None: + def __init__(self, type: str, value: int) -> None: """ - Initialize a InstanceTemplateIdentityById object. + Initialize a InstanceProfileMemoryFixed object. - :param str id: The unique identifier for this instance template. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.id = id + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityById': - """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed': + """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'id\' not present in InstanceTemplateIdentityById JSON' + 'Required property \'type\' not present in InstanceProfileMemoryFixed JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in InstanceProfileMemoryFixed JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" + """Initialize a InstanceProfileMemoryFixed 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -52289,245 +56278,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityById object.""" + """Return a `str` version of this InstanceProfileMemoryFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityById') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryFixed') -> 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: 'InstanceTemplateIdentityById') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' -class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): + +class InstanceProfileMemoryRange(InstanceProfileMemory): """ - InstanceTemplatePrototypeInstanceByImage. + The permitted memory range (in gibibytes) for an instance with this profile. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init vendor - data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - :attr str name: (optional) The unique user-defined name for this virtual server - instance (and default system hostname). If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection - of additional network interfaces to create for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupIdentity resource_group: (optional) - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If provided, must match the VPC tied to the subnets of the instance's - network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: The identity of the image to use when provisioning - the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ - def __init__( - self, - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - keys: List['KeyIdentity'] = None, - name: str = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - user_data: str = None, - volume_attachments: List[ - 'VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: - 'VolumeAttachmentPrototypeInstanceByImageContext' = None - ) -> None: + def __init__(self, default: int, max: int, min: int, step: int, + type: str) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceByImage object. + Initialize a InstanceProfileMemoryRange object. - :param ImageIdentity image: The identity of the image to use when - provisioning the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added - as SSH authorized keys for the administrative user. - :param str name: (optional) The unique user-defined name for this virtual - server instance (and default system hostname). If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) - Collection of additional network interfaces to create for the virtual - server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param ResourceGroupIdentity resource_group: (optional) - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If provided, must match the VPC tied to the subnets of the - instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.profile = profile - self.resource_group = resource_group - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.zone = zone + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, - _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': - """Initialize a InstanceTemplatePrototypeInstanceByImage object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange': + """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" args = {} - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [ - NetworkInterfacePrototype.from_dict(x) - for x in _dict.get('network_interfaces') - ] - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [ - VolumeAttachmentPrototypeInstanceContext.from_dict(x) - for x in _dict.get('volume_attachments') - ] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args[ - 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - _dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') + if 'default' in _dict: + args['default'] = _dict.get('default') else: raise ValueError( - 'Required property \'image\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + 'Required property \'default\' not present in InstanceProfileMemoryRange JSON' ) - if 'primary_network_interface' in _dict: - args[ - 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( - _dict.get('primary_network_interface')) + if 'max' in _dict: + args['max'] = _dict.get('max') else: raise ValueError( - 'Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + 'Required property \'max\' not present in InstanceProfileMemoryRange JSON' ) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'min' in _dict: + args['min'] = _dict.get('min') else: raise ValueError( - 'Required property \'zone\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + 'Required property \'min\' not present in InstanceProfileMemoryRange JSON' + ) + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError( + 'Required property \'step\' not present in InstanceProfileMemoryRange JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileMemoryRange JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceByImage object from a json dictionary.""" + """Initialize a InstanceProfileMemoryRange 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, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr( - self, - 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [ - x.to_dict() for x in self.network_interfaces - ] - 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr( - self, - 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [ - x.to_dict() for x in self.volume_attachments - ] - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'boot_volume_attachment' - ) and self.boot_volume_attachment is not None: - _dict[ - 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( - ) - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'primary_network_interface' - ) and self.primary_network_interface is not None: - _dict[ - 'primary_network_interface'] = self.primary_network_interface.to_dict( - ) - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -52535,174 +56388,1632 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceByImage object.""" + """Return a `str` version of this InstanceProfileMemoryRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceByImage') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryRange') -> 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: 'InstanceTemplatePrototypeInstanceByImage') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + RANGE = 'range' -class InstanceTemplatePrototypeInstanceBySourceTemplate( - InstanceTemplatePrototype): + +class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed): """ - InstanceTemplatePrototypeInstanceBySourceTemplate. + The port speed of each network interface of an instance with this profile depends on + its configuration. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless the - image used provides another means of access. For Windows instances, one of the - keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init vendor - data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - :attr str name: (optional) The unique user-defined name for this virtual server - instance (and default system hostname). If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection - of additional network interfaces to create for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupIdentity resource_group: (optional) - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If provided, must match the VPC tied to the subnets of the instance's - network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: (optional) The identity of the image to use when - provisioning the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary - network interface. - :attr InstanceTemplateIdentity source_template: Identifies an instance template - by a unique property. - :attr ZoneIdentity zone: (optional) The zone this virtual server instance will - reside in. + :attr str type: The type for this profile field. """ - def __init__(self, - source_template: 'InstanceTemplateIdentity', - *, - keys: List['KeyIdentity'] = None, - name: str = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - user_data: str = None, - volume_attachments: List[ - 'VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: - 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - image: 'ImageIdentity' = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None) -> None: + def __init__(self, type: str) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object. + Initialize a InstanceProfilePortSpeedDependent object. - :param InstanceTemplateIdentity source_template: Identifies an instance - template by a unique property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Up to 10 keys may be - provided; if no keys are provided the instance will be inaccessible unless - the image used provides another means of access. For Windows instances, one - of the keys will be used to encrypt the administrator password. - Keys will be made available to the virtual server instance as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added - as SSH authorized keys for the administrative user. - :param str name: (optional) The unique user-defined name for this virtual - server instance (and default system hostname). If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) - Collection of additional network interfaces to create for the virtual - server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param ResourceGroupIdentity resource_group: (optional) - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) Collection of volume attachments. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If provided, must match the VPC tied to the subnets of the - instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. - :param ImageIdentity image: (optional) The identity of the image to use - when provisioning the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) - Primary network interface. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.profile = profile - self.resource_group = resource_group - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.source_template = source_template - self.zone = zone + self.type = type @classmethod - def from_dict( - cls, - _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTemplate': - """Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent': + """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" args = {} - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [ - NetworkInterfacePrototype.from_dict(x) - for x in _dict.get('network_interfaces') - ] - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [ - VolumeAttachmentPrototypeInstanceContext.from_dict(x) - for x in _dict.get('volume_attachments') - ] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args[ - 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - _dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - if 'primary_network_interface' in _dict: - args[ - 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( - _dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError( - 'Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceBySourceTemplate JSON' + 'Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfilePortSpeedDependent 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, '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 InstanceProfilePortSpeedDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> 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: 'InstanceProfilePortSpeedDependent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + DEPENDENT = 'dependent' + + +class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed): + """ + The maximum speed (in megabits per second) of each network interface of an instance + with this profile. + + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. + """ + + def __init__(self, type: str, value: int) -> None: + """ + Initialize a InstanceProfilePortSpeedFixed object. + + :param str type: The type for this profile field. + :param int value: The value for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed': + """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfilePortSpeedFixed 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 InstanceProfilePortSpeedFixed object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> 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: 'InstanceProfilePortSpeedFixed') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + +class InstanceProfileVCPUDependent(InstanceProfileVCPU): + """ + The VCPU count for an instance with this profile depends on its configuration. + + :attr str type: The type for this profile field. + """ + + def __init__(self, type: str) -> None: + """ + Initialize a InstanceProfileVCPUDependent object. + + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent': + """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileVCPUDependent JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileVCPUDependent 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, '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 InstanceProfileVCPUDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileVCPUDependent') -> 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: 'InstanceProfileVCPUDependent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + DEPENDENT = 'dependent' + + +class InstanceProfileVCPUEnum(InstanceProfileVCPU): + """ + The permitted values for VCPU count for an instance with this profile. + + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. + """ + + def __init__(self, default: int, type: str, values: List[int]) -> None: + """ + Initialize a InstanceProfileVCPUEnum object. + + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. + """ + # pylint: disable=super-init-not-called + self.default = default + self.type = type + self.values = values + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum': + """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError( + 'Required property \'default\' not present in InstanceProfileVCPUEnum JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileVCPUEnum JSON' + ) + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError( + 'Required property \'values\' not present in InstanceProfileVCPUEnum JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileVCPUEnum 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + 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 InstanceProfileVCPUEnum object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileVCPUEnum') -> 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: 'InstanceProfileVCPUEnum') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + ENUM = 'enum' + + +class InstanceProfileVCPUFixed(InstanceProfileVCPU): + """ + The VCPU count for an instance with this profile. + + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. + """ + + def __init__(self, type: str, value: int) -> None: + """ + Initialize a InstanceProfileVCPUFixed object. + + :param str type: The type for this profile field. + :param int value: The value for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed': + """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileVCPUFixed JSON' + ) + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError( + 'Required property \'value\' not present in InstanceProfileVCPUFixed JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileVCPUFixed 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + 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 InstanceProfileVCPUFixed object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileVCPUFixed') -> 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: 'InstanceProfileVCPUFixed') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + FIXED = 'fixed' + + +class InstanceProfileVCPURange(InstanceProfileVCPU): + """ + The permitted range for VCPU count for an instance with this profile. + + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. + """ + + def __init__(self, default: int, max: int, min: int, step: int, + type: str) -> None: + """ + Initialize a InstanceProfileVCPURange object. + + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange': + """Initialize a InstanceProfileVCPURange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError( + 'Required property \'default\' not present in InstanceProfileVCPURange JSON' + ) + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError( + 'Required property \'max\' not present in InstanceProfileVCPURange JSON' + ) + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError( + 'Required property \'min\' not present in InstanceProfileVCPURange JSON' + ) + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError( + 'Required property \'step\' not present in InstanceProfileVCPURange JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError( + 'Required property \'type\' not present in InstanceProfileVCPURange JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileVCPURange 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + 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 InstanceProfileVCPURange object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileVCPURange') -> 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: 'InstanceProfileVCPURange') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + RANGE = 'range' + + +class InstancePrototypeInstanceByImage(InstancePrototype): + """ + InstancePrototypeInstanceByImage. + + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless the + image used provides another means of access. For Windows instances, one of the + keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init vendor + data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + :attr str name: (optional) The unique user-defined name for this virtual server + instance (and default system hostname). If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection + of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The profile to use for this + virtual server instance. + :attr ResourceGroupIdentity resource_group: (optional) + :attr str user_data: (optional) User data to be made available when setting up + the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a + part of. If provided, must match the VPC tied to the subnets of the instance's + network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: The identity of the image to use when provisioning + the virtual server instance. + :attr NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + """ + + def __init__( + self, + image: 'ImageIdentity', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + keys: List['KeyIdentity'] = None, + name: str = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + user_data: str = None, + volume_attachments: List[ + 'VolumeAttachmentPrototypeInstanceContext'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: + 'VolumeAttachmentPrototypeInstanceByImageContext' = None + ) -> None: + """ + Initialize a InstancePrototypeInstanceByImage object. + + :param ImageIdentity image: The identity of the image to use when + provisioning the virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless + the image used provides another means of access. For Windows instances, one + of the keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added + as SSH authorized keys for the administrative user. + :param str name: (optional) The unique user-defined name for this virtual + server instance (and default system hostname). If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) + Collection of additional network interfaces to create for the virtual + server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The profile to use for + this virtual server instance. + :param ResourceGroupIdentity resource_group: (optional) + :param str user_data: (optional) User data to be made available when + setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :param VPCIdentity vpc: (optional) The VPC the virtual server instance is + to be a part of. If provided, must match the VPC tied to the subnets of the + instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. + """ + # pylint: disable=super-init-not-called + self.keys = keys + self.name = name + self.network_interfaces = network_interfaces + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.primary_network_interface = primary_network_interface + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': + """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" + args = {} + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [ + NetworkInterfacePrototype.from_dict(x) + for x in _dict.get('network_interfaces') + ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [ + VolumeAttachmentPrototypeInstanceContext.from_dict(x) + for x in _dict.get('volume_attachments') + ] + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') + if 'boot_volume_attachment' in _dict: + args[ + 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( + _dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') + else: + raise ValueError( + 'Required property \'image\' not present in InstancePrototypeInstanceByImage JSON' + ) + if 'primary_network_interface' in _dict: + args[ + 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( + _dict.get('primary_network_interface')) + else: + raise ValueError( + 'Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImage JSON' + ) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError( + 'Required property \'zone\' not present in InstancePrototypeInstanceByImage JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstancePrototypeInstanceByImage 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, 'keys') and self.keys is not None: + keys_list = [] + for x in self.keys: + if isinstance(x, dict): + keys_list.append(x) + else: + keys_list.append(x.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr( + self, + 'network_interfaces') and self.network_interfaces is not None: + _dict['network_interfaces'] = [ + x.to_dict() for x in self.network_interfaces + ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr( + self, + 'volume_attachments') and self.volume_attachments is not None: + _dict['volume_attachments'] = [ + x.to_dict() for x in self.volume_attachments + ] + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'boot_volume_attachment' + ) and self.boot_volume_attachment is not None: + _dict[ + 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( + ) + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'primary_network_interface' + ) and self.primary_network_interface is not None: + _dict[ + 'primary_network_interface'] = self.primary_network_interface.to_dict( + ) + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.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 InstancePrototypeInstanceByImage object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstancePrototypeInstanceByImage') -> 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: 'InstancePrototypeInstanceByImage') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): + """ + InstancePrototypeInstanceBySourceTemplate. + + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless the + image used provides another means of access. For Windows instances, one of the + keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init vendor + data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + :attr str name: (optional) The unique user-defined name for this virtual server + instance (and default system hostname). If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection + of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The profile to use for this + virtual server instance. + :attr ResourceGroupIdentity resource_group: (optional) + :attr str user_data: (optional) User data to be made available when setting up + the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a + part of. If provided, must match the VPC tied to the subnets of the instance's + network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: (optional) The identity of the image to use when + provisioning the virtual server instance. + :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary + network interface. + :attr InstanceTemplateIdentity source_template: Identifies an instance template + by a unique property. + :attr ZoneIdentity zone: (optional) The zone this virtual server instance will + reside in. + """ + + def __init__(self, + source_template: 'InstanceTemplateIdentity', + *, + keys: List['KeyIdentity'] = None, + name: str = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + user_data: str = None, + volume_attachments: List[ + 'VolumeAttachmentPrototypeInstanceContext'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: + 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + image: 'ImageIdentity' = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, + zone: 'ZoneIdentity' = None) -> None: + """ + Initialize a InstancePrototypeInstanceBySourceTemplate object. + + :param InstanceTemplateIdentity source_template: Identifies an instance + template by a unique property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless + the image used provides another means of access. For Windows instances, one + of the keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added + as SSH authorized keys for the administrative user. + :param str name: (optional) The unique user-defined name for this virtual + server instance (and default system hostname). If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) + Collection of additional network interfaces to create for the virtual + server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The profile to use for + this virtual server instance. + :param ResourceGroupIdentity resource_group: (optional) + :param str user_data: (optional) User data to be made available when + setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :param VPCIdentity vpc: (optional) The VPC the virtual server instance is + to be a part of. If provided, must match the VPC tied to the subnets of the + instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. + :param ImageIdentity image: (optional) The identity of the image to use + when provisioning the virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: (optional) + Primary network interface. + :param ZoneIdentity zone: (optional) The zone this virtual server instance + will reside in. + """ + # pylint: disable=super-init-not-called + self.keys = keys + self.name = name + self.network_interfaces = network_interfaces + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.primary_network_interface = primary_network_interface + self.source_template = source_template + self.zone = zone + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': + """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + args = {} + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [ + NetworkInterfacePrototype.from_dict(x) + for x in _dict.get('network_interfaces') + ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [ + VolumeAttachmentPrototypeInstanceContext.from_dict(x) + for x in _dict.get('volume_attachments') + ] + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') + if 'boot_volume_attachment' in _dict: + args[ + 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( + _dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') + if 'primary_network_interface' in _dict: + args[ + 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( + _dict.get('primary_network_interface')) + if 'source_template' in _dict: + args['source_template'] = _dict.get('source_template') + else: + raise ValueError( + 'Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON' + ) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstancePrototypeInstanceBySourceTemplate 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, 'keys') and self.keys is not None: + keys_list = [] + for x in self.keys: + if isinstance(x, dict): + keys_list.append(x) + else: + keys_list.append(x.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr( + self, + 'network_interfaces') and self.network_interfaces is not None: + _dict['network_interfaces'] = [ + x.to_dict() for x in self.network_interfaces + ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr( + self, + 'volume_attachments') and self.volume_attachments is not None: + _dict['volume_attachments'] = [ + x.to_dict() for x in self.volume_attachments + ] + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'boot_volume_attachment' + ) and self.boot_volume_attachment is not None: + _dict[ + 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( + ) + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'primary_network_interface' + ) and self.primary_network_interface is not None: + _dict[ + 'primary_network_interface'] = self.primary_network_interface.to_dict( + ) + if hasattr(self, + 'source_template') and self.source_template is not None: + if isinstance(self.source_template, dict): + _dict['source_template'] = self.source_template + else: + _dict['source_template'] = self.source_template.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.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 InstancePrototypeInstanceBySourceTemplate object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, + other: 'InstancePrototypeInstanceBySourceTemplate') -> 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: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity): + """ + InstanceTemplateIdentityByCRN. + + :attr str crn: The CRN for this instance template. + """ + + def __init__(self, crn: str) -> None: + """ + Initialize a InstanceTemplateIdentityByCRN object. + + :param str crn: The CRN for this instance template. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN': + """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError( + 'Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplateIdentityByCRN 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 + 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 InstanceTemplateIdentityByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> 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: 'InstanceTemplateIdentityByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceTemplateIdentityByHref(InstanceTemplateIdentity): + """ + InstanceTemplateIdentityByHref. + + :attr str href: The URL for this instance template. + """ + + def __init__(self, href: str) -> None: + """ + Initialize a InstanceTemplateIdentityByHref object. + + :param str href: The URL for this instance template. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref': + """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceTemplateIdentityByHref JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplateIdentityByHref 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, 'href') and self.href is not None: + _dict['href'] = self.href + 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 InstanceTemplateIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> 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: 'InstanceTemplateIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceTemplateIdentityById(InstanceTemplateIdentity): + """ + InstanceTemplateIdentityById. + + :attr str id: The unique identifier for this instance template. + """ + + def __init__(self, id: str) -> None: + """ + Initialize a InstanceTemplateIdentityById object. + + :param str id: The unique identifier for this instance template. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityById': + """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in InstanceTemplateIdentityById JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplateIdentityById 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 InstanceTemplateIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplateIdentityById') -> 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: 'InstanceTemplateIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): + """ + InstanceTemplatePrototypeInstanceByImage. + + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless the + image used provides another means of access. For Windows instances, one of the + keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init vendor + data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + :attr str name: (optional) The unique user-defined name for this virtual server + instance (and default system hostname). If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection + of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The profile to use for this + virtual server instance. + :attr ResourceGroupIdentity resource_group: (optional) + :attr str user_data: (optional) User data to be made available when setting up + the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a + part of. If provided, must match the VPC tied to the subnets of the instance's + network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: The identity of the image to use when provisioning + the virtual server instance. + :attr NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + """ + + def __init__( + self, + image: 'ImageIdentity', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + keys: List['KeyIdentity'] = None, + name: str = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + user_data: str = None, + volume_attachments: List[ + 'VolumeAttachmentPrototypeInstanceContext'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: + 'VolumeAttachmentPrototypeInstanceByImageContext' = None + ) -> None: + """ + Initialize a InstanceTemplatePrototypeInstanceByImage object. + + :param ImageIdentity image: The identity of the image to use when + provisioning the virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless + the image used provides another means of access. For Windows instances, one + of the keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added + as SSH authorized keys for the administrative user. + :param str name: (optional) The unique user-defined name for this virtual + server instance (and default system hostname). If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) + Collection of additional network interfaces to create for the virtual + server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The profile to use for + this virtual server instance. + :param ResourceGroupIdentity resource_group: (optional) + :param str user_data: (optional) User data to be made available when + setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :param VPCIdentity vpc: (optional) The VPC the virtual server instance is + to be a part of. If provided, must match the VPC tied to the subnets of the + instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. + """ + # pylint: disable=super-init-not-called + self.keys = keys + self.name = name + self.network_interfaces = network_interfaces + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.primary_network_interface = primary_network_interface + self.zone = zone + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': + """Initialize a InstanceTemplatePrototypeInstanceByImage object from a json dictionary.""" + args = {} + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [ + NetworkInterfacePrototype.from_dict(x) + for x in _dict.get('network_interfaces') + ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [ + VolumeAttachmentPrototypeInstanceContext.from_dict(x) + for x in _dict.get('volume_attachments') + ] + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') + if 'boot_volume_attachment' in _dict: + args[ + 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( + _dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') + else: + raise ValueError( + 'Required property \'image\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + ) + if 'primary_network_interface' in _dict: + args[ + 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( + _dict.get('primary_network_interface')) + else: + raise ValueError( + 'Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + ) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError( + 'Required property \'zone\' not present in InstanceTemplatePrototypeInstanceByImage JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplatePrototypeInstanceByImage 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, 'keys') and self.keys is not None: + keys_list = [] + for x in self.keys: + if isinstance(x, dict): + keys_list.append(x) + else: + keys_list.append(x.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr( + self, + 'network_interfaces') and self.network_interfaces is not None: + _dict['network_interfaces'] = [ + x.to_dict() for x in self.network_interfaces + ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr( + self, + 'volume_attachments') and self.volume_attachments is not None: + _dict['volume_attachments'] = [ + x.to_dict() for x in self.volume_attachments + ] + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'boot_volume_attachment' + ) and self.boot_volume_attachment is not None: + _dict[ + 'boot_volume_attachment'] = self.boot_volume_attachment.to_dict( + ) + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'primary_network_interface' + ) and self.primary_network_interface is not None: + _dict[ + 'primary_network_interface'] = self.primary_network_interface.to_dict( + ) + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.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 InstanceTemplatePrototypeInstanceByImage object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceByImage') -> 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: 'InstanceTemplatePrototypeInstanceByImage') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceTemplatePrototypeInstanceBySourceTemplate( + InstanceTemplatePrototype): + """ + InstanceTemplatePrototypeInstanceBySourceTemplate. + + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless the + image used provides another means of access. For Windows instances, one of the + keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init vendor + data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + :attr str name: (optional) The unique user-defined name for this virtual server + instance (and default system hostname). If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection + of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The profile to use for this + virtual server instance. + :attr ResourceGroupIdentity resource_group: (optional) + :attr str user_data: (optional) User data to be made available when setting up + the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a + part of. If provided, must match the VPC tied to the subnets of the instance's + network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: (optional) The identity of the image to use when + provisioning the virtual server instance. + :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary + network interface. + :attr InstanceTemplateIdentity source_template: Identifies an instance template + by a unique property. + :attr ZoneIdentity zone: (optional) The zone this virtual server instance will + reside in. + """ + + def __init__(self, + source_template: 'InstanceTemplateIdentity', + *, + keys: List['KeyIdentity'] = None, + name: str = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + user_data: str = None, + volume_attachments: List[ + 'VolumeAttachmentPrototypeInstanceContext'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: + 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + image: 'ImageIdentity' = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, + zone: 'ZoneIdentity' = None) -> None: + """ + Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object. + + :param InstanceTemplateIdentity source_template: Identifies an instance + template by a unique property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Up to 10 keys may be + provided; if no keys are provided the instance will be inaccessible unless + the image used provides another means of access. For Windows instances, one + of the keys will be used to encrypt the administrator password. + Keys will be made available to the virtual server instance as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added + as SSH authorized keys for the administrative user. + :param str name: (optional) The unique user-defined name for this virtual + server instance (and default system hostname). If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) + Collection of additional network interfaces to create for the virtual + server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The profile to use for + this virtual server instance. + :param ResourceGroupIdentity resource_group: (optional) + :param str user_data: (optional) User data to be made available when + setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) Collection of volume attachments. + :param VPCIdentity vpc: (optional) The VPC the virtual server instance is + to be a part of. If provided, must match the VPC tied to the subnets of the + instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. + :param ImageIdentity image: (optional) The identity of the image to use + when provisioning the virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: (optional) + Primary network interface. + :param ZoneIdentity zone: (optional) The zone this virtual server instance + will reside in. + """ + # pylint: disable=super-init-not-called + self.keys = keys + self.name = name + self.network_interfaces = network_interfaces + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.primary_network_interface = primary_network_interface + self.source_template = source_template + self.zone = zone + + @classmethod + def from_dict( + cls, + _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTemplate': + """Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object from a json dictionary.""" + args = {} + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [ + NetworkInterfacePrototype.from_dict(x) + for x in _dict.get('network_interfaces') + ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [ + VolumeAttachmentPrototypeInstanceContext.from_dict(x) + for x in _dict.get('volume_attachments') + ] + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') + if 'boot_volume_attachment' in _dict: + args[ + 'boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( + _dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') + if 'primary_network_interface' in _dict: + args[ + 'primary_network_interface'] = NetworkInterfacePrototype.from_dict( + _dict.get('primary_network_interface')) + if 'source_template' in _dict: + args['source_template'] = _dict.get('source_template') + else: + raise ValueError( + 'Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceBySourceTemplate JSON' ) if 'zone' in _dict: args['zone'] = _dict.get('zone') @@ -52732,6 +58043,12 @@ def to_dict(self) -> Dict: _dict['network_interfaces'] = [ x.to_dict() for x in self.network_interfaces ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() if hasattr(self, 'profile') and self.profile is not None: if isinstance(self.profile, dict): _dict['profile'] = self.profile @@ -52826,6 +58143,8 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this @@ -52860,6 +58179,7 @@ def __init__( *, keys: List['KeyIdentity'] = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, user_data: str = None, volume_attachments: List[ @@ -52896,6 +58216,8 @@ def __init__( :param List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :param str user_data: (optional) User data to be made available when @@ -52917,6 +58239,7 @@ def __init__( self.keys = keys self.name = name self.network_interfaces = network_interfaces + self.placement_target = placement_target self.profile = profile self.resource_group = resource_group self.user_data = user_data @@ -52968,6 +58291,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces') ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: args['profile'] = _dict.get('profile') if 'resource_group' in _dict: @@ -53044,6 +58369,12 @@ def to_dict(self) -> Dict: _dict['network_interfaces'] = [ x.to_dict() for x in self.network_interfaces ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() if hasattr(self, 'profile') and self.profile is not None: if isinstance(self.profile, dict): _dict['profile'] = self.profile @@ -53125,6 +58456,8 @@ class InstanceTemplateInstanceBySourceTemplate(InstanceTemplate): :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :attr ResourceGroupReference resource_group: The resource group for this @@ -53159,6 +58492,7 @@ def __init__(self, *, keys: List['KeyIdentity'] = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, user_data: str = None, volume_attachments: List[ @@ -53193,6 +58527,8 @@ def __init__(self, :param List[NetworkInterfacePrototype] network_interfaces: (optional) Collection of additional network interfaces to create for the virtual server instance. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for this virtual server instance. :param str user_data: (optional) User data to be made available when @@ -53220,6 +58556,7 @@ def __init__(self, self.keys = keys self.name = name self.network_interfaces = network_interfaces + self.placement_target = placement_target self.profile = profile self.resource_group = resource_group self.user_data = user_data @@ -53273,6 +58610,8 @@ def from_dict(cls, NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces') ] + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: args['profile'] = _dict.get('profile') if 'resource_group' in _dict: @@ -53343,6 +58682,12 @@ def to_dict(self) -> Dict: _dict['network_interfaces'] = [ x.to_dict() for x in self.network_interfaces ] + if hasattr(self, + 'placement_target') and self.placement_target is not None: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() if hasattr(self, 'profile') and self.profile is not None: if isinstance(self.profile, dict): _dict['profile'] = self.profile @@ -57601,7 +62946,476 @@ def __init__(self, *, before: 'NetworkACLRuleReference' = None) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object. + Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object. + + :param str action: Whether to allow or deny matching traffic. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination CIDR block. The CIDR block + `0.0.0.0/0` applies to all addresses. + :param str direction: Whether the traffic to be matched is `inbound` or + `outbound`. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The user-defined name for this rule. Names must be unique + within the network ACL the rule resides in. If unspecified, the name will + be a hyphenated list of randomly-selected words. + :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` + applies to all addresses. + :param str protocol: The protocol to enforce. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. + """ + # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version + self.name = name + self.source = source + self.protocol = protocol + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" + args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError( + 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict( + _dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError( + 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError( + 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError( + 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError( + 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError( + 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll 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, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + 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 NetworkACLRuleNetworkACLRuleProtocolAll object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> 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: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ActionEnum(str, Enum): + """ + Whether to allow or deny matching traffic. + """ + ALLOW = 'allow' + DENY = 'deny' + + class DirectionEnum(str, Enum): + """ + Whether the traffic to be matched is `inbound` or `outbound`. + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + IPV4 = 'ipv4' + IPV6 = 'ipv6' + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + + +class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): + """ + NetworkACLRuleNetworkACLRuleProtocolICMP. + + :attr str action: Whether to allow or deny matching traffic. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` + applies to all addresses. + :attr str direction: Whether the traffic to be matched is `inbound` or + `outbound`. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The user-defined name for this rule. Names must be unique within + the network ACL the rule resides in. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to + all addresses. + :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all + codes are allowed. This can only be specified if type is also specified. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all + types are allowed by this rule. + """ + + def __init__(self, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleReference' = None, + code: int = None, + type: int = None) -> None: + """ + Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object. + + :param str action: Whether to allow or deny matching traffic. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination CIDR block. The CIDR block + `0.0.0.0/0` applies to all addresses. + :param str direction: Whether the traffic to be matched is `inbound` or + `outbound`. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The user-defined name for this rule. Names must be unique + within the network ACL the rule resides in. If unspecified, the name will + be a hyphenated list of randomly-selected words. + :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` + applies to all addresses. + :param str protocol: The protocol to enforce. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. + :param int code: (optional) The ICMP traffic code to allow. If unspecified, + all codes are allowed. This can only be specified if type is also + specified. + :param int type: (optional) The ICMP traffic type to allow. If unspecified, + all types are allowed by this rule. + """ + # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version + self.name = name + self.source = source + self.code = code + self.protocol = protocol + self.type = type + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" + args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError( + 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict( + _dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError( + 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError( + 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError( + 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError( + 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError( + 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + ) + if 'type' in _dict: + args['type'] = _dict.get('type') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP 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, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + 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 NetworkACLRuleNetworkACLRuleProtocolICMP object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> 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: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ActionEnum(str, Enum): + """ + Whether to allow or deny matching traffic. + """ + ALLOW = 'allow' + DENY = 'deny' + + class DirectionEnum(str, Enum): + """ + Whether the traffic to be matched is `inbound` or `outbound`. + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + IPV4 = 'ipv4' + IPV6 = 'ipv6' + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ICMP = 'icmp' + + +class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): + """ + NetworkACLRuleNetworkACLRuleProtocolTCPUDP. + + :attr str action: Whether to allow or deny matching traffic. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` + applies to all addresses. + :attr str direction: Whether the traffic to be matched is `inbound` or + `outbound`. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The user-defined name for this rule. Names must be unique within + the network ACL the rule resides in. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to + all addresses. + :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP + destination port range. + :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range. + :attr str protocol: The protocol to enforce. + :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. + """ + + def __init__(self, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleReference' = None, + destination_port_max: int = None, + destination_port_min: int = None, + source_port_max: int = None, + source_port_min: int = None) -> None: + """ + Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object. :param str action: Whether to allow or deny matching traffic. :param datetime created_at: The date and time that the rule was created. @@ -57620,6 +63434,14 @@ def __init__(self, :param str protocol: The protocol to enforce. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. + :param int destination_port_max: (optional) The inclusive upper bound of + TCP/UDP destination port range. + :param int destination_port_min: (optional) The inclusive lower bound of + TCP/UDP destination port range. + :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. """ # pylint: disable=super-init-not-called self.action = action @@ -57632,18 +63454,22 @@ def __init__(self, self.ip_version = ip_version self.name = name self.source = source + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min self.protocol = protocol + self.source_port_max = source_port_max + self.source_port_min = source_port_min @classmethod def from_dict(cls, - _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" + _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: raise ValueError( - 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'before' in _dict: args['before'] = NetworkACLRuleReference.from_dict( @@ -57652,61 +63478,69 @@ def from_dict(cls, args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError( - 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'destination' in _dict: args['destination'] = _dict.get('destination') else: raise ValueError( - 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'direction' in _dict: args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') else: raise ValueError( - 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) if 'source' in _dict: args['source'] = _dict.get('source') else: raise ValueError( - 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError( - 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON' + 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' ) + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" + """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -57732,8 +63566,20 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'source') and self.source is not None: _dict['source'] = self.source + if hasattr(self, 'destination_port_max' + ) and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min' + ) and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min if hasattr(self, 'protocol') and self.protocol is not None: _dict['protocol'] = self.protocol + if hasattr(self, + 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, + 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -57741,16 +63587,18 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolAll object.""" + """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: + def __eq__(self, + other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> 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: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: + def __ne__(self, + other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -57779,200 +63627,537 @@ class ProtocolEnum(str, Enum): """ The protocol to enforce. """ - ALL = 'all' + TCP = 'tcp' + UDP = 'udp' -class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): +class OperatingSystemIdentityByHref(OperatingSystemIdentity): """ - NetworkACLRuleNetworkACLRuleProtocolICMP. + OperatingSystemIdentityByHref. - :attr str action: Whether to allow or deny matching traffic. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all - codes are allowed. This can only be specified if type is also specified. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all - types are allowed by this rule. + :attr str href: The URL for this operating system. + """ + + def __init__(self, href: str) -> None: + """ + Initialize a OperatingSystemIdentityByHref object. + + :param str href: The URL for this operating system. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref': + """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in OperatingSystemIdentityByHref JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a OperatingSystemIdentityByHref 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, 'href') and self.href is not None: + _dict['href'] = self.href + 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 OperatingSystemIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'OperatingSystemIdentityByHref') -> 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: 'OperatingSystemIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class OperatingSystemIdentityByName(OperatingSystemIdentity): + """ + OperatingSystemIdentityByName. + + :attr str name: The globally unique name for this operating system. + """ + + def __init__(self, name: str) -> None: + """ + Initialize a OperatingSystemIdentityByName object. + + :param str name: The globally unique name for this operating system. + """ + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName': + """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in OperatingSystemIdentityByName JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a OperatingSystemIdentityByName 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 + 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 OperatingSystemIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'OperatingSystemIdentityByName') -> 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: 'OperatingSystemIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PublicGatewayFloatingIPPrototypeFloatingIPIdentity( + PublicGatewayFloatingIPPrototype): + """ + Identifies a floating IP by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', + 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', + 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', + 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress' + ])) + raise Exception(msg) + + +class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext( + PublicGatewayFloatingIPPrototype): + """ + PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext. + + :attr str name: (optional) The unique user-defined name for this floating IP. If + unspecified, the name will be a hyphenated list of randomly-selected words. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + """ + + def __init__(self, + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None) -> None: + """ + Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object. + + :param str name: (optional) The unique user-defined name for this floating + IP. If unspecified, the name will be a hyphenated list of randomly-selected + words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + """ + # pylint: disable=super-init-not-called + self.name = name + self.resource_group = resource_group + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext': + """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.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 PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext' + ) -> 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: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PublicGatewayIdentityByCRN(PublicGatewayIdentity): + """ + PublicGatewayIdentityByCRN. + + :attr str crn: The CRN for this public gateway. + """ + + def __init__(self, crn: str) -> None: + """ + Initialize a PublicGatewayIdentityByCRN object. + + :param str crn: The CRN for this public gateway. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByCRN': + """Initialize a PublicGatewayIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError( + 'Required property \'crn\' not present in PublicGatewayIdentityByCRN JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayIdentityByCRN 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 + 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 PublicGatewayIdentityByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PublicGatewayIdentityByCRN') -> 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: 'PublicGatewayIdentityByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PublicGatewayIdentityByHref(PublicGatewayIdentity): + """ + PublicGatewayIdentityByHref. + + :attr str href: The URL for this public gateway. + """ + + def __init__(self, href: str) -> None: + """ + Initialize a PublicGatewayIdentityByHref object. + + :param str href: The URL for this public gateway. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByHref': + """Initialize a PublicGatewayIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in PublicGatewayIdentityByHref JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayIdentityByHref 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, 'href') and self.href is not None: + _dict['href'] = self.href + 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 PublicGatewayIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PublicGatewayIdentityByHref') -> 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: 'PublicGatewayIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PublicGatewayIdentityById(PublicGatewayIdentity): + """ + PublicGatewayIdentityById. + + :attr str id: The unique identifier for this public gateway. + """ + + def __init__(self, id: str) -> None: + """ + Initialize a PublicGatewayIdentityById object. + + :param str id: The unique identifier for this public gateway. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityById': + """Initialize a PublicGatewayIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in PublicGatewayIdentityById JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayIdentityById 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 PublicGatewayIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PublicGatewayIdentityById') -> 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: 'PublicGatewayIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype + ): + """ + ReservedIPTargetPrototypeEndpointGatewayIdentity. + + """ + + def __init__(self) -> None: + """ + Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', + 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', + 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref' + ])) + raise Exception(msg) + + +class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): + """ + ReservedIPTargetEndpointGatewayReference. + + :attr str crn: The CRN for this endpoint gateway. + :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The URL for this endpoint gateway. + :attr str id: The unique identifier for this endpoint gateway. + :attr str name: The unique user-defined name for this endpoint gateway. + :attr str resource_type: The type of resource referenced. """ def __init__(self, - action: str, - created_at: datetime, - destination: str, - direction: str, + crn: str, href: str, id: str, - ip_version: str, name: str, - source: str, - protocol: str, + resource_type: str, *, - before: 'NetworkACLRuleReference' = None, - code: int = None, - type: int = None) -> None: + deleted: 'EndpointGatewayReferenceDeleted' = None) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object. + Initialize a ReservedIPTargetEndpointGatewayReference object. - :param str action: Whether to allow or deny matching traffic. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :param str protocol: The protocol to enforce. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. - :param int code: (optional) The ICMP traffic code to allow. If unspecified, - all codes are allowed. This can only be specified if type is also - specified. - :param int type: (optional) The ICMP traffic type to allow. If unspecified, - all types are allowed by this rule. + :param str crn: The CRN for this endpoint gateway. + :param str href: The URL for this endpoint gateway. + :param str id: The unique identifier for this endpoint gateway. + :param str name: The unique user-defined name for this endpoint gateway. + :param str resource_type: The type of resource referenced. + :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction + self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.ip_version = ip_version self.name = name - self.source = source - self.code = code - self.protocol = protocol - self.type = type + self.resource_type = resource_type @classmethod def from_dict(cls, - _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" + _dict: Dict) -> 'ReservedIPTargetEndpointGatewayReference': + """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError( - 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' - ) - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict( - _dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError( - 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' - ) - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError( - 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' - ) - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + 'Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON' ) + if 'deleted' in _dict: + args['deleted'] = EndpointGatewayReferenceDeleted.from_dict( + _dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + 'Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON' ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' - ) - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError( - 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + 'Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON' ) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' - ) - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError( - 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + 'Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON' ) - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: raise ValueError( - 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON' + 'Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON' ) - if 'type' in _dict: - args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" + """Initialize a ReservedIPTargetEndpointGatewayReference 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, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -57980,261 +64165,331 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolICMP object.""" + """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: + def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> 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: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: + def __ne__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The type of resource referenced. """ - ALLOW = 'allow' - DENY = 'deny' + ENDPOINT_GATEWAY = 'endpoint_gateway' - class DirectionEnum(str, Enum): - """ - Whether the traffic to be matched is `inbound` or `outbound`. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - IPV4 = 'ipv4' - IPV6 = 'ipv6' +class ResourceGroupIdentityById(ResourceGroupIdentity): + """ + ResourceGroupIdentityById. - class ProtocolEnum(str, Enum): + :attr str id: The unique identifier for this resource group. + """ + + def __init__(self, id: str) -> None: """ - The protocol to enforce. + Initialize a ResourceGroupIdentityById object. + + :param str id: The unique identifier for this resource group. """ - ICMP = 'icmp' + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById': + """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in ResourceGroupIdentityById JSON' + ) + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + return cls.from_dict(_dict) -class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): + 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 ResourceGroupIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceGroupIdentityById') -> 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: 'ResourceGroupIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RouteNextHopIP(RouteNextHop): """ - NetworkACLRuleNetworkACLRuleProtocolTCPUDP. + RouteNextHopIP. - :attr str action: Whether to allow or deny matching traffic. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. - :attr str protocol: The protocol to enforce. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :attr str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify that + the address is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected IP address format was encountered. """ - def __init__(self, - action: str, - created_at: datetime, - destination: str, - direction: str, - href: str, - id: str, - ip_version: str, - name: str, - source: str, - protocol: str, - *, - before: 'NetworkACLRuleReference' = None, - destination_port_max: int = None, - destination_port_min: int = None, - source_port_max: int = None, - source_port_min: int = None) -> None: + def __init__(self, address: str) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object. + Initialize a RouteNextHopIP object. - :param str action: Whether to allow or deny matching traffic. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :param str protocol: The protocol to enforce. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. - :param int destination_port_max: (optional) The inclusive upper bound of - TCP/UDP destination port range. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :param str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify + that the address is in an expected format. If it is not, log an error. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected IP address format was encountered. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.name = name - self.source = source - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.protocol = protocol - self.source_port_max = source_port_max - self.source_port_min = source_port_min + self.address = address @classmethod - def from_dict(cls, - _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP': + """Initialize a RouteNextHopIP object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError( - 'Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' - ) - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict( - _dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError( - 'Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' - ) - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + if 'address' in _dict: + args['address'] = _dict.get('address') else: raise ValueError( - 'Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'address\' not present in RouteNextHopIP JSON' ) - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RouteNextHopIP 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, 'address') and self.address is not None: + _dict['address'] = self.address + 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 RouteNextHopIP object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RouteNextHopIP') -> 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: 'RouteNextHopIP') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RouteNextHopPrototypeRouteNextHopIP(RouteNextHopPrototype): + """ + The IP address of the next hop to which to route packets. + + :attr str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify that + the address is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected IP address format was encountered. + """ + + def __init__(self, address: str) -> None: + """ + Initialize a RouteNextHopPrototypeRouteNextHopIP object. + + :param str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify + that the address is in an expected format. If it is not, log an error. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected IP address format was encountered. + """ + # pylint: disable=super-init-not-called + self.address = address + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RouteNextHopPrototypeRouteNextHopIP': + """Initialize a RouteNextHopPrototypeRouteNextHopIP object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') else: raise ValueError( - 'Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'address\' not present in RouteNextHopPrototypeRouteNextHopIP JSON' ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RouteNextHopPrototypeRouteNextHopIP 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, 'address') and self.address is not None: + _dict['address'] = self.address + 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 RouteNextHopPrototypeRouteNextHopIP object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RouteNextHopPrototypeRouteNextHopIP') -> 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: 'RouteNextHopPrototypeRouteNextHopIP') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RouteNextHopPrototypeVPNGatewayConnectionIdentity(RouteNextHopPrototype): + """ + Identifies a VPN gateway connection by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a RouteNextHopPrototypeVPNGatewayConnectionIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', + 'RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref' + ])) + raise Exception(msg) + + +class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): + """ + RouteNextHopVPNGatewayConnectionReference. + + :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :attr str name: The user-defined name for this VPN connection. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'VPNGatewayConnectionReferenceDeleted' = None) -> None: + """ + Initialize a RouteNextHopVPNGatewayConnectionReference object. + + :param str href: The VPN connection's canonical URL. + :param str id: The unique identifier for this VPN gateway connection. + :param str name: The user-defined name for this VPN connection. + :param str resource_type: The resource type. + :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted and + provides + some supplementary information. + """ + # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, + _dict: Dict) -> 'RouteNextHopVPNGatewayConnectionReference': + """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict( + _dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON' ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' - ) - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError( - 'Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON' ) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' - ) - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError( - 'Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON' ) - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: raise ValueError( - 'Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON' + 'Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON' ) - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a RouteNextHopVPNGatewayConnectionReference 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, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'destination_port_max' - ) and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min' - ) and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, - 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, - 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -58242,81 +64497,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.""" + """Return a `str` version of this RouteNextHopVPNGatewayConnectionReference object.""" return json.dumps(self.to_dict(), indent=2) def __eq__(self, - other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: + other: 'RouteNextHopVPNGatewayConnectionReference') -> 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: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: + other: 'RouteNextHopVPNGatewayConnectionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - Whether to allow or deny matching traffic. - """ - ALLOW = 'allow' - DENY = 'deny' - - class DirectionEnum(str, Enum): - """ - Whether the traffic to be matched is `inbound` or `outbound`. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - IPV4 = 'ipv4' - IPV6 = 'ipv6' - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - TCP = 'tcp' - UDP = 'udp' + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' -class OperatingSystemIdentityByHref(OperatingSystemIdentity): +class RoutingTableIdentityByHref(RoutingTableIdentity): """ - OperatingSystemIdentityByHref. + RoutingTableIdentityByHref. - :attr str href: The URL for this operating system. + :attr str href: The URL for this routing table. """ def __init__(self, href: str) -> None: """ - Initialize a OperatingSystemIdentityByHref object. + Initialize a RoutingTableIdentityByHref object. - :param str href: The URL for this operating system. + :param str href: The URL for this routing table. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref': - """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref': + """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in OperatingSystemIdentityByHref JSON' + 'Required property \'href\' not present in RoutingTableIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" + """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -58331,58 +64564,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemIdentityByHref object.""" + """Return a `str` version of this RoutingTableIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemIdentityByHref') -> bool: + def __eq__(self, other: 'RoutingTableIdentityByHref') -> 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: 'OperatingSystemIdentityByHref') -> bool: + def __ne__(self, other: 'RoutingTableIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemIdentityByName(OperatingSystemIdentity): +class RoutingTableIdentityById(RoutingTableIdentity): """ - OperatingSystemIdentityByName. + RoutingTableIdentityById. - :attr str name: The globally unique name for this operating system. + :attr str id: The unique identifier for this routing table. """ - def __init__(self, name: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a OperatingSystemIdentityByName object. + Initialize a RoutingTableIdentityById object. - :param str name: The globally unique name for this operating system. + :param str id: The unique identifier for this routing table. """ # pylint: disable=super-init-not-called - self.name = name + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName': - """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById': + """Initialize a RoutingTableIdentityById object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'name\' not present in OperatingSystemIdentityByName JSON' + 'Required property \'id\' not present in RoutingTableIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" + """Initialize a RoutingTableIdentityById 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, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -58390,101 +64623,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemIdentityByName object.""" + """Return a `str` version of this RoutingTableIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemIdentityByName') -> bool: + def __eq__(self, other: 'RoutingTableIdentityById') -> 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: 'OperatingSystemIdentityByName') -> bool: + def __ne__(self, other: 'RoutingTableIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayFloatingIPPrototypeFloatingIPIdentity( - PublicGatewayFloatingIPPrototype): - """ - Identifies a floating IP by a unique property. - - """ - - def __init__(self) -> None: - """ - Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', - 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', - 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', - 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress' - ])) - raise Exception(msg) - - -class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext( - PublicGatewayFloatingIPPrototype): +class SecurityGroupIdentityByCRN(SecurityGroupIdentity): """ - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext. + SecurityGroupIdentityByCRN. - :attr str name: (optional) The unique user-defined name for this floating IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr str crn: The security group's CRN. """ - def __init__(self, - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object. + Initialize a SecurityGroupIdentityByCRN object. - :param str name: (optional) The unique user-defined name for this floating - IP. If unspecified, the name will be a hyphenated list of randomly-selected - words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + :param str crn: The security group's CRN. """ # pylint: disable=super-init-not-called - self.name = name - self.resource_group = resource_group + self.crn = crn @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext': - """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN': + """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError( + 'Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON' + ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" + """Initialize a SecurityGroupIdentityByCRN 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -58492,64 +64682,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.""" + """Return a `str` version of this SecurityGroupIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext' - ) -> bool: + def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> 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: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext' - ) -> bool: + def __ne__(self, other: 'SecurityGroupIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityByCRN(PublicGatewayIdentity): +class SecurityGroupIdentityByHref(SecurityGroupIdentity): """ - PublicGatewayIdentityByCRN. + SecurityGroupIdentityByHref. - :attr str crn: The CRN for this public gateway. + :attr str href: The security group's canonical URL. """ - def __init__(self, crn: str) -> None: + def __init__(self, href: str) -> None: """ - Initialize a PublicGatewayIdentityByCRN object. + Initialize a SecurityGroupIdentityByHref object. - :param str crn: The CRN for this public gateway. + :param str href: The security group's canonical URL. """ # pylint: disable=super-init-not-called - self.crn = crn + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByCRN': - """Initialize a PublicGatewayIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref': + """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'crn\' not present in PublicGatewayIdentityByCRN JSON' + 'Required property \'href\' not present in SecurityGroupIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityByCRN object from a json dictionary.""" + """Initialize a SecurityGroupIdentityByHref 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, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -58557,58 +64741,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityByCRN object.""" + """Return a `str` version of this SecurityGroupIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityByCRN') -> bool: + def __eq__(self, other: 'SecurityGroupIdentityByHref') -> 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: 'PublicGatewayIdentityByCRN') -> bool: + def __ne__(self, other: 'SecurityGroupIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityByHref(PublicGatewayIdentity): +class SecurityGroupIdentityById(SecurityGroupIdentity): """ - PublicGatewayIdentityByHref. + SecurityGroupIdentityById. - :attr str href: The URL for this public gateway. + :attr str id: The unique identifier for this security group. """ - def __init__(self, href: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a PublicGatewayIdentityByHref object. + Initialize a SecurityGroupIdentityById object. - :param str href: The URL for this public gateway. + :param str id: The unique identifier for this security group. """ # pylint: disable=super-init-not-called - self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByHref': - """Initialize a PublicGatewayIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById': + """Initialize a SecurityGroupIdentityById object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'href\' not present in PublicGatewayIdentityByHref JSON' + 'Required property \'id\' not present in SecurityGroupIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupIdentityById 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -58616,58 +64800,106 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityByHref object.""" + """Return a `str` version of this SecurityGroupIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupIdentityById') -> 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: 'PublicGatewayIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityById(PublicGatewayIdentity): +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll( + SecurityGroupRulePrototype): """ - PublicGatewayIdentityById. + When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` + or + `code`. - :attr str id: The unique identifier for this public gateway. + :attr str direction: The direction of traffic to enforce, either `inbound` or + `outbound`. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr str protocol: The protocol to enforce. """ - def __init__(self, id: str) -> None: + def __init__(self, + direction: str, + protocol: str, + *, + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None) -> None: """ - Initialize a PublicGatewayIdentityById object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object. - :param str id: The unique identifier for this public gateway. + :param str direction: The direction of traffic to enforce, either `inbound` + or `outbound`. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are + used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) """ # pylint: disable=super-init-not-called - self.id = id + self.direction = direction + self.ip_version = ip_version + self.remote = remote + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityById': - """Initialize a PublicGatewayIdentityById object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'id\' not present in PublicGatewayIdentityById JSON' + 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON' + ) + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError( + 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -58675,144 +64907,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityById object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityById') -> bool: + def __eq__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' + ) -> 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: 'PublicGatewayIdentityById') -> bool: + def __ne__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce, either `inbound` or `outbound`. + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' -class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype - ): - """ - ReservedIPTargetPrototypeEndpointGatewayIdentity. - - """ - - def __init__(self) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object. + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this field, if they are used. Alternatively, if `remote` references a + security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + IPV4 = 'ipv4' + class ProtocolEnum(str, Enum): """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', - 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', - 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref' - ])) - raise Exception(msg) + The protocol to enforce. + """ + ALL = 'all' -class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP( + SecurityGroupRulePrototype): """ - ReservedIPTargetEndpointGatewayReference. + When `protocol` is `icmp`, then the rule may also contain fields to specify an ICMP + `type` and `code`. Field `code` may only be specified if `type` is also specified. If + type is not specified, then traffic is allowed for all types and codes. If type is + specified and code is not specified, then traffic is allowed with the specified type + for all codes. - :attr str crn: The CRN for this endpoint gateway. - :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str href: The URL for this endpoint gateway. - :attr str id: The unique identifier for this endpoint gateway. - :attr str name: The unique user-defined name for this endpoint gateway. - :attr str resource_type: The type of resource referenced. + :attr str direction: The direction of traffic to enforce, either `inbound` or + `outbound`. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr int code: (optional) The ICMP traffic code to allow. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to allow. """ def __init__(self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, + direction: str, + protocol: str, *, - deleted: 'EndpointGatewayReferenceDeleted' = None) -> None: + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, + code: int = None, + type: int = None) -> None: """ - Initialize a ReservedIPTargetEndpointGatewayReference object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. - :param str crn: The CRN for this endpoint gateway. - :param str href: The URL for this endpoint gateway. - :param str id: The unique identifier for this endpoint gateway. - :param str name: The unique user-defined name for this endpoint gateway. - :param str resource_type: The type of resource referenced. - :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. + :param str direction: The direction of traffic to enforce, either `inbound` + or `outbound`. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are + used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) + :param int code: (optional) The ICMP traffic code to allow. + :param int type: (optional) The ICMP traffic type to allow. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.direction = direction + self.ip_version = ip_version + self.remote = remote + self.code = code + self.protocol = protocol + self.type = type @classmethod - def from_dict(cls, - _dict: Dict) -> 'ReservedIPTargetEndpointGatewayReference': - """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError( - 'Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON' - ) - if 'deleted' in _dict: - args['deleted'] = EndpointGatewayReferenceDeleted.from_dict( - _dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON' + 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON' ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') else: raise ValueError( - 'Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON' + 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON' ) + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP 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, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -58820,64 +65058,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: + def __eq__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' + ) -> 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: 'ReservedIPTargetEndpointGatewayReference') -> bool: + def __ne__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class DirectionEnum(str, Enum): """ - The type of resource referenced. + The direction of traffic to enforce, either `inbound` or `outbound`. """ - ENDPOINT_GATEWAY = 'endpoint_gateway' + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this field, if they are used. Alternatively, if `remote` references a + security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + IPV4 = 'ipv4' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ICMP = 'icmp' -class ResourceGroupIdentityById(ResourceGroupIdentity): + +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP( + SecurityGroupRulePrototype): """ - ResourceGroupIdentityById. + If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and + `port_max`. Either both must be set, or neither. When neither is set then traffic is + allowed on all ports. For a single port, set both to the same value. - :attr str id: The unique identifier for this resource group. + :attr str direction: The direction of traffic to enforce, either `inbound` or + `outbound`. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. + :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. + :attr str protocol: The protocol to enforce. """ - def __init__(self, id: str) -> None: + def __init__(self, + direction: str, + protocol: str, + *, + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, + port_max: int = None, + port_min: int = None) -> None: """ - Initialize a ResourceGroupIdentityById object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. - :param str id: The unique identifier for this resource group. + :param str direction: The direction of traffic to enforce, either `inbound` + or `outbound`. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this field, if they are + used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) + :param int port_max: (optional) The inclusive upper bound of TCP/UDP port + range. + :param int port_min: (optional) The inclusive lower bound of TCP/UDP port + range. """ # pylint: disable=super-init-not-called - self.id = id + self.direction = direction + self.ip_version = ip_version + self.remote = remote + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById': - """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'id\' not present in ResourceGroupIdentityById JSON' + 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON' + ) + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError( + 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP 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, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'port_max') and self.port_max is not None: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -58885,66 +65209,93 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupIdentityById object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupIdentityById') -> bool: + def __eq__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' + ) -> 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: 'ResourceGroupIdentityById') -> bool: + def __ne__( + self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce, either `inbound` or `outbound`. + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' -class RouteNextHopIP(RouteNextHop): + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this field, if they are used. Alternatively, if `remote` references a + security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + IPV4 = 'ipv4' + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + TCP = 'tcp' + UDP = 'udp' + + +class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch): """ - RouteNextHopIP. + SecurityGroupRuleRemotePatchCIDR. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + unexpected CIDR block format was encountered. """ - def __init__(self, address: str) -> None: + def __init__(self, cidr_block: str) -> None: """ - Initialize a RouteNextHopIP object. + Initialize a SecurityGroupRuleRemotePatchCIDR object. - :param str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify - that the address is in an expected format. If it is not, log an error. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected IP address format was encountered. + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. """ # pylint: disable=super-init-not-called - self.address = address + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP': - """Initialize a RouteNextHopIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR': + """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: raise ValueError( - 'Required property \'address\' not present in RouteNextHopIP JSON' + 'Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteNextHopIP object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePatchCIDR 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, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -58952,23 +65303,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteNextHopIP object.""" + """Return a `str` version of this SecurityGroupRuleRemotePatchCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteNextHopIP') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> 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: 'RouteNextHopIP') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteNextHopPrototypeRouteNextHopIP(RouteNextHopPrototype): +class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch): """ - The IP address of the next hop to which to route packets. + SecurityGroupRuleRemotePatchIP. :attr str address: The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that @@ -58979,7 +65330,7 @@ class RouteNextHopPrototypeRouteNextHopIP(RouteNextHopPrototype): def __init__(self, address: str) -> None: """ - Initialize a RouteNextHopPrototypeRouteNextHopIP object. + Initialize a SecurityGroupRuleRemotePatchIP object. :param str address: The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify @@ -58991,20 +65342,20 @@ def __init__(self, address: str) -> None: self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteNextHopPrototypeRouteNextHopIP': - """Initialize a RouteNextHopPrototypeRouteNextHopIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP': + """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" args = {} if 'address' in _dict: args['address'] = _dict.get('address') else: raise ValueError( - 'Required property \'address\' not present in RouteNextHopPrototypeRouteNextHopIP JSON' + 'Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteNextHopPrototypeRouteNextHopIP object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59019,199 +65370,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteNextHopPrototypeRouteNextHopIP object.""" + """Return a `str` version of this SecurityGroupRuleRemotePatchIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteNextHopPrototypeRouteNextHopIP') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> 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: 'RouteNextHopPrototypeRouteNextHopIP') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteNextHopPrototypeVPNGatewayConnectionIdentity(RouteNextHopPrototype): +class SecurityGroupRuleRemotePatchSecurityGroupIdentity( + SecurityGroupRuleRemotePatch): """ - Identifies a VPN gateway connection by a unique property. + Identifies a security group by a unique property. """ def __init__(self) -> None: """ - Initialize a RouteNextHopPrototypeVPNGatewayConnectionIdentity object. + Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join([ - 'RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', - 'RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref' + 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', + 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', + 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref' ])) raise Exception(msg) -class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): - """ - RouteNextHopVPNGatewayConnectionReference. - - :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :attr str name: The user-defined name for this VPN connection. - :attr str resource_type: The resource type. - """ - - def __init__( - self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPNGatewayConnectionReferenceDeleted' = None) -> None: - """ - Initialize a RouteNextHopVPNGatewayConnectionReference object. - - :param str href: The VPN connection's canonical URL. - :param str id: The unique identifier for this VPN gateway connection. - :param str name: The user-defined name for this VPN connection. - :param str resource_type: The resource type. - :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and - provides - some supplementary information. - """ - # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type - - @classmethod - def from_dict(cls, - _dict: Dict) -> 'RouteNextHopVPNGatewayConnectionReference': - """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" - args = {} - if 'deleted' in _dict: - args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict( - _dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError( - 'Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON' - ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON' - ) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteNextHopVPNGatewayConnectionReference 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, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_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 RouteNextHopVPNGatewayConnectionReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, - other: 'RouteNextHopVPNGatewayConnectionReference') -> 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: 'RouteNextHopVPNGatewayConnectionReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' - - -class RoutingTableIdentityByHref(RoutingTableIdentity): +class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype): """ - RoutingTableIdentityByHref. + SecurityGroupRuleRemotePrototypeCIDR. - :attr str href: The URL for this routing table. + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected CIDR block format was encountered. """ - def __init__(self, href: str) -> None: + def __init__(self, cidr_block: str) -> None: """ - Initialize a RoutingTableIdentityByHref object. + Initialize a SecurityGroupRuleRemotePrototypeCIDR object. - :param str href: The URL for this routing table. + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. """ # pylint: disable=super-init-not-called - self.href = href + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref': - """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR': + """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: raise ValueError( - 'Required property \'href\' not present in RoutingTableIdentityByHref JSON' + 'Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePrototypeCIDR 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, 'href') and self.href is not None: - _dict['href'] = self.href + _dict = {} + if hasattr(self, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -59219,58 +65459,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableIdentityByHref object.""" + """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> 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: 'RoutingTableIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutingTableIdentityById(RoutingTableIdentity): +class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype): """ - RoutingTableIdentityById. + SecurityGroupRuleRemotePrototypeIP. - :attr str id: The unique identifier for this routing table. + :attr str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify that + the address is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected IP address format was encountered. """ - def __init__(self, id: str) -> None: + def __init__(self, address: str) -> None: """ - Initialize a RoutingTableIdentityById object. + Initialize a SecurityGroupRuleRemotePrototypeIP object. - :param str id: The unique identifier for this routing table. + :param str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify + that the address is in an expected format. If it is not, log an error. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected IP address format was encountered. """ # pylint: disable=super-init-not-called - self.id = id + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById': - """Initialize a RoutingTableIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP': + """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'address' in _dict: + args['address'] = _dict.get('address') else: raise ValueError( - 'Required property \'id\' not present in RoutingTableIdentityById JSON' + 'Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePrototypeIP 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, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -59278,58 +65526,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableIdentityById object.""" + """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableIdentityById') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> 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: 'RoutingTableIdentityById') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupIdentityByCRN(SecurityGroupIdentity): +class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity( + SecurityGroupRuleRemotePrototype): """ - SecurityGroupIdentityByCRN. + Identifies a security group by a unique property. - :attr str crn: The security group's CRN. """ - def __init__(self, crn: str) -> None: + def __init__(self) -> None: """ - Initialize a SecurityGroupIdentityByCRN object. + Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object. - :param str crn: The security group's CRN. """ # pylint: disable=super-init-not-called - self.crn = crn + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', + 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', + 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref' + ])) + raise Exception(msg) + + +class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote): + """ + SecurityGroupRuleRemoteCIDR. + + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected CIDR block format was encountered. + """ + + def __init__(self, cidr_block: str) -> None: + """ + Initialize a SecurityGroupRuleRemoteCIDR object. + + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. + """ + # pylint: disable=super-init-not-called + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN': - """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR': + """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: raise ValueError( - 'Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON' + 'Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteCIDR 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, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -59337,58 +65615,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityByCRN object.""" + """Return a `str` version of this SecurityGroupRuleRemoteCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> 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: 'SecurityGroupIdentityByCRN') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupIdentityByHref(SecurityGroupIdentity): +class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote): """ - SecurityGroupIdentityByHref. + SecurityGroupRuleRemoteIP. - :attr str href: The security group's canonical URL. + :attr str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify that + the address is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected IP address format was encountered. """ - def __init__(self, href: str) -> None: + def __init__(self, address: str) -> None: """ - Initialize a SecurityGroupIdentityByHref object. + Initialize a SecurityGroupRuleRemoteIP object. - :param str href: The security group's canonical URL. + :param str address: The IP address. This property may add support for IPv6 + addresses in the future. When processing a value in this property, verify + that the address is in an expected format. If it is not, log an error. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected IP address format was encountered. """ # pylint: disable=super-init-not-called - self.href = href + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref': - """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP': + """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'address' in _dict: + args['address'] = _dict.get('address') else: raise ValueError( - 'Required property \'href\' not present in SecurityGroupIdentityByHref JSON' + 'Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteIP 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -59396,58 +65682,113 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityByHref object.""" + """Return a `str` version of this SecurityGroupRuleRemoteIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> 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: 'SecurityGroupIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupIdentityById(SecurityGroupIdentity): +class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): """ - SecurityGroupIdentityById. + SecurityGroupRuleRemoteSecurityGroupReference. + :attr str crn: The security group's CRN. + :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. + :attr str name: The user-defined name for this security group. Names must be + unique within the VPC the security group resides in. """ - def __init__(self, id: str) -> None: + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + *, + deleted: 'SecurityGroupReferenceDeleted' = None) -> None: """ - Initialize a SecurityGroupIdentityById object. + Initialize a SecurityGroupRuleRemoteSecurityGroupReference object. + :param str crn: The security group's CRN. + :param str href: The security group's canonical URL. :param str id: The unique identifier for this security group. + :param str name: The user-defined name for this security group. Names must + be unique within the VPC the security group resides in. + :param SecurityGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. """ # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.href = href self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById': - """Initialize a SecurityGroupIdentityById object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference': + """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError( + 'Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' + ) + if 'deleted' in _dict: + args['deleted'] = SecurityGroupReferenceDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' + ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in SecurityGroupIdentityById JSON' + 'Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteSecurityGroupReference 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, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href 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): @@ -59455,22 +65796,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityById object.""" + """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityById') -> bool: + def __eq__(self, + other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> 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: 'SecurityGroupIdentityById') -> bool: + def __ne__(self, + other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll( - SecurityGroupRulePrototype): +class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): """ When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` or @@ -59478,67 +65820,91 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll( :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr SecurityGroupRuleRemote remote: :attr str protocol: The protocol to enforce. """ def __init__(self, direction: str, + href: str, + id: str, + remote: 'SecurityGroupRuleRemote', protocol: str, *, - ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None) -> None: + ip_version: str = None) -> None: """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object. :param str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param SecurityGroupRuleRemote remote: :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) """ # pylint: disable=super-init-not-called self.direction = direction + self.href = href + self.id = id self.ip_version = ip_version self.remote = remote self.protocol = protocol @classmethod def from_dict( - cls, _dict: Dict - ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" + cls, + _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" args = {} if 'direction' in _dict: args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON' + 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' ) if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') if 'remote' in _dict: args['remote'] = _dict.get('remote') + else: + raise ValueError( + 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + ) if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON' + 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59546,6 +65912,10 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'direction') and self.direction is not None: _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'ip_version') and self.ip_version is not None: _dict['ip_version'] = self.ip_version if hasattr(self, 'remote') and self.remote is not None: @@ -59562,20 +65932,18 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' - ) -> bool: + def __eq__(self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> 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: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' - ) -> bool: + def __ne__(self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -59602,8 +65970,7 @@ class ProtocolEnum(str, Enum): ALL = 'all' -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP( - SecurityGroupRulePrototype): +class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): """ When `protocol` is `icmp`, then the rule may also contain fields to specify an ICMP `type` and `code`. Field `code` may only be specified if `type` is also specified. If @@ -59613,12 +65980,14 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP( :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr SecurityGroupRuleRemote remote: :attr int code: (optional) The ICMP traffic code to allow. :attr str protocol: The protocol to enforce. :attr int type: (optional) The ICMP traffic type to allow. @@ -59626,29 +65995,35 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP( def __init__(self, direction: str, + href: str, + id: str, + remote: 'SecurityGroupRuleRemote', protocol: str, *, ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, code: int = None, type: int = None) -> None: """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object. :param str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param SecurityGroupRuleRemote remote: :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) :param int code: (optional) The ICMP traffic code to allow. :param int type: (optional) The ICMP traffic type to allow. """ # pylint: disable=super-init-not-called self.direction = direction + self.href = href + self.id = id self.ip_version = ip_version self.remote = remote self.code = code @@ -59657,27 +66032,43 @@ def __init__(self, @classmethod def from_dict( - cls, _dict: Dict - ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" + cls, + _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" args = {} if 'direction' in _dict: args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON' + 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' ) if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') if 'remote' in _dict: args['remote'] = _dict.get('remote') + else: + raise ValueError( + 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' + ) if 'code' in _dict: args['code'] = _dict.get('code') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON' + 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' ) if 'type' in _dict: args['type'] = _dict.get('type') @@ -59685,7 +66076,7 @@ def from_dict( @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59693,6 +66084,10 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'direction') and self.direction is not None: _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'ip_version') and self.ip_version is not None: _dict['ip_version'] = self.ip_version if hasattr(self, 'remote') and self.remote is not None: @@ -59713,20 +66108,18 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' - ) -> bool: + def __eq__(self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> 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: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' - ) -> bool: + def __ne__(self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -59753,21 +66146,22 @@ class ProtocolEnum(str, Enum): ICMP = 'icmp' -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP( - SecurityGroupRulePrototype): +class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): """ If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - `port_max`. Either both should be set, or neither. When neither is set then traffic is + `port_max`. Either both must be set, or neither. When neither is set then traffic is allowed on all ports. For a single port, set both to the same value. :attr str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :attr SecurityGroupRuleRemotePrototype remote: (optional) + :attr SecurityGroupRuleRemote remote: :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. :attr str protocol: The protocol to enforce. @@ -59775,24 +66169,28 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP( def __init__(self, direction: str, + href: str, + id: str, + remote: 'SecurityGroupRuleRemote', protocol: str, *, ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, port_max: int = None, port_min: int = None) -> None: """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object. :param str direction: The direction of traffic to enforce, either `inbound` or `outbound`. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param SecurityGroupRuleRemote remote: :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this field, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) :param int port_max: (optional) The inclusive upper bound of TCP/UDP port range. :param int port_min: (optional) The inclusive lower bound of TCP/UDP port @@ -59800,6 +66198,8 @@ def __init__(self, """ # pylint: disable=super-init-not-called self.direction = direction + self.href = href + self.id = id self.ip_version = ip_version self.remote = remote self.port_max = port_max @@ -59808,20 +66208,36 @@ def __init__(self, @classmethod def from_dict( - cls, _dict: Dict - ) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" + cls, + _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" args = {} if 'direction' in _dict: args['direction'] = _dict.get('direction') else: raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON' + 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' ) if 'ip_version' in _dict: args['ip_version'] = _dict.get('ip_version') if 'remote' in _dict: args['remote'] = _dict.get('remote') + else: + raise ValueError( + 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' + ) if 'port_max' in _dict: args['port_max'] = _dict.get('port_max') if 'port_min' in _dict: @@ -59830,13 +66246,13 @@ def from_dict( args['protocol'] = _dict.get('protocol') else: raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON' + 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59844,6 +66260,10 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'direction') and self.direction is not None: _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'ip_version') and self.ip_version is not None: _dict['ip_version'] = self.ip_version if hasattr(self, 'remote') and self.remote is not None: @@ -59864,20 +66284,20 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - ) -> bool: + self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> 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: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - ) -> bool: + self, + other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -59905,119 +66325,98 @@ class ProtocolEnum(str, Enum): UDP = 'udp' -class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch): - """ - SecurityGroupRuleRemotePatchCIDR. - - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. - """ - - def __init__(self, cidr_block: str) -> None: - """ - Initialize a SecurityGroupRuleRemotePatchCIDR object. - - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. - """ - # pylint: disable=super-init-not-called - self.cidr_block = cidr_block - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR': - """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" - args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') - else: - raise ValueError( - 'Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON' - ) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePatchCIDR 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, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block - 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 SecurityGroupRuleRemotePatchCIDR object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> 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: 'SecurityGroupRuleRemotePatchCIDR') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch): +class SecurityGroupTargetReferenceLoadBalancerReference( + SecurityGroupTargetReference): """ - SecurityGroupRuleRemotePatchIP. + SecurityGroupTargetReferenceLoadBalancerReference. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str crn: The load balancer's CRN. + :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer. + :attr str name: The unique user-defined name for this load balancer. """ - def __init__(self, address: str) -> None: + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + *, + deleted: 'LoadBalancerReferenceDeleted' = None) -> None: """ - Initialize a SecurityGroupRuleRemotePatchIP object. + Initialize a SecurityGroupTargetReferenceLoadBalancerReference object. - :param str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify - that the address is in an expected format. If it is not, log an error. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected IP address format was encountered. + :param str crn: The load balancer's CRN. + :param str href: The load balancer's canonical URL. + :param str id: The unique identifier for this load balancer. + :param str name: The unique user-defined name for this load balancer. + :param LoadBalancerReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.address = address + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP': - """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference': + """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON' + 'Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' + ) + if 'deleted' in _dict: + args['deleted'] = LoadBalancerReferenceDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceLoadBalancerReference 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, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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): @@ -60025,88 +66424,121 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePatchIP object.""" + """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: + def __eq__( + self, + other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> 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: 'SecurityGroupRuleRemotePatchIP') -> bool: + def __ne__( + self, + other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemotePatchSecurityGroupIdentity( - SecurityGroupRuleRemotePatch): - """ - Identifies a security group by a unique property. - - """ - - def __init__(self) -> None: - """ - Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', - 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', - 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref' - ])) - raise Exception(msg) - - -class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype): +class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext( + SecurityGroupTargetReference): """ - SecurityGroupRuleRemotePrototypeCIDR. + SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. + :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted and + provides + some supplementary information. + :attr str href: The URL for this network interface. + :attr str id: The unique identifier for this network interface. + :attr str name: The user-defined name for this network interface. + :attr str resource_type: The resource type. """ - def __init__(self, cidr_block: str) -> None: + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None + ) -> None: """ - Initialize a SecurityGroupRuleRemotePrototypeCIDR object. + Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object. - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. + :param str href: The URL for this network interface. + :param str id: The unique identifier for this network interface. + :param str name: The user-defined name for this network interface. + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted + and provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.cidr_block = cidr_block + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR': - """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext': + """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') + if 'deleted' in _dict: + args[ + 'deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict( + _dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON' + 'Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext 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, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -60114,66 +66546,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object.""" + """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: + def __eq__( + self, other: + 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext' + ) -> 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: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: + def __ne__( + self, other: + 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + NETWORK_INTERFACE = 'network_interface' + -class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype): +class SubnetIdentityByCRN(SubnetIdentity): """ - SecurityGroupRuleRemotePrototypeIP. + SubnetIdentityByCRN. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str crn: The CRN for this subnet. """ - def __init__(self, address: str) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a SecurityGroupRuleRemotePrototypeIP object. + Initialize a SubnetIdentityByCRN object. - :param str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify - that the address is in an expected format. If it is not, log an error. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected IP address format was encountered. + :param str crn: The CRN for this subnet. """ # pylint: disable=super-init-not-called - self.address = address + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP': - """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByCRN': + """Initialize a SubnetIdentityByCRN object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON' + 'Required property \'crn\' not present in SubnetIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" + """Initialize a SubnetIdentityByCRN 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, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -60181,88 +66617,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object.""" + """Return a `str` version of this SubnetIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: + def __eq__(self, other: 'SubnetIdentityByCRN') -> 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: 'SecurityGroupRuleRemotePrototypeIP') -> bool: + def __ne__(self, other: 'SubnetIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity( - SecurityGroupRuleRemotePrototype): - """ - Identifies a security group by a unique property. - - """ - - def __init__(self) -> None: - """ - Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', - 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', - 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref' - ])) - raise Exception(msg) - - -class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote): +class SubnetIdentityByHref(SubnetIdentity): """ - SecurityGroupRuleRemoteCIDR. + SubnetIdentityByHref. - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. + :attr str href: The URL for this subnet. """ - def __init__(self, cidr_block: str) -> None: + def __init__(self, href: str) -> None: """ - Initialize a SecurityGroupRuleRemoteCIDR object. + Initialize a SubnetIdentityByHref object. - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. + :param str href: The URL for this subnet. """ # pylint: disable=super-init-not-called - self.cidr_block = cidr_block + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR': - """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByHref': + """Initialize a SubnetIdentityByHref object from a json dictionary.""" args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON' + 'Required property \'href\' not present in SubnetIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" + """Initialize a SubnetIdentityByHref 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, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -60270,66 +66676,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteCIDR object.""" + """Return a `str` version of this SubnetIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: + def __eq__(self, other: 'SubnetIdentityByHref') -> 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: 'SecurityGroupRuleRemoteCIDR') -> bool: + def __ne__(self, other: 'SubnetIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote): +class SubnetIdentityById(SubnetIdentity): """ - SecurityGroupRuleRemoteIP. + SubnetIdentityById. - :attr str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify that - the address is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected IP address format was encountered. + :attr str id: The unique identifier for this subnet. """ - def __init__(self, address: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a SecurityGroupRuleRemoteIP object. + Initialize a SubnetIdentityById object. - :param str address: The IP address. This property may add support for IPv6 - addresses in the future. When processing a value in this property, verify - that the address is in an expected format. If it is not, log an error. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected IP address format was encountered. + :param str id: The unique identifier for this subnet. """ # pylint: disable=super-init-not-called - self.address = address + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP': - """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetIdentityById': + """Initialize a SubnetIdentityById object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON' + 'Required property \'id\' not present in SubnetIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" + """Initialize a SubnetIdentityById 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, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -60337,113 +66735,176 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteIP object.""" + """Return a `str` version of this SubnetIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: + def __eq__(self, other: 'SubnetIdentityById') -> 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: 'SecurityGroupRuleRemoteIP') -> bool: + def __ne__(self, other: 'SubnetIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): +class SubnetPrototypeSubnetByCIDR(SubnetPrototype): """ - SecurityGroupRuleRemoteSecurityGroupReference. + SubnetPrototypeSubnetByCIDR. - :attr str crn: The security group's CRN. - :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str href: The security group's canonical URL. - :attr str id: The unique identifier for this security group. - :attr str name: The user-defined name for this security group. Names must be - unique within the VPC the security group resides in. + :attr str ip_version: (optional) The IP version(s) to support for this subnet. + :attr str name: (optional) The user-defined name for this subnet. Names must be + unique within the VPC the subnet resides in. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this + subnet. If unspecified, the default network ACL for the VPC is used. + :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to + handle internet bound traffic for this subnet. + :attr ResourceGroupIdentity resource_group: (optional) + :attr RoutingTableIdentity routing_table: (optional) The routing table to use + for this subnet. If unspecified, the default routing table for the VPC is used. + The routing table properties `route_direct_link_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet is to be a part of. + :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR + format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608 + addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must + fall within an existing address prefix in the VPC. The subnet will be created in + the zone of the address prefix that contains the IPv4 CIDR. If zone is + specified, it must match the zone of the address prefix that contains the + subnet's IPv4 CIDR. + :attr ZoneIdentity zone: (optional) The zone this subnet will reside in. """ def __init__(self, - crn: str, - href: str, - id: str, - name: str, + vpc: 'VPCIdentity', + ipv4_cidr_block: str, *, - deleted: 'SecurityGroupReferenceDeleted' = None) -> None: + ip_version: str = None, + name: str = None, + network_acl: 'NetworkACLIdentity' = None, + public_gateway: 'PublicGatewayIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + routing_table: 'RoutingTableIdentity' = None, + zone: 'ZoneIdentity' = None) -> None: """ - Initialize a SecurityGroupRuleRemoteSecurityGroupReference object. + Initialize a SubnetPrototypeSubnetByCIDR object. - :param str crn: The security group's CRN. - :param str href: The security group's canonical URL. - :param str id: The unique identifier for this security group. - :param str name: The user-defined name for this security group. Names must - be unique within the VPC the security group resides in. - :param SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. + :param VPCIdentity vpc: The VPC the subnet is to be a part of. + :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR + format. The prefix length of the subnet's CIDR must be between `/9` + (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the + subnet's CIDR must fall within an existing address prefix in the VPC. The + subnet will be created in the zone of the address prefix that contains the + IPv4 CIDR. If zone is specified, it must match the zone of the address + prefix that contains the subnet's IPv4 CIDR. + :param str ip_version: (optional) The IP version(s) to support for this + subnet. + :param str name: (optional) The user-defined name for this subnet. Names + must be unique within the VPC the subnet resides in. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param NetworkACLIdentity network_acl: (optional) The network ACL to use + for this subnet. If unspecified, the default network ACL for the VPC is + used. + :param PublicGatewayIdentity public_gateway: (optional) The public gateway + to handle internet bound traffic for this subnet. + :param ResourceGroupIdentity resource_group: (optional) + :param RoutingTableIdentity routing_table: (optional) The routing table to + use for this subnet. If unspecified, the default routing table for the VPC + is used. The routing table properties `route_direct_link_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be + `false`. + :param ZoneIdentity zone: (optional) The zone this subnet will reside in. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id + self.ip_version = ip_version self.name = name + self.network_acl = network_acl + self.public_gateway = public_gateway + self.resource_group = resource_group + self.routing_table = routing_table + self.vpc = vpc + self.ipv4_cidr_block = ipv4_cidr_block + self.zone = zone @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference': - """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByCIDR': + """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError( - 'Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' - ) - if 'deleted' in _dict: - args['deleted'] = SecurityGroupReferenceDeleted.from_dict( - _dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_acl' in _dict: + args['network_acl'] = _dict.get('network_acl') + if 'public_gateway' in _dict: + args['public_gateway'] = _dict.get('public_gateway') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'routing_table' in _dict: + args['routing_table'] = _dict.get('routing_table') + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') else: raise ValueError( - 'Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' + 'Required property \'vpc\' not present in SubnetPrototypeSubnetByCIDR JSON' ) - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'ipv4_cidr_block' in _dict: + args['ipv4_cidr_block'] = _dict.get('ipv4_cidr_block') else: raise ValueError( - 'Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON' + 'Required property \'ipv4_cidr_block\' not present in SubnetPrototypeSubnetByCIDR JSON' ) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" + """Initialize a SubnetPrototypeSubnetByCIDR 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, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'network_acl') and self.network_acl is not None: + if isinstance(self.network_acl, dict): + _dict['network_acl'] = self.network_acl + else: + _dict['network_acl'] = self.network_acl.to_dict() + if hasattr(self, 'public_gateway') and self.public_gateway is not None: + if isinstance(self.public_gateway, dict): + _dict['public_gateway'] = self.public_gateway + else: + _dict['public_gateway'] = self.public_gateway.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'routing_table') and self.routing_table is not None: + if isinstance(self.routing_table, dict): + _dict['routing_table'] = self.routing_table + else: + _dict['routing_table'] = self.routing_table.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, + 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: + _dict['ipv4_cidr_block'] = self.ipv4_cidr_block + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -60451,135 +66912,181 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object.""" + """Return a `str` version of this SubnetPrototypeSubnetByCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: + def __eq__(self, other: 'SubnetPrototypeSubnetByCIDR') -> 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: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: + def __ne__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class IpVersionEnum(str, Enum): + """ + The IP version(s) to support for this subnet. + """ + IPV4 = 'ipv4' + -class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): +class SubnetPrototypeSubnetByTotalCount(SubnetPrototype): """ - When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` - or - `code`. + SubnetPrototypeSubnetByTotalCount. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr str protocol: The protocol to enforce. + :attr str ip_version: (optional) The IP version(s) to support for this subnet. + :attr str name: (optional) The user-defined name for this subnet. Names must be + unique within the VPC the subnet resides in. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this + subnet. If unspecified, the default network ACL for the VPC is used. + :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to + handle internet bound traffic for this subnet. + :attr ResourceGroupIdentity resource_group: (optional) + :attr RoutingTableIdentity routing_table: (optional) The routing table to use + for this subnet. If unspecified, the default routing table for the VPC is used. + The routing table properties `route_direct_link_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet is to be a part of. + :attr int total_ipv4_address_count: The total number of IPv4 addresses required. + Must be a power of 2. The VPC must have a default address prefix in the + specified zone, and that prefix must have a free CIDR range with at least this + number of addresses. + :attr ZoneIdentity zone: The zone this subnet will reside in. """ def __init__(self, - direction: str, - href: str, - id: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, + vpc: 'VPCIdentity', + total_ipv4_address_count: int, + zone: 'ZoneIdentity', *, - ip_version: str = None) -> None: + ip_version: str = None, + name: str = None, + network_acl: 'NetworkACLIdentity' = None, + public_gateway: 'PublicGatewayIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + routing_table: 'RoutingTableIdentity' = None) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object. + Initialize a SubnetPrototypeSubnetByTotalCount object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. + :param VPCIdentity vpc: The VPC the subnet is to be a part of. + :param int total_ipv4_address_count: The total number of IPv4 addresses + required. Must be a power of 2. The VPC must have a default address prefix + in the specified zone, and that prefix must have a free CIDR range with at + least this number of addresses. + :param ZoneIdentity zone: The zone this subnet will reside in. + :param str ip_version: (optional) The IP version(s) to support for this + subnet. + :param str name: (optional) The user-defined name for this subnet. Names + must be unique within the VPC the subnet resides in. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param NetworkACLIdentity network_acl: (optional) The network ACL to use + for this subnet. If unspecified, the default network ACL for the VPC is + used. + :param PublicGatewayIdentity public_gateway: (optional) The public gateway + to handle internet bound traffic for this subnet. + :param ResourceGroupIdentity resource_group: (optional) + :param RoutingTableIdentity routing_table: (optional) The routing table to + use for this subnet. If unspecified, the default routing table for the VPC + is used. The routing table properties `route_direct_link_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be + `false`. """ # pylint: disable=super-init-not-called - self.direction = direction - self.href = href - self.id = id self.ip_version = ip_version - self.remote = remote - self.protocol = protocol + self.name = name + self.network_acl = network_acl + self.public_gateway = public_gateway + self.resource_group = resource_group + self.routing_table = routing_table + self.vpc = vpc + self.total_ipv4_address_count = total_ipv4_address_count + self.zone = zone @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByTotalCount': + """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary.""" args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' - ) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_acl' in _dict: + args['network_acl'] = _dict.get('network_acl') + if 'public_gateway' in _dict: + args['public_gateway'] = _dict.get('public_gateway') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'routing_table' in _dict: + args['routing_table'] = _dict.get('routing_table') + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') else: raise ValueError( - 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + 'Required property \'vpc\' not present in SubnetPrototypeSubnetByTotalCount JSON' ) - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') + if 'total_ipv4_address_count' in _dict: + args['total_ipv4_address_count'] = _dict.get( + 'total_ipv4_address_count') else: raise ValueError( - 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + 'Required property \'total_ipv4_address_count\' not present in SubnetPrototypeSubnetByTotalCount JSON' ) - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON' + 'Required property \'zone\' not present in SubnetPrototypeSubnetByTotalCount JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" + """Initialize a SubnetPrototypeSubnetByTotalCount 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, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id if hasattr(self, 'ip_version') and self.ip_version is not None: _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'network_acl') and self.network_acl is not None: + if isinstance(self.network_acl, dict): + _dict['network_acl'] = self.network_acl else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + _dict['network_acl'] = self.network_acl.to_dict() + if hasattr(self, 'public_gateway') and self.public_gateway is not None: + if isinstance(self.public_gateway, dict): + _dict['public_gateway'] = self.public_gateway + else: + _dict['public_gateway'] = self.public_gateway.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'routing_table') and self.routing_table is not None: + if isinstance(self.routing_table, dict): + _dict['routing_table'] = self.routing_table + else: + _dict['routing_table'] = self.routing_table.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'total_ipv4_address_count' + ) and self.total_ipv4_address_count is not None: + _dict['total_ipv4_address_count'] = self.total_ipv4_address_count + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -60587,175 +67094,64 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object.""" + """Return a `str` version of this SubnetPrototypeSubnetByTotalCount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: + def __eq__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> 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: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: + def __ne__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce, either `inbound` or `outbound`. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' - class IpVersionEnum(str, Enum): """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. + The IP version(s) to support for this subnet. """ IPV4 = 'ipv4' - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ - ALL = 'all' - -class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): +class VPCIdentityByCRN(VPCIdentity): """ - When `protocol` is `icmp`, then the rule may also contain fields to specify an ICMP - `type` and `code`. Field `code` may only be specified if `type` is also specified. If - type is not specified, then traffic is allowed for all types and codes. If type is - specified and code is not specified, then traffic is allowed with the specified type - for all codes. + VPCIdentityByCRN. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr int code: (optional) The ICMP traffic code to allow. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. + :attr str crn: The CRN for this VPC. """ - def __init__(self, - direction: str, - href: str, - id: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, - *, - ip_version: str = None, - code: int = None, - type: int = None) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object. + Initialize a VPCIdentityByCRN object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param int code: (optional) The ICMP traffic code to allow. - :param int type: (optional) The ICMP traffic type to allow. + :param str crn: The CRN for this VPC. """ # pylint: disable=super-init-not-called - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.remote = remote - self.code = code - self.protocol = protocol - self.type = type + self.crn = crn @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCIdentityByCRN': + """Initialize a VPCIdentityByCRN object from a json dictionary.""" args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' - ) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' - ) - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - else: - raise ValueError( - 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' - ) - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON' + 'Required property \'crn\' not present in VPCIdentityByCRN JSON' ) - if 'type' in _dict: - args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" + """Initialize a VPCIdentityByCRN 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, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -60763,175 +67159,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object.""" + """Return a `str` version of this VPCIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, - other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: + def __eq__(self, other: 'VPCIdentityByCRN') -> 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: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: + def __ne__(self, other: 'VPCIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce, either `inbound` or `outbound`. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - IPV4 = 'ipv4' - - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ - ICMP = 'icmp' - -class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): +class VPCIdentityByHref(VPCIdentity): """ - If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - `port_max`. Either both should be set, or neither. When neither is set then traffic is - allowed on all ports. For a single port, set both to the same value. + VPCIdentityByHref. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. - :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. - :attr str protocol: The protocol to enforce. + :attr str href: The URL for this VPC. """ - def __init__(self, - direction: str, - href: str, - id: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, - *, - ip_version: str = None, - port_max: int = None, - port_min: int = None) -> None: + def __init__(self, href: str) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object. + Initialize a VPCIdentityByHref object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this field, if they are - used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param int port_max: (optional) The inclusive upper bound of TCP/UDP port - range. - :param int port_min: (optional) The inclusive lower bound of TCP/UDP port - range. + :param str href: The URL for this VPC. """ # pylint: disable=super-init-not-called - self.direction = direction self.href = href - self.id = id - self.ip_version = ip_version - self.remote = remote - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol - @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" - args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError( - 'Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' - ) + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPCIdentityByHref': + """Initialize a VPCIdentityByHref object from a json dictionary.""" + args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' - ) - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - else: - raise ValueError( - 'Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' - ) - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError( - 'Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON' + 'Required property \'href\' not present in VPCIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a VPCIdentityByHref 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, 'direction') and self.direction is not None: - _dict['direction'] = self.direction if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'port_max') and self.port_max is not None: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -60939,139 +67218,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.""" + """Return a `str` version of this VPCIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'VPCIdentityByHref') -> 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: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'VPCIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce, either `inbound` or `outbound`. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this field, if they are used. Alternatively, if `remote` references a - security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - IPV4 = 'ipv4' - - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ - TCP = 'tcp' - UDP = 'udp' - -class SecurityGroupTargetReferenceLoadBalancerReference( - SecurityGroupTargetReference): +class VPCIdentityById(VPCIdentity): """ - SecurityGroupTargetReferenceLoadBalancerReference. + VPCIdentityById. - :attr str crn: The load balancer's CRN. - :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str href: The load balancer's canonical URL. - :attr str id: The unique identifier for this load balancer. - :attr str name: The unique user-defined name for this load balancer. + :attr str id: The unique identifier for this VPC. """ - def __init__(self, - crn: str, - href: str, - id: str, - name: str, - *, - deleted: 'LoadBalancerReferenceDeleted' = None) -> None: + def __init__(self, id: str) -> None: """ - Initialize a SecurityGroupTargetReferenceLoadBalancerReference object. + Initialize a VPCIdentityById object. - :param str crn: The load balancer's CRN. - :param str href: The load balancer's canonical URL. - :param str id: The unique identifier for this load balancer. - :param str name: The unique user-defined name for this load balancer. - :param LoadBalancerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. + :param str id: The unique identifier for this VPC. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href self.id = id - self.name = name @classmethod - def from_dict( - cls, - _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference': - """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCIdentityById': + """Initialize a VPCIdentityById object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError( - 'Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' - ) - if 'deleted' in _dict: - args['deleted'] = LoadBalancerReferenceDeleted.from_dict( - _dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' - ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError( - 'Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON' - ) + 'Required property \'id\' not present in VPCIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" + """Initialize a VPCIdentityById 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, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href 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): @@ -61079,121 +67276,136 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object.""" + """Return a `str` version of this VPCIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: + def __eq__(self, other: 'VPCIdentityById') -> 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: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: + def __ne__(self, other: 'VPCIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext( - SecurityGroupTargetReference): +class VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch( + VPNGatewayConnectionPatch): """ - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. + VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch. - :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and - provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. - :attr str resource_type: The resource type. + :attr bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :attr str name: (optional) The user-defined name for this VPN gateway + connection. + :attr str peer_address: (optional) The IP address of the peer VPN gateway. + :attr str psk: (optional) The preshared key. + :attr str routing_protocol: (optional) Routing protocols are disabled for this + VPN gateway connection. """ - def __init__( - self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None - ) -> None: + def __init__(self, + *, + admin_state_up: bool = None, + dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, + ike_policy: 'IKEPolicyIdentity' = None, + ipsec_policy: 'IPsecPolicyIdentity' = None, + name: str = None, + peer_address: str = None, + psk: str = None, + routing_protocol: str = None) -> None: """ - Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object. + Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object. - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. - :param str resource_type: The resource type. - :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted - and provides - some supplementary information. + :param bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :param str name: (optional) The user-defined name for this VPN gateway + connection. + :param str peer_address: (optional) The IP address of the peer VPN gateway. + :param str psk: (optional) The preshared key. + :param str routing_protocol: (optional) Routing protocols are disabled for + this VPN gateway connection. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id + self.admin_state_up = admin_state_up + self.dead_peer_detection = dead_peer_detection + self.ike_policy = ike_policy + self.ipsec_policy = ipsec_policy self.name = name - self.resource_type = resource_type + self.peer_address = peer_address + self.psk = psk + self.routing_protocol = routing_protocol @classmethod def from_dict( cls, _dict: Dict - ) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext': - """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + ) -> 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch': + """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object from a json dictionary.""" args = {} - if 'deleted' in _dict: + if 'admin_state_up' in _dict: + args['admin_state_up'] = _dict.get('admin_state_up') + if 'dead_peer_detection' in _dict: args[ - 'deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict( - _dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' - ) + 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( + _dict.get('dead_peer_detection')) + if 'ike_policy' in _dict: + args['ike_policy'] = _dict.get('ike_policy') + if 'ipsec_policy' in _dict: + args['ipsec_policy'] = _dict.get('ipsec_policy') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError( - 'Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' - ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON' - ) + if 'peer_address' in _dict: + args['peer_address'] = _dict.get('peer_address') + if 'psk' in _dict: + args['psk'] = _dict.get('psk') + if 'routing_protocol' in _dict: + args['routing_protocol'] = _dict.get('routing_protocol') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch 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, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: + _dict['admin_state_up'] = self.admin_state_up + if hasattr( + self, + 'dead_peer_detection') and self.dead_peer_detection is not None: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if hasattr(self, 'ike_policy') and self.ike_policy is not None: + if isinstance(self.ike_policy, dict): + _dict['ike_policy'] = self.ike_policy + else: + _dict['ike_policy'] = self.ike_policy.to_dict() + if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: + if isinstance(self.ipsec_policy, dict): + _dict['ipsec_policy'] = self.ipsec_policy + else: + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'peer_address') and self.peer_address is not None: + _dict['peer_address'] = self.peer_address + if hasattr(self, 'psk') and self.psk is not None: + _dict['psk'] = self.psk + if hasattr(self, + 'routing_protocol') and self.routing_protocol is not None: + _dict['routing_protocol'] = self.routing_protocol return _dict def _to_dict(self): @@ -61201,12 +67413,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.""" + """Return a `str` version of this VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext' + self, + other: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -61214,116 +67426,249 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: - 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext' + self, + other: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class RoutingProtocolEnum(str, Enum): """ - The resource type. + Routing protocols are disabled for this VPN gateway connection. """ - NETWORK_INTERFACE = 'network_interface' + NONE = 'none' -class SubnetIdentityByCRN(SubnetIdentity): +class VPNGatewayConnectionPolicyMode(VPNGatewayConnection): """ - SubnetIdentityByCRN. + VPNGatewayConnectionPolicyMode. - :attr str crn: The CRN for this subnet. + :attr bool admin_state_up: If set to false, the VPN gateway connection is shut + down. + :attr str authentication_mode: The authentication mode. Only `psk` is currently + supported. + :attr datetime created_at: The date and time that this VPN gateway connection + was created. + :attr VPNGatewayConnectionDPD dead_peer_detection: + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :attr IKEPolicyReference ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :attr IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :attr str mode: The mode of the VPN gateway. + :attr str name: The user-defined name for this VPN gateway connection. + :attr str peer_address: The IP address of the peer VPN gateway. + :attr str psk: The preshared key. + :attr str resource_type: The resource type. + :attr str status: The status of a VPN gateway connection. + :attr List[str] local_cidrs: A collection of local CIDRs for this resource. + :attr List[str] peer_cidrs: A collection of peer CIDRs for this resource. """ - def __init__(self, crn: str) -> None: + def __init__(self, + admin_state_up: bool, + authentication_mode: str, + created_at: datetime, + dead_peer_detection: 'VPNGatewayConnectionDPD', + href: str, + id: str, + mode: str, + name: str, + peer_address: str, + psk: str, + resource_type: str, + status: str, + local_cidrs: List[str], + peer_cidrs: List[str], + *, + ike_policy: 'IKEPolicyReference' = None, + ipsec_policy: 'IPsecPolicyReference' = None) -> None: """ - Initialize a SubnetIdentityByCRN object. + Initialize a VPNGatewayConnectionPolicyMode object. - :param str crn: The CRN for this subnet. + :param bool admin_state_up: If set to false, the VPN gateway connection is + shut down. + :param str authentication_mode: The authentication mode. Only `psk` is + currently supported. + :param datetime created_at: The date and time that this VPN gateway + connection was created. + :param VPNGatewayConnectionDPD dead_peer_detection: + :param str href: The VPN connection's canonical URL. + :param str id: The unique identifier for this VPN gateway connection. + :param str mode: The mode of the VPN gateway. + :param str name: The user-defined name for this VPN gateway connection. + :param str peer_address: The IP address of the peer VPN gateway. + :param str psk: The preshared key. + :param str resource_type: The resource type. + :param str status: The status of a VPN gateway connection. + :param List[str] local_cidrs: A collection of local CIDRs for this + resource. + :param List[str] peer_cidrs: A collection of peer CIDRs for this resource. + :param IKEPolicyReference ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :param IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. """ # pylint: disable=super-init-not-called - self.crn = crn + self.admin_state_up = admin_state_up + self.authentication_mode = authentication_mode + self.created_at = created_at + self.dead_peer_detection = dead_peer_detection + self.href = href + self.id = id + self.ike_policy = ike_policy + self.ipsec_policy = ipsec_policy + self.mode = mode + self.name = name + self.peer_address = peer_address + self.psk = psk + self.resource_type = resource_type + self.status = status + self.local_cidrs = local_cidrs + self.peer_cidrs = peer_cidrs @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByCRN': - """Initialize a SubnetIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPolicyMode': + """Initialize a VPNGatewayConnectionPolicyMode object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'admin_state_up' in _dict: + args['admin_state_up'] = _dict.get('admin_state_up') + else: + raise ValueError( + 'Required property \'admin_state_up\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'authentication_mode' in _dict: + args['authentication_mode'] = _dict.get('authentication_mode') + else: + raise ValueError( + 'Required property \'authentication_mode\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'dead_peer_detection' in _dict: + args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict( + _dict.get('dead_peer_detection')) + else: + raise ValueError( + 'Required property \'dead_peer_detection\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'ike_policy' in _dict: + args['ike_policy'] = IKEPolicyReference.from_dict( + _dict.get('ike_policy')) + if 'ipsec_policy' in _dict: + args['ipsec_policy'] = IPsecPolicyReference.from_dict( + _dict.get('ipsec_policy')) + if 'mode' in _dict: + args['mode'] = _dict.get('mode') + else: + raise ValueError( + 'Required property \'mode\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'peer_address' in _dict: + args['peer_address'] = _dict.get('peer_address') + else: + raise ValueError( + 'Required property \'peer_address\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'psk' in _dict: + args['psk'] = _dict.get('psk') + else: + raise ValueError( + 'Required property \'psk\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError( + 'Required property \'status\' not present in VPNGatewayConnectionPolicyMode JSON' + ) + if 'local_cidrs' in _dict: + args['local_cidrs'] = _dict.get('local_cidrs') else: raise ValueError( - 'Required property \'crn\' not present in SubnetIdentityByCRN JSON' + 'Required property \'local_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON' ) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SubnetIdentityByCRN 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 - 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 SubnetIdentityByCRN object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SubnetIdentityByCRN') -> 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: 'SubnetIdentityByCRN') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SubnetIdentityByHref(SubnetIdentity): - """ - SubnetIdentityByHref. - - :attr str href: The URL for this subnet. - """ - - def __init__(self, href: str) -> None: - """ - Initialize a SubnetIdentityByHref object. - - :param str href: The URL for this subnet. - """ - # pylint: disable=super-init-not-called - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByHref': - """Initialize a SubnetIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'peer_cidrs' in _dict: + args['peer_cidrs'] = _dict.get('peer_cidrs') else: raise ValueError( - 'Required property \'href\' not present in SubnetIdentityByHref JSON' + 'Required property \'peer_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetIdentityByHref object from a json dictionary.""" + """Initialize a VPNGatewayConnectionPolicyMode 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, 'admin_state_up') and self.admin_state_up is not None: + _dict['admin_state_up'] = self.admin_state_up + if hasattr( + self, + 'authentication_mode') and self.authentication_mode is not None: + _dict['authentication_mode'] = self.authentication_mode + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr( + self, + 'dead_peer_detection') and self.dead_peer_detection is not None: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ike_policy') and self.ike_policy is not None: + _dict['ike_policy'] = self.ike_policy.to_dict() + if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'peer_address') and self.peer_address is not None: + _dict['peer_address'] = self.peer_address + if hasattr(self, 'psk') and self.psk is not None: + _dict['psk'] = self.psk + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: + _dict['local_cidrs'] = self.local_cidrs + if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: + _dict['peer_cidrs'] = self.peer_cidrs return _dict def _to_dict(self): @@ -61331,235 +67676,184 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetIdentityByHref object.""" + """Return a `str` version of this VPNGatewayConnectionPolicyMode object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetIdentityByHref') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionPolicyMode') -> 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: 'SubnetIdentityByHref') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class SubnetIdentityById(SubnetIdentity): - """ - SubnetIdentityById. - - :attr str id: The unique identifier for this subnet. - """ - - def __init__(self, id: str) -> None: + class AuthenticationModeEnum(str, Enum): """ - Initialize a SubnetIdentityById object. - - :param str id: The unique identifier for this subnet. + The authentication mode. Only `psk` is currently supported. """ - # pylint: disable=super-init-not-called - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetIdentityById': - """Initialize a SubnetIdentityById object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in SubnetIdentityById JSON' - ) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SubnetIdentityById 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() + PSK = 'psk' - def __str__(self) -> str: - """Return a `str` version of this SubnetIdentityById object.""" - return json.dumps(self.to_dict(), indent=2) + class ModeEnum(str, Enum): + """ + The mode of the VPN gateway. + """ + POLICY = 'policy' + ROUTE = 'route' - def __eq__(self, other: 'SubnetIdentityById') -> 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 ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' - def __ne__(self, other: 'SubnetIdentityById') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + class StatusEnum(str, Enum): + """ + The status of a VPN gateway connection. + """ + DOWN = 'down' + UP = 'up' -class SubnetPrototypeSubnetByCIDR(SubnetPrototype): +class VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype( + VPNGatewayConnectionPrototype): """ - SubnetPrototypeSubnetByCIDR. + VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype. - :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this - subnet. If unspecified, the default network ACL for the VPC is used. - :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to - handle internet bound traffic for this subnet. - :attr ResourceGroupIdentity resource_group: (optional) - :attr RoutingTableIdentity routing_table: (optional) The routing table to use - for this subnet. If unspecified, the default routing table for the VPC is used. - The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet is to be a part of. - :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR - format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608 - addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must - fall within an existing address prefix in the VPC. The subnet will be created in - the zone of the address prefix that contains the IPv4 CIDR. If zone is - specified, it must match the zone of the address prefix that contains the - subnet's IPv4 CIDR. - :attr ZoneIdentity zone: (optional) The zone this subnet will reside in. + :attr bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :attr str name: (optional) The user-defined name for this VPN gateway + connection. + :attr str peer_address: The IP address of the peer VPN gateway. + :attr str psk: The preshared key. + :attr List[str] local_cidrs: A collection of local CIDRs for this resource. + :attr List[str] peer_cidrs: A collection of peer CIDRs for this resource. """ def __init__(self, - vpc: 'VPCIdentity', - ipv4_cidr_block: str, + peer_address: str, + psk: str, + local_cidrs: List[str], + peer_cidrs: List[str], *, - ip_version: str = None, - name: str = None, - network_acl: 'NetworkACLIdentity' = None, - public_gateway: 'PublicGatewayIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - routing_table: 'RoutingTableIdentity' = None, - zone: 'ZoneIdentity' = None) -> None: + admin_state_up: bool = None, + dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, + ike_policy: 'IKEPolicyIdentity' = None, + ipsec_policy: 'IPsecPolicyIdentity' = None, + name: str = None) -> None: """ - Initialize a SubnetPrototypeSubnetByCIDR object. + Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object. - :param VPCIdentity vpc: The VPC the subnet is to be a part of. - :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR - format. The prefix length of the subnet's CIDR must be between `/9` - (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the - subnet's CIDR must fall within an existing address prefix in the VPC. The - subnet will be created in the zone of the address prefix that contains the - IPv4 CIDR. If zone is specified, it must match the zone of the address - prefix that contains the subnet's IPv4 CIDR. - :param str ip_version: (optional) The IP version(s) to support for this - subnet. - :param str name: (optional) The user-defined name for this subnet. Names - must be unique within the VPC the subnet resides in. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param NetworkACLIdentity network_acl: (optional) The network ACL to use - for this subnet. If unspecified, the default network ACL for the VPC is - used. - :param PublicGatewayIdentity public_gateway: (optional) The public gateway - to handle internet bound traffic for this subnet. - :param ResourceGroupIdentity resource_group: (optional) - :param RoutingTableIdentity routing_table: (optional) The routing table to - use for this subnet. If unspecified, the default routing table for the VPC - is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. - :param ZoneIdentity zone: (optional) The zone this subnet will reside in. + :param str peer_address: The IP address of the peer VPN gateway. + :param str psk: The preshared key. + :param List[str] local_cidrs: A collection of local CIDRs for this + resource. + :param List[str] peer_cidrs: A collection of peer CIDRs for this resource. + :param bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :param str name: (optional) The user-defined name for this VPN gateway + connection. """ # pylint: disable=super-init-not-called - self.ip_version = ip_version + self.admin_state_up = admin_state_up + self.dead_peer_detection = dead_peer_detection + self.ike_policy = ike_policy + self.ipsec_policy = ipsec_policy self.name = name - self.network_acl = network_acl - self.public_gateway = public_gateway - self.resource_group = resource_group - self.routing_table = routing_table - self.vpc = vpc - self.ipv4_cidr_block = ipv4_cidr_block - self.zone = zone + self.peer_address = peer_address + self.psk = psk + self.local_cidrs = local_cidrs + self.peer_cidrs = peer_cidrs @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByCIDR': - """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype': + """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary.""" args = {} - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + if 'admin_state_up' in _dict: + args['admin_state_up'] = _dict.get('admin_state_up') + if 'dead_peer_detection' in _dict: + args[ + 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( + _dict.get('dead_peer_detection')) + if 'ike_policy' in _dict: + args['ike_policy'] = _dict.get('ike_policy') + if 'ipsec_policy' in _dict: + args['ipsec_policy'] = _dict.get('ipsec_policy') if 'name' in _dict: args['name'] = _dict.get('name') - if 'network_acl' in _dict: - args['network_acl'] = _dict.get('network_acl') - if 'public_gateway' in _dict: - args['public_gateway'] = _dict.get('public_gateway') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'routing_table' in _dict: - args['routing_table'] = _dict.get('routing_table') - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') + if 'peer_address' in _dict: + args['peer_address'] = _dict.get('peer_address') else: raise ValueError( - 'Required property \'vpc\' not present in SubnetPrototypeSubnetByCIDR JSON' + 'Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' ) - if 'ipv4_cidr_block' in _dict: - args['ipv4_cidr_block'] = _dict.get('ipv4_cidr_block') + if 'psk' in _dict: + args['psk'] = _dict.get('psk') else: raise ValueError( - 'Required property \'ipv4_cidr_block\' not present in SubnetPrototypeSubnetByCIDR JSON' + 'Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' + ) + if 'local_cidrs' in _dict: + args['local_cidrs'] = _dict.get('local_cidrs') + else: + raise ValueError( + 'Required property \'local_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' + ) + if 'peer_cidrs' in _dict: + args['peer_cidrs'] = _dict.get('peer_cidrs') + else: + raise ValueError( + 'Required property \'peer_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' ) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary.""" + """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype 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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_acl') and self.network_acl is not None: - if isinstance(self.network_acl, dict): - _dict['network_acl'] = self.network_acl - else: - _dict['network_acl'] = self.network_acl.to_dict() - if hasattr(self, 'public_gateway') and self.public_gateway is not None: - if isinstance(self.public_gateway, dict): - _dict['public_gateway'] = self.public_gateway - else: - _dict['public_gateway'] = self.public_gateway.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'routing_table') and self.routing_table is not None: - if isinstance(self.routing_table, dict): - _dict['routing_table'] = self.routing_table - else: - _dict['routing_table'] = self.routing_table.to_dict() - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc + if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: + _dict['admin_state_up'] = self.admin_state_up + if hasattr( + self, + 'dead_peer_detection') and self.dead_peer_detection is not None: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if hasattr(self, 'ike_policy') and self.ike_policy is not None: + if isinstance(self.ike_policy, dict): + _dict['ike_policy'] = self.ike_policy else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, - 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: - _dict['ipv4_cidr_block'] = self.ipv4_cidr_block - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + _dict['ike_policy'] = self.ike_policy.to_dict() + if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: + if isinstance(self.ipsec_policy, dict): + _dict['ipsec_policy'] = self.ipsec_policy else: - _dict['zone'] = self.zone.to_dict() + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'peer_address') and self.peer_address is not None: + _dict['peer_address'] = self.peer_address + if hasattr(self, 'psk') and self.psk is not None: + _dict['psk'] = self.psk + if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: + _dict['local_cidrs'] = self.local_cidrs + if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: + _dict['peer_cidrs'] = self.peer_cidrs return _dict def _to_dict(self): @@ -61567,181 +67861,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetPrototypeSubnetByCIDR object.""" + """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool: + def __eq__( + self, other: + 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype' + ) -> 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: 'SubnetPrototypeSubnetByCIDR') -> bool: + def __ne__( + self, other: + 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class IpVersionEnum(str, Enum): - """ - The IP version(s) to support for this subnet. - """ - IPV4 = 'ipv4' - -class SubnetPrototypeSubnetByTotalCount(SubnetPrototype): +class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( + VPNGatewayConnectionPrototype): """ - SubnetPrototypeSubnetByTotalCount. + VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype. - :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this - subnet. If unspecified, the default network ACL for the VPC is used. - :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to - handle internet bound traffic for this subnet. - :attr ResourceGroupIdentity resource_group: (optional) - :attr RoutingTableIdentity routing_table: (optional) The routing table to use - for this subnet. If unspecified, the default routing table for the VPC is used. - The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet is to be a part of. - :attr int total_ipv4_address_count: The total number of IPv4 addresses required. - Must be a power of 2. The VPC must have a default address prefix in the - specified zone, and that prefix must have a free CIDR range with at least this - number of addresses. - :attr ZoneIdentity zone: The zone this subnet will reside in. + :attr bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :attr str name: (optional) The user-defined name for this VPN gateway + connection. + :attr str peer_address: The IP address of the peer VPN gateway. + :attr str psk: The preshared key. + :attr str routing_protocol: (optional) Routing protocols are disabled for this + VPN gateway connection. """ def __init__(self, - vpc: 'VPCIdentity', - total_ipv4_address_count: int, - zone: 'ZoneIdentity', + peer_address: str, + psk: str, *, - ip_version: str = None, + admin_state_up: bool = None, + dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, + ike_policy: 'IKEPolicyIdentity' = None, + ipsec_policy: 'IPsecPolicyIdentity' = None, name: str = None, - network_acl: 'NetworkACLIdentity' = None, - public_gateway: 'PublicGatewayIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - routing_table: 'RoutingTableIdentity' = None) -> None: + routing_protocol: str = None) -> None: """ - Initialize a SubnetPrototypeSubnetByTotalCount object. + Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object. - :param VPCIdentity vpc: The VPC the subnet is to be a part of. - :param int total_ipv4_address_count: The total number of IPv4 addresses - required. Must be a power of 2. The VPC must have a default address prefix - in the specified zone, and that prefix must have a free CIDR range with at - least this number of addresses. - :param ZoneIdentity zone: The zone this subnet will reside in. - :param str ip_version: (optional) The IP version(s) to support for this - subnet. - :param str name: (optional) The user-defined name for this subnet. Names - must be unique within the VPC the subnet resides in. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param NetworkACLIdentity network_acl: (optional) The network ACL to use - for this subnet. If unspecified, the default network ACL for the VPC is - used. - :param PublicGatewayIdentity public_gateway: (optional) The public gateway - to handle internet bound traffic for this subnet. - :param ResourceGroupIdentity resource_group: (optional) - :param RoutingTableIdentity routing_table: (optional) The routing table to - use for this subnet. If unspecified, the default routing table for the VPC - is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. + :param str peer_address: The IP address of the peer VPN gateway. + :param str psk: The preshared key. + :param bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) + :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :param str name: (optional) The user-defined name for this VPN gateway + connection. + :param str routing_protocol: (optional) Routing protocols are disabled for + this VPN gateway connection. """ # pylint: disable=super-init-not-called - self.ip_version = ip_version + self.admin_state_up = admin_state_up + self.dead_peer_detection = dead_peer_detection + self.ike_policy = ike_policy + self.ipsec_policy = ipsec_policy self.name = name - self.network_acl = network_acl - self.public_gateway = public_gateway - self.resource_group = resource_group - self.routing_table = routing_table - self.vpc = vpc - self.total_ipv4_address_count = total_ipv4_address_count - self.zone = zone + self.peer_address = peer_address + self.psk = psk + self.routing_protocol = routing_protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByTotalCount': - """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype': + """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary.""" args = {} - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + if 'admin_state_up' in _dict: + args['admin_state_up'] = _dict.get('admin_state_up') + if 'dead_peer_detection' in _dict: + args[ + 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( + _dict.get('dead_peer_detection')) + if 'ike_policy' in _dict: + args['ike_policy'] = _dict.get('ike_policy') + if 'ipsec_policy' in _dict: + args['ipsec_policy'] = _dict.get('ipsec_policy') if 'name' in _dict: args['name'] = _dict.get('name') - if 'network_acl' in _dict: - args['network_acl'] = _dict.get('network_acl') - if 'public_gateway' in _dict: - args['public_gateway'] = _dict.get('public_gateway') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'routing_table' in _dict: - args['routing_table'] = _dict.get('routing_table') - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - else: - raise ValueError( - 'Required property \'vpc\' not present in SubnetPrototypeSubnetByTotalCount JSON' - ) - if 'total_ipv4_address_count' in _dict: - args['total_ipv4_address_count'] = _dict.get( - 'total_ipv4_address_count') + if 'peer_address' in _dict: + args['peer_address'] = _dict.get('peer_address') else: raise ValueError( - 'Required property \'total_ipv4_address_count\' not present in SubnetPrototypeSubnetByTotalCount JSON' + 'Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON' ) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'psk' in _dict: + args['psk'] = _dict.get('psk') else: raise ValueError( - 'Required property \'zone\' not present in SubnetPrototypeSubnetByTotalCount JSON' + 'Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON' ) + if 'routing_protocol' in _dict: + args['routing_protocol'] = _dict.get('routing_protocol') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary.""" + """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype 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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_acl') and self.network_acl is not None: - if isinstance(self.network_acl, dict): - _dict['network_acl'] = self.network_acl - else: - _dict['network_acl'] = self.network_acl.to_dict() - if hasattr(self, 'public_gateway') and self.public_gateway is not None: - if isinstance(self.public_gateway, dict): - _dict['public_gateway'] = self.public_gateway - else: - _dict['public_gateway'] = self.public_gateway.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'routing_table') and self.routing_table is not None: - if isinstance(self.routing_table, dict): - _dict['routing_table'] = self.routing_table - else: - _dict['routing_table'] = self.routing_table.to_dict() - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc + if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: + _dict['admin_state_up'] = self.admin_state_up + if hasattr( + self, + 'dead_peer_detection') and self.dead_peer_detection is not None: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if hasattr(self, 'ike_policy') and self.ike_policy is not None: + if isinstance(self.ike_policy, dict): + _dict['ike_policy'] = self.ike_policy else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'total_ipv4_address_count' - ) and self.total_ipv4_address_count is not None: - _dict['total_ipv4_address_count'] = self.total_ipv4_address_count - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + _dict['ike_policy'] = self.ike_policy.to_dict() + if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: + if isinstance(self.ipsec_policy, dict): + _dict['ipsec_policy'] = self.ipsec_policy else: - _dict['zone'] = self.zone.to_dict() + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'peer_address') and self.peer_address is not None: + _dict['peer_address'] = self.peer_address + if hasattr(self, 'psk') and self.psk is not None: + _dict['psk'] = self.psk + if hasattr(self, + 'routing_protocol') and self.routing_protocol is not None: + _dict['routing_protocol'] = self.routing_protocol return _dict def _to_dict(self): @@ -61749,64 +68012,270 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetPrototypeSubnetByTotalCount object.""" + """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool: + def __eq__( + self, other: + 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype' + ) -> 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: 'SubnetPrototypeSubnetByTotalCount') -> bool: + def __ne__( + self, other: + 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class IpVersionEnum(str, Enum): + class RoutingProtocolEnum(str, Enum): """ - The IP version(s) to support for this subnet. + Routing protocols are disabled for this VPN gateway connection. """ - IPV4 = 'ipv4' + NONE = 'none' -class VPCIdentityByCRN(VPCIdentity): +class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection): """ - VPCIdentityByCRN. + VPNGatewayConnectionStaticRouteMode. - :attr str crn: The CRN for this VPC. + :attr bool admin_state_up: If set to false, the VPN gateway connection is shut + down. + :attr str authentication_mode: The authentication mode. Only `psk` is currently + supported. + :attr datetime created_at: The date and time that this VPN gateway connection + was created. + :attr VPNGatewayConnectionDPD dead_peer_detection: + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :attr IKEPolicyReference ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :attr IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. + :attr str mode: The mode of the VPN gateway. + :attr str name: The user-defined name for this VPN gateway connection. + :attr str peer_address: The IP address of the peer VPN gateway. + :attr str psk: The preshared key. + :attr str resource_type: The resource type. + :attr str status: The status of a VPN gateway connection. + :attr str routing_protocol: Routing protocols are disabled for this VPN gateway + connection. + :attr List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN tunnel + configuration for this VPN gateway connection (in static route mode). """ - def __init__(self, crn: str) -> None: + def __init__(self, + admin_state_up: bool, + authentication_mode: str, + created_at: datetime, + dead_peer_detection: 'VPNGatewayConnectionDPD', + href: str, + id: str, + mode: str, + name: str, + peer_address: str, + psk: str, + resource_type: str, + status: str, + routing_protocol: str, + tunnels: List['VPNGatewayConnectionStaticRouteModeTunnel'], + *, + ike_policy: 'IKEPolicyReference' = None, + ipsec_policy: 'IPsecPolicyReference' = None) -> None: """ - Initialize a VPCIdentityByCRN object. + Initialize a VPNGatewayConnectionStaticRouteMode object. - :param str crn: The CRN for this VPC. + :param bool admin_state_up: If set to false, the VPN gateway connection is + shut down. + :param str authentication_mode: The authentication mode. Only `psk` is + currently supported. + :param datetime created_at: The date and time that this VPN gateway + connection was created. + :param VPNGatewayConnectionDPD dead_peer_detection: + :param str href: The VPN connection's canonical URL. + :param str id: The unique identifier for this VPN gateway connection. + :param str mode: The mode of the VPN gateway. + :param str name: The user-defined name for this VPN gateway connection. + :param str peer_address: The IP address of the peer VPN gateway. + :param str psk: The preshared key. + :param str resource_type: The resource type. + :param str status: The status of a VPN gateway connection. + :param str routing_protocol: Routing protocols are disabled for this VPN + gateway connection. + :param List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN + tunnel configuration for this VPN gateway connection (in static route + mode). + :param IKEPolicyReference ike_policy: (optional) Optional IKE policy + configuration. The absence of a policy indicates autonegotiation. + :param IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy + configuration. The absence of a policy indicates autonegotiation. """ # pylint: disable=super-init-not-called - self.crn = crn + self.admin_state_up = admin_state_up + self.authentication_mode = authentication_mode + self.created_at = created_at + self.dead_peer_detection = dead_peer_detection + self.href = href + self.id = id + self.ike_policy = ike_policy + self.ipsec_policy = ipsec_policy + self.mode = mode + self.name = name + self.peer_address = peer_address + self.psk = psk + self.resource_type = resource_type + self.status = status + self.routing_protocol = routing_protocol + self.tunnels = tunnels @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCIdentityByCRN': - """Initialize a VPCIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteMode': + """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'admin_state_up' in _dict: + args['admin_state_up'] = _dict.get('admin_state_up') else: raise ValueError( - 'Required property \'crn\' not present in VPCIdentityByCRN JSON' + 'Required property \'admin_state_up\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'authentication_mode' in _dict: + args['authentication_mode'] = _dict.get('authentication_mode') + else: + raise ValueError( + 'Required property \'authentication_mode\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'dead_peer_detection' in _dict: + args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict( + _dict.get('dead_peer_detection')) + else: + raise ValueError( + 'Required property \'dead_peer_detection\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'ike_policy' in _dict: + args['ike_policy'] = IKEPolicyReference.from_dict( + _dict.get('ike_policy')) + if 'ipsec_policy' in _dict: + args['ipsec_policy'] = IPsecPolicyReference.from_dict( + _dict.get('ipsec_policy')) + if 'mode' in _dict: + args['mode'] = _dict.get('mode') + else: + raise ValueError( + 'Required property \'mode\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'peer_address' in _dict: + args['peer_address'] = _dict.get('peer_address') + else: + raise ValueError( + 'Required property \'peer_address\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'psk' in _dict: + args['psk'] = _dict.get('psk') + else: + raise ValueError( + 'Required property \'psk\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError( + 'Required property \'status\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'routing_protocol' in _dict: + args['routing_protocol'] = _dict.get('routing_protocol') + else: + raise ValueError( + 'Required property \'routing_protocol\' not present in VPNGatewayConnectionStaticRouteMode JSON' + ) + if 'tunnels' in _dict: + args['tunnels'] = [ + VPNGatewayConnectionStaticRouteModeTunnel.from_dict(x) + for x in _dict.get('tunnels') + ] + else: + raise ValueError( + 'Required property \'tunnels\' not present in VPNGatewayConnectionStaticRouteMode JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCIdentityByCRN object from a json dictionary.""" + """Initialize a VPNGatewayConnectionStaticRouteMode 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, 'admin_state_up') and self.admin_state_up is not None: + _dict['admin_state_up'] = self.admin_state_up + if hasattr( + self, + 'authentication_mode') and self.authentication_mode is not None: + _dict['authentication_mode'] = self.authentication_mode + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr( + self, + 'dead_peer_detection') and self.dead_peer_detection is not None: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ike_policy') and self.ike_policy is not None: + _dict['ike_policy'] = self.ike_policy.to_dict() + if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'peer_address') and self.peer_address is not None: + _dict['peer_address'] = self.peer_address + if hasattr(self, 'psk') and self.psk is not None: + _dict['psk'] = self.psk + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, + 'routing_protocol') and self.routing_protocol is not None: + _dict['routing_protocol'] = self.routing_protocol + if hasattr(self, 'tunnels') and self.tunnels is not None: + _dict['tunnels'] = [x.to_dict() for x in self.tunnels] return _dict def _to_dict(self): @@ -61814,58 +68283,226 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCIdentityByCRN object.""" + """Return a `str` version of this VPNGatewayConnectionStaticRouteMode object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCIdentityByCRN') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> 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: 'VPCIdentityByCRN') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AuthenticationModeEnum(str, Enum): + """ + The authentication mode. Only `psk` is currently supported. + """ + PSK = 'psk' -class VPCIdentityByHref(VPCIdentity): + class ModeEnum(str, Enum): + """ + The mode of the VPN gateway. + """ + POLICY = 'policy' + ROUTE = 'route' + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' + + class StatusEnum(str, Enum): + """ + The status of a VPN gateway connection. + """ + DOWN = 'down' + UP = 'up' + + class RoutingProtocolEnum(str, Enum): + """ + Routing protocols are disabled for this VPN gateway connection. + """ + NONE = 'none' + + +class VPNGatewayPolicyMode(VPNGateway): """ - VPCIdentityByHref. + VPNGatewayPolicyMode. - :attr str href: The URL for this VPC. + :attr List[VPNGatewayConnectionReference] connections: Collection of references + to VPN gateway connections. + :attr datetime created_at: The date and time that this VPN gateway was created. + :attr str crn: The VPN gateway's CRN. + :attr str href: The VPN gateway's canonical URL. + :attr str id: The unique identifier for this VPN gateway. + :attr List[VPNGatewayMember] members: Collection of VPN gateway members. + :attr str name: The user-defined name for this VPN gateway. + :attr ResourceGroupReference resource_group: The resource group for this VPN + gateway. + :attr str resource_type: The resource type. + :attr str status: The status of the VPN gateway. + :attr SubnetReference subnet: + :attr str mode: Policy mode VPN gateway. """ - def __init__(self, href: str) -> None: + def __init__(self, connections: List['VPNGatewayConnectionReference'], + created_at: datetime, crn: str, href: str, id: str, + members: List['VPNGatewayMember'], name: str, + resource_group: 'ResourceGroupReference', resource_type: str, + status: str, subnet: 'SubnetReference', mode: str) -> None: """ - Initialize a VPCIdentityByHref object. + Initialize a VPNGatewayPolicyMode object. - :param str href: The URL for this VPC. + :param List[VPNGatewayConnectionReference] connections: Collection of + references to VPN gateway connections. + :param datetime created_at: The date and time that this VPN gateway was + created. + :param str crn: The VPN gateway's CRN. + :param str href: The VPN gateway's canonical URL. + :param str id: The unique identifier for this VPN gateway. + :param List[VPNGatewayMember] members: Collection of VPN gateway members. + :param str name: The user-defined name for this VPN gateway. + :param ResourceGroupReference resource_group: The resource group for this + VPN gateway. + :param str resource_type: The resource type. + :param str status: The status of the VPN gateway. + :param SubnetReference subnet: + :param str mode: Policy mode VPN gateway. """ # pylint: disable=super-init-not-called + self.connections = connections + self.created_at = created_at + self.crn = crn self.href = href + self.id = id + self.members = members + self.name = name + self.resource_group = resource_group + self.resource_type = resource_type + self.status = status + self.subnet = subnet + self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCIdentityByHref': - """Initialize a VPCIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode': + """Initialize a VPNGatewayPolicyMode object from a json dictionary.""" args = {} + if 'connections' in _dict: + args['connections'] = [ + VPNGatewayConnectionReference.from_dict(x) + for x in _dict.get('connections') + ] + else: + raise ValueError( + 'Required property \'connections\' not present in VPNGatewayPolicyMode JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in VPNGatewayPolicyMode JSON' + ) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError( + 'Required property \'crn\' not present in VPNGatewayPolicyMode JSON' + ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in VPCIdentityByHref JSON' + 'Required property \'href\' not present in VPNGatewayPolicyMode JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in VPNGatewayPolicyMode JSON' + ) + if 'members' in _dict: + args['members'] = [ + VPNGatewayMember.from_dict(x) for x in _dict.get('members') + ] + else: + raise ValueError( + 'Required property \'members\' not present in VPNGatewayPolicyMode JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in VPNGatewayPolicyMode JSON' + ) + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict( + _dict.get('resource_group')) + else: + raise ValueError( + 'Required property \'resource_group\' not present in VPNGatewayPolicyMode JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in VPNGatewayPolicyMode JSON' + ) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError( + 'Required property \'status\' not present in VPNGatewayPolicyMode JSON' + ) + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError( + 'Required property \'subnet\' not present in VPNGatewayPolicyMode JSON' + ) + if 'mode' in _dict: + args['mode'] = _dict.get('mode') + else: + raise ValueError( + 'Required property \'mode\' not present in VPNGatewayPolicyMode JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCIdentityByHref object from a json dictionary.""" + """Initialize a VPNGatewayPolicyMode 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, 'connections') and self.connections is not None: + _dict['connections'] = [x.to_dict() for x in self.connections] + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'members') and self.members is not None: + _dict['members'] = [x.to_dict() for x in self.members] + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'subnet') and self.subnet is not None: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -61873,57 +68510,113 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCIdentityByHref object.""" + """Return a `str` version of this VPNGatewayPolicyMode object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCIdentityByHref') -> bool: + def __eq__(self, other: 'VPNGatewayPolicyMode') -> 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: 'VPCIdentityByHref') -> bool: + def __ne__(self, other: 'VPNGatewayPolicyMode') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + VPN_GATEWAY = 'vpn_gateway' + + class StatusEnum(str, Enum): + """ + The status of the VPN gateway. + """ + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + class ModeEnum(str, Enum): + """ + Policy mode VPN gateway. + """ + POLICY = 'policy' -class VPCIdentityById(VPCIdentity): + +class VPNGatewayPrototypeVPNGatewayPolicyModePrototype(VPNGatewayPrototype): """ - VPCIdentityById. + VPNGatewayPrototypeVPNGatewayPolicyModePrototype. - :attr str id: The unique identifier for this VPC. + :attr str name: (optional) The user-defined name for this VPN gateway. + :attr ResourceGroupIdentity resource_group: (optional) + :attr SubnetIdentity subnet: + :attr str mode: (optional) Policy mode VPN gateway. """ - def __init__(self, id: str) -> None: + def __init__(self, + subnet: 'SubnetIdentity', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + mode: str = None) -> None: """ - Initialize a VPCIdentityById object. + Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object. - :param str id: The unique identifier for this VPC. + :param SubnetIdentity subnet: + :param str name: (optional) The user-defined name for this VPN gateway. + :param ResourceGroupIdentity resource_group: (optional) + :param str mode: (optional) Policy mode VPN gateway. """ # pylint: disable=super-init-not-called - self.id = id + self.name = name + self.resource_group = resource_group + self.subnet = subnet + self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCIdentityById': - """Initialize a VPCIdentityById object from a json dictionary.""" + def from_dict( + cls, + _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype': + """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: raise ValueError( - 'Required property \'id\' not present in VPCIdentityById JSON') + 'Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayPolicyModePrototype JSON' + ) + if 'mode' in _dict: + args['mode'] = _dict.get('mode') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCIdentityById object from a json dictionary.""" + """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -61931,136 +68624,102 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCIdentityById object.""" + """Return a `str` version of this VPNGatewayPrototypeVPNGatewayPolicyModePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCIdentityById') -> bool: + def __eq__( + self, + other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> 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: 'VPCIdentityById') -> bool: + def __ne__( + self, + other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ModeEnum(str, Enum): + """ + Policy mode VPN gateway. + """ + POLICY = 'policy' + -class VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch( - VPNGatewayConnectionPatch): +class VPNGatewayPrototypeVPNGatewayRouteModePrototype(VPNGatewayPrototype): """ - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch. + VPNGatewayPrototypeVPNGatewayRouteModePrototype. - :attr bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :attr str name: (optional) The user-defined name for this VPN gateway - connection. - :attr str peer_address: (optional) The IP address of the peer VPN gateway. - :attr str psk: (optional) The preshared key. - :attr str routing_protocol: (optional) Routing protocols are disabled for this - VPN gateway connection. + :attr str name: (optional) The user-defined name for this VPN gateway. + :attr ResourceGroupIdentity resource_group: (optional) + :attr SubnetIdentity subnet: + :attr str mode: (optional) Route mode VPN gateway. """ def __init__(self, + subnet: 'SubnetIdentity', *, - admin_state_up: bool = None, - dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, - ike_policy: 'IKEPolicyIdentity' = None, - ipsec_policy: 'IPsecPolicyIdentity' = None, name: str = None, - peer_address: str = None, - psk: str = None, - routing_protocol: str = None) -> None: + resource_group: 'ResourceGroupIdentity' = None, + mode: str = None) -> None: """ - Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object. + Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object. - :param bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :param str name: (optional) The user-defined name for this VPN gateway - connection. - :param str peer_address: (optional) The IP address of the peer VPN gateway. - :param str psk: (optional) The preshared key. - :param str routing_protocol: (optional) Routing protocols are disabled for - this VPN gateway connection. + :param SubnetIdentity subnet: + :param str name: (optional) The user-defined name for this VPN gateway. + :param ResourceGroupIdentity resource_group: (optional) + :param str mode: (optional) Route mode VPN gateway. """ # pylint: disable=super-init-not-called - self.admin_state_up = admin_state_up - self.dead_peer_detection = dead_peer_detection - self.ike_policy = ike_policy - self.ipsec_policy = ipsec_policy self.name = name - self.peer_address = peer_address - self.psk = psk - self.routing_protocol = routing_protocol + self.resource_group = resource_group + self.subnet = subnet + self.mode = mode @classmethod def from_dict( - cls, _dict: Dict - ) -> 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch': - """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object from a json dictionary.""" + cls, + _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayRouteModePrototype': + """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary.""" args = {} - if 'admin_state_up' in _dict: - args['admin_state_up'] = _dict.get('admin_state_up') - if 'dead_peer_detection' in _dict: - args[ - 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( - _dict.get('dead_peer_detection')) - if 'ike_policy' in _dict: - args['ike_policy'] = _dict.get('ike_policy') - if 'ipsec_policy' in _dict: - args['ipsec_policy'] = _dict.get('ipsec_policy') if 'name' in _dict: args['name'] = _dict.get('name') - if 'peer_address' in _dict: - args['peer_address'] = _dict.get('peer_address') - if 'psk' in _dict: - args['psk'] = _dict.get('psk') - if 'routing_protocol' in _dict: - args['routing_protocol'] = _dict.get('routing_protocol') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') + else: + raise ValueError( + 'Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayRouteModePrototype JSON' + ) + if 'mode' in _dict: + args['mode'] = _dict.get('mode') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object from a json dictionary.""" + """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype 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, 'admin_state_up') and self.admin_state_up is not None: - _dict['admin_state_up'] = self.admin_state_up - if hasattr( - self, - 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() - if hasattr(self, 'ike_policy') and self.ike_policy is not None: - if isinstance(self.ike_policy, dict): - _dict['ike_policy'] = self.ike_policy - else: - _dict['ike_policy'] = self.ike_policy.to_dict() - if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - if isinstance(self.ipsec_policy, dict): - _dict['ipsec_policy'] = self.ipsec_policy - else: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'peer_address') and self.peer_address is not None: - _dict['peer_address'] = self.peer_address - if hasattr(self, 'psk') and self.psk is not None: - _dict['psk'] = self.psk - if hasattr(self, - 'routing_protocol') and self.routing_protocol is not None: - _dict['routing_protocol'] = self.routing_protocol + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -62068,262 +68727,204 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object.""" + """Return a `str` version of this VPNGatewayPrototypeVPNGatewayRouteModePrototype object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch' - ) -> bool: + self, + other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> 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: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch' - ) -> bool: + self, + other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RoutingProtocolEnum(str, Enum): + class ModeEnum(str, Enum): """ - Routing protocols are disabled for this VPN gateway connection. + Route mode VPN gateway. """ - NONE = 'none' + ROUTE = 'route' -class VPNGatewayConnectionPolicyMode(VPNGatewayConnection): +class VPNGatewayRouteMode(VPNGateway): """ - VPNGatewayConnectionPolicyMode. + VPNGatewayRouteMode. - :attr bool admin_state_up: If set to false, the VPN gateway connection is shut - down. - :attr str authentication_mode: The authentication mode. Only `psk` is currently - supported. - :attr datetime created_at: The date and time that this VPN gateway connection - was created. - :attr VPNGatewayConnectionDPD dead_peer_detection: - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :attr IKEPolicyReference ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :attr IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :attr str mode: The mode of the VPN gateway. - :attr str name: The user-defined name for this VPN gateway connection. - :attr str peer_address: The IP address of the peer VPN gateway. - :attr str psk: The preshared key. + :attr List[VPNGatewayConnectionReference] connections: Collection of references + to VPN gateway connections. + :attr datetime created_at: The date and time that this VPN gateway was created. + :attr str crn: The VPN gateway's CRN. + :attr str href: The VPN gateway's canonical URL. + :attr str id: The unique identifier for this VPN gateway. + :attr List[VPNGatewayMember] members: Collection of VPN gateway members. + :attr str name: The user-defined name for this VPN gateway. + :attr ResourceGroupReference resource_group: The resource group for this VPN + gateway. :attr str resource_type: The resource type. - :attr str status: The status of a VPN gateway connection. - :attr List[str] local_cidrs: A collection of local CIDRs for this resource. - :attr List[str] peer_cidrs: A collection of peer CIDRs for this resource. + :attr str status: The status of the VPN gateway. + :attr SubnetReference subnet: + :attr str mode: Route mode VPN gateway. """ - def __init__(self, - admin_state_up: bool, - authentication_mode: str, - created_at: datetime, - dead_peer_detection: 'VPNGatewayConnectionDPD', - href: str, - id: str, - mode: str, - name: str, - peer_address: str, - psk: str, - resource_type: str, - status: str, - local_cidrs: List[str], - peer_cidrs: List[str], - *, - ike_policy: 'IKEPolicyReference' = None, - ipsec_policy: 'IPsecPolicyReference' = None) -> None: + def __init__(self, connections: List['VPNGatewayConnectionReference'], + created_at: datetime, crn: str, href: str, id: str, + members: List['VPNGatewayMember'], name: str, + resource_group: 'ResourceGroupReference', resource_type: str, + status: str, subnet: 'SubnetReference', mode: str) -> None: """ - Initialize a VPNGatewayConnectionPolicyMode object. + Initialize a VPNGatewayRouteMode object. - :param bool admin_state_up: If set to false, the VPN gateway connection is - shut down. - :param str authentication_mode: The authentication mode. Only `psk` is - currently supported. - :param datetime created_at: The date and time that this VPN gateway - connection was created. - :param VPNGatewayConnectionDPD dead_peer_detection: - :param str href: The VPN connection's canonical URL. - :param str id: The unique identifier for this VPN gateway connection. - :param str mode: The mode of the VPN gateway. - :param str name: The user-defined name for this VPN gateway connection. - :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. + :param List[VPNGatewayConnectionReference] connections: Collection of + references to VPN gateway connections. + :param datetime created_at: The date and time that this VPN gateway was + created. + :param str crn: The VPN gateway's CRN. + :param str href: The VPN gateway's canonical URL. + :param str id: The unique identifier for this VPN gateway. + :param List[VPNGatewayMember] members: Collection of VPN gateway members. + :param str name: The user-defined name for this VPN gateway. + :param ResourceGroupReference resource_group: The resource group for this + VPN gateway. :param str resource_type: The resource type. - :param str status: The status of a VPN gateway connection. - :param List[str] local_cidrs: A collection of local CIDRs for this - resource. - :param List[str] peer_cidrs: A collection of peer CIDRs for this resource. - :param IKEPolicyReference ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :param IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. + :param str status: The status of the VPN gateway. + :param SubnetReference subnet: + :param str mode: Route mode VPN gateway. """ # pylint: disable=super-init-not-called - self.admin_state_up = admin_state_up - self.authentication_mode = authentication_mode + self.connections = connections self.created_at = created_at - self.dead_peer_detection = dead_peer_detection + self.crn = crn self.href = href self.id = id - self.ike_policy = ike_policy - self.ipsec_policy = ipsec_policy - self.mode = mode + self.members = members self.name = name - self.peer_address = peer_address - self.psk = psk + self.resource_group = resource_group self.resource_type = resource_type self.status = status - self.local_cidrs = local_cidrs - self.peer_cidrs = peer_cidrs + self.subnet = subnet + self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPolicyMode': - """Initialize a VPNGatewayConnectionPolicyMode object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode': + """Initialize a VPNGatewayRouteMode object from a json dictionary.""" args = {} - if 'admin_state_up' in _dict: - args['admin_state_up'] = _dict.get('admin_state_up') - else: - raise ValueError( - 'Required property \'admin_state_up\' not present in VPNGatewayConnectionPolicyMode JSON' - ) - if 'authentication_mode' in _dict: - args['authentication_mode'] = _dict.get('authentication_mode') + if 'connections' in _dict: + args['connections'] = [ + VPNGatewayConnectionReference.from_dict(x) + for x in _dict.get('connections') + ] else: raise ValueError( - 'Required property \'authentication_mode\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'connections\' not present in VPNGatewayRouteMode JSON' ) if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError( - 'Required property \'created_at\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'created_at\' not present in VPNGatewayRouteMode JSON' ) - if 'dead_peer_detection' in _dict: - args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict( - _dict.get('dead_peer_detection')) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'dead_peer_detection\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'crn\' not present in VPNGatewayRouteMode JSON' ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'href\' not present in VPNGatewayRouteMode JSON' ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'id\' not present in VPNGatewayRouteMode JSON' ) - if 'ike_policy' in _dict: - args['ike_policy'] = IKEPolicyReference.from_dict( - _dict.get('ike_policy')) - if 'ipsec_policy' in _dict: - args['ipsec_policy'] = IPsecPolicyReference.from_dict( - _dict.get('ipsec_policy')) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') + if 'members' in _dict: + args['members'] = [ + VPNGatewayMember.from_dict(x) for x in _dict.get('members') + ] else: raise ValueError( - 'Required property \'mode\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'members\' not present in VPNGatewayRouteMode JSON' ) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( - 'Required property \'name\' not present in VPNGatewayConnectionPolicyMode JSON' - ) - if 'peer_address' in _dict: - args['peer_address'] = _dict.get('peer_address') - else: - raise ValueError( - 'Required property \'peer_address\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'name\' not present in VPNGatewayRouteMode JSON' ) - if 'psk' in _dict: - args['psk'] = _dict.get('psk') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict( + _dict.get('resource_group')) else: raise ValueError( - 'Required property \'psk\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'resource_group\' not present in VPNGatewayRouteMode JSON' ) if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: raise ValueError( - 'Required property \'resource_type\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'resource_type\' not present in VPNGatewayRouteMode JSON' ) if 'status' in _dict: args['status'] = _dict.get('status') else: raise ValueError( - 'Required property \'status\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'status\' not present in VPNGatewayRouteMode JSON' ) - if 'local_cidrs' in _dict: - args['local_cidrs'] = _dict.get('local_cidrs') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) else: raise ValueError( - 'Required property \'local_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'subnet\' not present in VPNGatewayRouteMode JSON' ) - if 'peer_cidrs' in _dict: - args['peer_cidrs'] = _dict.get('peer_cidrs') + if 'mode' in _dict: + args['mode'] = _dict.get('mode') else: raise ValueError( - 'Required property \'peer_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON' + 'Required property \'mode\' not present in VPNGatewayRouteMode JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionPolicyMode 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, 'admin_state_up') and self.admin_state_up is not None: - _dict['admin_state_up'] = self.admin_state_up - if hasattr( - self, - 'authentication_mode') and self.authentication_mode is not None: - _dict['authentication_mode'] = self.authentication_mode + """Initialize a VPNGatewayRouteMode 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, 'connections') and self.connections is not None: + _dict['connections'] = [x.to_dict() for x in self.connections] if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr( - self, - 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'ike_policy') and self.ike_policy is not None: - _dict['ike_policy'] = self.ike_policy.to_dict() - if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'members') and self.members is not None: + _dict['members'] = [x.to_dict() for x in self.members] if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'peer_address') and self.peer_address is not None: - _dict['peer_address'] = self.peer_address - if hasattr(self, 'psk') and self.psk is not None: - _dict['psk'] = self.psk + if hasattr(self, 'resource_group') and self.resource_group is not None: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status - if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: - _dict['local_cidrs'] = self.local_cidrs - if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: - _dict['peer_cidrs'] = self.peer_cidrs + if hasattr(self, 'subnet') and self.subnet is not None: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -62331,184 +68932,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionPolicyMode object.""" + """Return a `str` version of this VPNGatewayRouteMode object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool: + def __eq__(self, other: 'VPNGatewayRouteMode') -> 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: 'VPNGatewayConnectionPolicyMode') -> bool: + def __ne__(self, other: 'VPNGatewayRouteMode') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationModeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The authentication mode. Only `psk` is currently supported. + The resource type. """ - PSK = 'psk' + VPN_GATEWAY = 'vpn_gateway' - class ModeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The mode of the VPN gateway. + The status of the VPN gateway. """ - POLICY = 'policy' - ROUTE = 'route' + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' - class ResourceTypeEnum(str, Enum): + class ModeEnum(str, Enum): """ - The resource type. + Route mode VPN gateway. """ - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' + ROUTE = 'route' - class StatusEnum(str, Enum): + +class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity( + VolumeAttachmentVolumePrototypeInstanceContext): + """ + Identifies a volume by a unique property. + + """ + + def __init__(self) -> None: """ - The status of a VPN gateway connection. + Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity object. + """ - DOWN = 'down' - UP = 'up' + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById', + 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN', + 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref' + ])) + raise Exception(msg) -class VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype( - VPNGatewayConnectionPrototype): +class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext( + VolumeAttachmentVolumePrototypeInstanceContext): """ - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype. + VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext. - :attr bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :attr str name: (optional) The user-defined name for this VPN gateway - connection. - :attr str peer_address: The IP address of the peer VPN gateway. - :attr str psk: The preshared key. - :attr List[str] local_cidrs: A collection of local CIDRs for this resource. - :attr List[str] peer_cidrs: A collection of peer CIDRs for this resource. + :attr int iops: (optional) The bandwidth for the volume. + :attr str name: (optional) The unique user-defined name for this volume. + :attr VolumeProfileIdentity profile: The profile to use for this volume. """ def __init__(self, - peer_address: str, - psk: str, - local_cidrs: List[str], - peer_cidrs: List[str], + profile: 'VolumeProfileIdentity', *, - admin_state_up: bool = None, - dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, - ike_policy: 'IKEPolicyIdentity' = None, - ipsec_policy: 'IPsecPolicyIdentity' = None, + iops: int = None, name: str = None) -> None: """ - Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object. + Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext object. - :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. - :param List[str] local_cidrs: A collection of local CIDRs for this - resource. - :param List[str] peer_cidrs: A collection of peer CIDRs for this resource. - :param bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param VolumeProfileIdentity profile: The profile to use for this volume. + :param int iops: (optional) The bandwidth for the volume. + :param str name: (optional) The unique user-defined name for this volume. """ # pylint: disable=super-init-not-called - self.admin_state_up = admin_state_up - self.dead_peer_detection = dead_peer_detection - self.ike_policy = ike_policy - self.ipsec_policy = ipsec_policy - self.name = name - self.peer_address = peer_address - self.psk = psk - self.local_cidrs = local_cidrs - self.peer_cidrs = peer_cidrs + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity' + ])) + raise Exception(msg) + + +class VolumeIdentityByCRN(VolumeIdentity): + """ + VolumeIdentityByCRN. + + :attr str crn: The CRN for this volume. + """ + + def __init__(self, crn: str) -> None: + """ + Initialize a VolumeIdentityByCRN object. + + :param str crn: The CRN for this volume. + """ + # pylint: disable=super-init-not-called + self.crn = crn @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype': - """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByCRN': + """Initialize a VolumeIdentityByCRN object from a json dictionary.""" args = {} - if 'admin_state_up' in _dict: - args['admin_state_up'] = _dict.get('admin_state_up') - if 'dead_peer_detection' in _dict: - args[ - 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( - _dict.get('dead_peer_detection')) - if 'ike_policy' in _dict: - args['ike_policy'] = _dict.get('ike_policy') - if 'ipsec_policy' in _dict: - args['ipsec_policy'] = _dict.get('ipsec_policy') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'peer_address' in _dict: - args['peer_address'] = _dict.get('peer_address') - else: - raise ValueError( - 'Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' - ) - if 'psk' in _dict: - args['psk'] = _dict.get('psk') - else: - raise ValueError( - 'Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' - ) - if 'local_cidrs' in _dict: - args['local_cidrs'] = _dict.get('local_cidrs') - else: - raise ValueError( - 'Required property \'local_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' - ) - if 'peer_cidrs' in _dict: - args['peer_cidrs'] = _dict.get('peer_cidrs') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'peer_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON' + 'Required property \'crn\' not present in VolumeIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary.""" + """Initialize a VolumeIdentityByCRN 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, 'admin_state_up') and self.admin_state_up is not None: - _dict['admin_state_up'] = self.admin_state_up - if hasattr( - self, - 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() - if hasattr(self, 'ike_policy') and self.ike_policy is not None: - if isinstance(self.ike_policy, dict): - _dict['ike_policy'] = self.ike_policy - else: - _dict['ike_policy'] = self.ike_policy.to_dict() - if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - if isinstance(self.ipsec_policy, dict): - _dict['ipsec_policy'] = self.ipsec_policy - else: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'peer_address') and self.peer_address is not None: - _dict['peer_address'] = self.peer_address - if hasattr(self, 'psk') and self.psk is not None: - _dict['psk'] = self.psk - if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: - _dict['local_cidrs'] = self.local_cidrs - if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: - _dict['peer_cidrs'] = self.peer_cidrs + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -62516,150 +69064,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object.""" + """Return a `str` version of this VolumeIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: - 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype' - ) -> bool: + def __eq__(self, other: 'VolumeIdentityByCRN') -> 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: - 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype' - ) -> bool: + def __ne__(self, other: 'VolumeIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( - VPNGatewayConnectionPrototype): +class VolumeIdentityByHref(VolumeIdentity): """ - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype. + VolumeIdentityByHref. - :attr bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :attr IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :attr IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :attr str name: (optional) The user-defined name for this VPN gateway - connection. - :attr str peer_address: The IP address of the peer VPN gateway. - :attr str psk: The preshared key. - :attr str routing_protocol: (optional) Routing protocols are disabled for this - VPN gateway connection. + :attr str href: The URL for this volume. """ - def __init__(self, - peer_address: str, - psk: str, - *, - admin_state_up: bool = None, - dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, - ike_policy: 'IKEPolicyIdentity' = None, - ipsec_policy: 'IPsecPolicyIdentity' = None, - name: str = None, - routing_protocol: str = None) -> None: + def __init__(self, href: str) -> None: """ - Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object. + Initialize a VolumeIdentityByHref object. - :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. - :param bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) - :param IKEPolicyIdentity ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :param IPsecPolicyIdentity ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :param str name: (optional) The user-defined name for this VPN gateway - connection. - :param str routing_protocol: (optional) Routing protocols are disabled for - this VPN gateway connection. + :param str href: The URL for this volume. """ # pylint: disable=super-init-not-called - self.admin_state_up = admin_state_up - self.dead_peer_detection = dead_peer_detection - self.ike_policy = ike_policy - self.ipsec_policy = ipsec_policy - self.name = name - self.peer_address = peer_address - self.psk = psk - self.routing_protocol = routing_protocol + self.href = href @classmethod - def from_dict( - cls, _dict: Dict - ) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype': - """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByHref': + """Initialize a VolumeIdentityByHref object from a json dictionary.""" args = {} - if 'admin_state_up' in _dict: - args['admin_state_up'] = _dict.get('admin_state_up') - if 'dead_peer_detection' in _dict: - args[ - 'dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict( - _dict.get('dead_peer_detection')) - if 'ike_policy' in _dict: - args['ike_policy'] = _dict.get('ike_policy') - if 'ipsec_policy' in _dict: - args['ipsec_policy'] = _dict.get('ipsec_policy') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'peer_address' in _dict: - args['peer_address'] = _dict.get('peer_address') - else: - raise ValueError( - 'Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON' - ) - if 'psk' in _dict: - args['psk'] = _dict.get('psk') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON' + 'Required property \'href\' not present in VolumeIdentityByHref JSON' ) - if 'routing_protocol' in _dict: - args['routing_protocol'] = _dict.get('routing_protocol') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary.""" + """Initialize a VolumeIdentityByHref 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, 'admin_state_up') and self.admin_state_up is not None: - _dict['admin_state_up'] = self.admin_state_up - if hasattr( - self, - 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() - if hasattr(self, 'ike_policy') and self.ike_policy is not None: - if isinstance(self.ike_policy, dict): - _dict['ike_policy'] = self.ike_policy - else: - _dict['ike_policy'] = self.ike_policy.to_dict() - if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - if isinstance(self.ipsec_policy, dict): - _dict['ipsec_policy'] = self.ipsec_policy - else: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'peer_address') and self.peer_address is not None: - _dict['peer_address'] = self.peer_address - if hasattr(self, 'psk') and self.psk is not None: - _dict['psk'] = self.psk - if hasattr(self, - 'routing_protocol') and self.routing_protocol is not None: - _dict['routing_protocol'] = self.routing_protocol + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -62667,270 +69123,117 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object.""" + """Return a `str` version of this VolumeIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: - 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype' - ) -> bool: + def __eq__(self, other: 'VolumeIdentityByHref') -> 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: - 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype' - ) -> bool: + def __ne__(self, other: 'VolumeIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RoutingProtocolEnum(str, Enum): + +class VolumeIdentityById(VolumeIdentity): + """ + VolumeIdentityById. + + :attr str id: The unique identifier for this volume. + """ + + def __init__(self, id: str) -> None: """ - Routing protocols are disabled for this VPN gateway connection. + Initialize a VolumeIdentityById object. + + :param str id: The unique identifier for this volume. """ - NONE = 'none' + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeIdentityById': + """Initialize a VolumeIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in VolumeIdentityById JSON' + ) + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeIdentityById object from a json dictionary.""" + return cls.from_dict(_dict) -class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection): + 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 VolumeIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumeIdentityById') -> 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: 'VolumeIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VolumeProfileIdentityByHref(VolumeProfileIdentity): """ - VPNGatewayConnectionStaticRouteMode. + VolumeProfileIdentityByHref. - :attr bool admin_state_up: If set to false, the VPN gateway connection is shut - down. - :attr str authentication_mode: The authentication mode. Only `psk` is currently - supported. - :attr datetime created_at: The date and time that this VPN gateway connection - was created. - :attr VPNGatewayConnectionDPD dead_peer_detection: - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :attr IKEPolicyReference ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :attr IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. - :attr str mode: The mode of the VPN gateway. - :attr str name: The user-defined name for this VPN gateway connection. - :attr str peer_address: The IP address of the peer VPN gateway. - :attr str psk: The preshared key. - :attr str resource_type: The resource type. - :attr str status: The status of a VPN gateway connection. - :attr str routing_protocol: Routing protocols are disabled for this VPN gateway - connection. - :attr List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN tunnel - configuration for this VPN gateway connection (in static route mode). + :attr str href: The URL for this volume profile. """ - def __init__(self, - admin_state_up: bool, - authentication_mode: str, - created_at: datetime, - dead_peer_detection: 'VPNGatewayConnectionDPD', - href: str, - id: str, - mode: str, - name: str, - peer_address: str, - psk: str, - resource_type: str, - status: str, - routing_protocol: str, - tunnels: List['VPNGatewayConnectionStaticRouteModeTunnel'], - *, - ike_policy: 'IKEPolicyReference' = None, - ipsec_policy: 'IPsecPolicyReference' = None) -> None: + def __init__(self, href: str) -> None: """ - Initialize a VPNGatewayConnectionStaticRouteMode object. - - :param bool admin_state_up: If set to false, the VPN gateway connection is - shut down. - :param str authentication_mode: The authentication mode. Only `psk` is - currently supported. - :param datetime created_at: The date and time that this VPN gateway - connection was created. - :param VPNGatewayConnectionDPD dead_peer_detection: - :param str href: The VPN connection's canonical URL. - :param str id: The unique identifier for this VPN gateway connection. - :param str mode: The mode of the VPN gateway. - :param str name: The user-defined name for this VPN gateway connection. - :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. - :param str resource_type: The resource type. - :param str status: The status of a VPN gateway connection. - :param str routing_protocol: Routing protocols are disabled for this VPN - gateway connection. - :param List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN - tunnel configuration for this VPN gateway connection (in static route - mode). - :param IKEPolicyReference ike_policy: (optional) Optional IKE policy - configuration. The absence of a policy indicates autonegotiation. - :param IPsecPolicyReference ipsec_policy: (optional) Optional IPsec policy - configuration. The absence of a policy indicates autonegotiation. + Initialize a VolumeProfileIdentityByHref object. + + :param str href: The URL for this volume profile. """ # pylint: disable=super-init-not-called - self.admin_state_up = admin_state_up - self.authentication_mode = authentication_mode - self.created_at = created_at - self.dead_peer_detection = dead_peer_detection self.href = href - self.id = id - self.ike_policy = ike_policy - self.ipsec_policy = ipsec_policy - self.mode = mode - self.name = name - self.peer_address = peer_address - self.psk = psk - self.resource_type = resource_type - self.status = status - self.routing_protocol = routing_protocol - self.tunnels = tunnels @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteMode': - """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByHref': + """Initialize a VolumeProfileIdentityByHref object from a json dictionary.""" args = {} - if 'admin_state_up' in _dict: - args['admin_state_up'] = _dict.get('admin_state_up') - else: - raise ValueError( - 'Required property \'admin_state_up\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'authentication_mode' in _dict: - args['authentication_mode'] = _dict.get('authentication_mode') - else: - raise ValueError( - 'Required property \'authentication_mode\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError( - 'Required property \'created_at\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'dead_peer_detection' in _dict: - args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict( - _dict.get('dead_peer_detection')) - else: - raise ValueError( - 'Required property \'dead_peer_detection\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'ike_policy' in _dict: - args['ike_policy'] = IKEPolicyReference.from_dict( - _dict.get('ike_policy')) - if 'ipsec_policy' in _dict: - args['ipsec_policy'] = IPsecPolicyReference.from_dict( - _dict.get('ipsec_policy')) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') - else: - raise ValueError( - 'Required property \'mode\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError( - 'Required property \'name\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'peer_address' in _dict: - args['peer_address'] = _dict.get('peer_address') - else: - raise ValueError( - 'Required property \'peer_address\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'psk' in _dict: - args['psk'] = _dict.get('psk') - else: - raise ValueError( - 'Required property \'psk\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError( - 'Required property \'status\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'routing_protocol' in _dict: - args['routing_protocol'] = _dict.get('routing_protocol') - else: - raise ValueError( - 'Required property \'routing_protocol\' not present in VPNGatewayConnectionStaticRouteMode JSON' - ) - if 'tunnels' in _dict: - args['tunnels'] = [ - VPNGatewayConnectionStaticRouteModeTunnel.from_dict(x) - for x in _dict.get('tunnels') - ] - else: - raise ValueError( - 'Required property \'tunnels\' not present in VPNGatewayConnectionStaticRouteMode JSON' + 'Required property \'href\' not present in VolumeProfileIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary.""" + """Initialize a VolumeProfileIdentityByHref 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, 'admin_state_up') and self.admin_state_up is not None: - _dict['admin_state_up'] = self.admin_state_up - if hasattr( - self, - 'authentication_mode') and self.authentication_mode is not None: - _dict['authentication_mode'] = self.authentication_mode - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr( - self, - 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ike_policy') and self.ike_policy is not None: - _dict['ike_policy'] = self.ike_policy.to_dict() - if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'peer_address') and self.peer_address is not None: - _dict['peer_address'] = self.peer_address - if hasattr(self, 'psk') and self.psk is not None: - _dict['psk'] = self.psk - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, - 'routing_protocol') and self.routing_protocol is not None: - _dict['routing_protocol'] = self.routing_protocol - if hasattr(self, 'tunnels') and self.tunnels is not None: - _dict['tunnels'] = [x.to_dict() for x in self.tunnels] return _dict def _to_dict(self): @@ -62938,226 +69241,198 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionStaticRouteMode object.""" + """Return a `str` version of this VolumeProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool: + def __eq__(self, other: 'VolumeProfileIdentityByHref') -> 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: 'VPNGatewayConnectionStaticRouteMode') -> bool: + def __ne__(self, other: 'VolumeProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationModeEnum(str, Enum): - """ - The authentication mode. Only `psk` is currently supported. - """ - PSK = 'psk' - class ModeEnum(str, Enum): - """ - The mode of the VPN gateway. - """ - POLICY = 'policy' - ROUTE = 'route' +class VolumeProfileIdentityByName(VolumeProfileIdentity): + """ + VolumeProfileIdentityByName. - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' + :attr str name: The globally unique name for this volume profile. + """ - class StatusEnum(str, Enum): - """ - The status of a VPN gateway connection. + def __init__(self, name: str) -> None: """ - DOWN = 'down' - UP = 'up' + Initialize a VolumeProfileIdentityByName object. - class RoutingProtocolEnum(str, Enum): - """ - Routing protocols are disabled for this VPN gateway connection. + :param str name: The globally unique name for this volume profile. """ - NONE = 'none' + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByName': + """Initialize a VolumeProfileIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in VolumeProfileIdentityByName JSON' + ) + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeProfileIdentityByName object from a json dictionary.""" + return cls.from_dict(_dict) -class VPNGatewayPolicyMode(VPNGateway): + 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 + 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 VolumeProfileIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumeProfileIdentityByName') -> 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: 'VolumeProfileIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VolumePrototypeVolumeByCapacity(VolumePrototype): """ - VPNGatewayPolicyMode. + VolumePrototypeVolumeByCapacity. - :attr List[VPNGatewayConnectionReference] connections: Collection of references - to VPN gateway connections. - :attr datetime created_at: The date and time that this VPN gateway was created. - :attr str crn: The VPN gateway's CRN. - :attr str href: The VPN gateway's canonical URL. - :attr str id: The unique identifier for this VPN gateway. - :attr List[VPNGatewayMember] members: Collection of VPN gateway members. - :attr str name: The user-defined name for this VPN gateway. - :attr ResourceGroupReference resource_group: The resource group for this VPN - gateway. - :attr str resource_type: The resource type. - :attr str status: The status of the VPN gateway. - :attr SubnetReference subnet: - :attr str mode: Policy mode VPN gateway. + :attr int iops: (optional) The bandwidth for the volume. + :attr str name: (optional) The unique user-defined name for this volume. + :attr VolumeProfileIdentity profile: The profile to use for this volume. + :attr ResourceGroupIdentity resource_group: (optional) + :attr ZoneIdentity zone: The zone this volume will reside in. + :attr int capacity: The capacity of the volume in gigabytes. The specified + minimum and maximum capacity values for creating or updating volumes may expand + in the future. + :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root + key to use to wrap the data encryption key for the volume. + If this property is not provided, the `encryption` type for the volume will be + `provider_managed`. """ - def __init__(self, connections: List['VPNGatewayConnectionReference'], - created_at: datetime, crn: str, href: str, id: str, - members: List['VPNGatewayMember'], name: str, - resource_group: 'ResourceGroupReference', resource_type: str, - status: str, subnet: 'SubnetReference', mode: str) -> None: + def __init__(self, + profile: 'VolumeProfileIdentity', + zone: 'ZoneIdentity', + capacity: int, + *, + iops: int = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ - Initialize a VPNGatewayPolicyMode object. + Initialize a VolumePrototypeVolumeByCapacity object. - :param List[VPNGatewayConnectionReference] connections: Collection of - references to VPN gateway connections. - :param datetime created_at: The date and time that this VPN gateway was - created. - :param str crn: The VPN gateway's CRN. - :param str href: The VPN gateway's canonical URL. - :param str id: The unique identifier for this VPN gateway. - :param List[VPNGatewayMember] members: Collection of VPN gateway members. - :param str name: The user-defined name for this VPN gateway. - :param ResourceGroupReference resource_group: The resource group for this - VPN gateway. - :param str resource_type: The resource type. - :param str status: The status of the VPN gateway. - :param SubnetReference subnet: - :param str mode: Policy mode VPN gateway. + :param VolumeProfileIdentity profile: The profile to use for this volume. + :param ZoneIdentity zone: The zone this volume will reside in. + :param int capacity: The capacity of the volume in gigabytes. The specified + minimum and maximum capacity values for creating or updating volumes may + expand in the future. + :param int iops: (optional) The bandwidth for the volume. + :param str name: (optional) The unique user-defined name for this volume. + :param ResourceGroupIdentity resource_group: (optional) + :param EncryptionKeyIdentity encryption_key: (optional) The identity of the + root key to use to wrap the data encryption key for the volume. + If this property is not provided, the `encryption` type for the volume will + be + `provider_managed`. """ # pylint: disable=super-init-not-called - self.connections = connections - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.members = members + self.iops = iops self.name = name + self.profile = profile self.resource_group = resource_group - self.resource_type = resource_type - self.status = status - self.subnet = subnet - self.mode = mode + self.zone = zone + self.capacity = capacity + self.encryption_key = encryption_key @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode': - """Initialize a VPNGatewayPolicyMode object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeByCapacity': + """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = [ - VPNGatewayConnectionReference.from_dict(x) - for x in _dict.get('connections') - ] - else: - raise ValueError( - 'Required property \'connections\' not present in VPNGatewayPolicyMode JSON' - ) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError( - 'Required property \'created_at\' not present in VPNGatewayPolicyMode JSON' - ) - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError( - 'Required property \'crn\' not present in VPNGatewayPolicyMode JSON' - ) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError( - 'Required property \'href\' not present in VPNGatewayPolicyMode JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in VPNGatewayPolicyMode JSON' - ) - if 'members' in _dict: - args['members'] = [ - VPNGatewayMember.from_dict(x) for x in _dict.get('members') - ] - else: - raise ValueError( - 'Required property \'members\' not present in VPNGatewayPolicyMode JSON' - ) + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: raise ValueError( - 'Required property \'name\' not present in VPNGatewayPolicyMode JSON' + 'Required property \'profile\' not present in VolumePrototypeVolumeByCapacity JSON' ) if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict( - _dict.get('resource_group')) - else: - raise ValueError( - 'Required property \'resource_group\' not present in VPNGatewayPolicyMode JSON' - ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in VPNGatewayPolicyMode JSON' - ) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError( - 'Required property \'status\' not present in VPNGatewayPolicyMode JSON' - ) - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + args['resource_group'] = _dict.get('resource_group') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: raise ValueError( - 'Required property \'subnet\' not present in VPNGatewayPolicyMode JSON' + 'Required property \'zone\' not present in VolumePrototypeVolumeByCapacity JSON' ) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') else: raise ValueError( - 'Required property \'mode\' not present in VPNGatewayPolicyMode JSON' + 'Required property \'capacity\' not present in VolumePrototypeVolumeByCapacity JSON' ) + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayPolicyMode object from a json dictionary.""" + """Initialize a VolumePrototypeVolumeByCapacity 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, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + 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, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'subnet') and self.subnet is not None: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() return _dict def _to_dict(self): @@ -63165,113 +69440,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayPolicyMode object.""" + """Return a `str` version of this VolumePrototypeVolumeByCapacity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayPolicyMode') -> bool: + def __eq__(self, other: 'VolumePrototypeVolumeByCapacity') -> 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: 'VPNGatewayPolicyMode') -> bool: + def __ne__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - VPN_GATEWAY = 'vpn_gateway' - - class StatusEnum(str, Enum): - """ - The status of the VPN gateway. - """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - class ModeEnum(str, Enum): - """ - Policy mode VPN gateway. - """ - POLICY = 'policy' - -class VPNGatewayPrototypeVPNGatewayPolicyModePrototype(VPNGatewayPrototype): +class ZoneIdentityByHref(ZoneIdentity): """ - VPNGatewayPrototypeVPNGatewayPolicyModePrototype. + ZoneIdentityByHref. - :attr str name: (optional) The user-defined name for this VPN gateway. - :attr ResourceGroupIdentity resource_group: (optional) - :attr SubnetIdentity subnet: - :attr str mode: (optional) Policy mode VPN gateway. + :attr str href: The URL for this zone. """ - def __init__(self, - subnet: 'SubnetIdentity', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - mode: str = None) -> None: + def __init__(self, href: str) -> None: """ - Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object. + Initialize a ZoneIdentityByHref object. - :param SubnetIdentity subnet: - :param str name: (optional) The user-defined name for this VPN gateway. - :param ResourceGroupIdentity resource_group: (optional) - :param str mode: (optional) Policy mode VPN gateway. + :param str href: The URL for this zone. """ # pylint: disable=super-init-not-called - self.name = name - self.resource_group = resource_group - self.subnet = subnet - self.mode = mode - - @classmethod - def from_dict( - cls, - _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype': - """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary.""" + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByHref': + """Initialize a ZoneIdentityByHref object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayPolicyModePrototype JSON' + 'Required property \'href\' not present in ZoneIdentityByHref JSON' ) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary.""" + """Initialize a ZoneIdentityByHref 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -63279,83 +69499,51 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayPrototypeVPNGatewayPolicyModePrototype object.""" + """Return a `str` version of this ZoneIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool: + def __eq__(self, other: 'ZoneIdentityByHref') -> 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: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool: + def __ne__(self, other: 'ZoneIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - Policy mode VPN gateway. - """ - POLICY = 'policy' - -class VPNGatewayPrototypeVPNGatewayRouteModePrototype(VPNGatewayPrototype): +class ZoneIdentityByName(ZoneIdentity): """ - VPNGatewayPrototypeVPNGatewayRouteModePrototype. + ZoneIdentityByName. - :attr str name: (optional) The user-defined name for this VPN gateway. - :attr ResourceGroupIdentity resource_group: (optional) - :attr SubnetIdentity subnet: - :attr str mode: (optional) Route mode VPN gateway. + :attr str name: The globally unique name for this zone. """ - def __init__(self, - subnet: 'SubnetIdentity', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - mode: str = None) -> None: + def __init__(self, name: str) -> None: """ - Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object. + Initialize a ZoneIdentityByName object. - :param SubnetIdentity subnet: - :param str name: (optional) The user-defined name for this VPN gateway. - :param ResourceGroupIdentity resource_group: (optional) - :param str mode: (optional) Route mode VPN gateway. + :param str name: The globally unique name for this zone. """ # pylint: disable=super-init-not-called self.name = name - self.resource_group = resource_group - self.subnet = subnet - self.mode = mode @classmethod - def from_dict( - cls, - _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayRouteModePrototype': - """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName': + """Initialize a ZoneIdentityByName object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') else: raise ValueError( - 'Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayRouteModePrototype JSON' + 'Required property \'name\' not present in ZoneIdentityByName JSON' ) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary.""" + """Initialize a ZoneIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -63363,18 +69551,6 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -63382,204 +69558,61 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayPrototypeVPNGatewayRouteModePrototype object.""" + """Return a `str` version of this ZoneIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, - other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool: + def __eq__(self, other: 'ZoneIdentityByName') -> 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: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool: + def __ne__(self, other: 'ZoneIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - Route mode VPN gateway. - """ - ROUTE = 'route' - -class VPNGatewayRouteMode(VPNGateway): +class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref( + EndpointGatewayReservedIPReservedIPIdentity): """ - VPNGatewayRouteMode. + EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref. - :attr List[VPNGatewayConnectionReference] connections: Collection of references - to VPN gateway connections. - :attr datetime created_at: The date and time that this VPN gateway was created. - :attr str crn: The VPN gateway's CRN. - :attr str href: The VPN gateway's canonical URL. - :attr str id: The unique identifier for this VPN gateway. - :attr List[VPNGatewayMember] members: Collection of VPN gateway members. - :attr str name: The user-defined name for this VPN gateway. - :attr ResourceGroupReference resource_group: The resource group for this VPN - gateway. - :attr str resource_type: The resource type. - :attr str status: The status of the VPN gateway. - :attr SubnetReference subnet: - :attr str mode: Route mode VPN gateway. + :attr str href: The URL for this reserved IP. """ - def __init__(self, connections: List['VPNGatewayConnectionReference'], - created_at: datetime, crn: str, href: str, id: str, - members: List['VPNGatewayMember'], name: str, - resource_group: 'ResourceGroupReference', resource_type: str, - status: str, subnet: 'SubnetReference', mode: str) -> None: + def __init__(self, href: str) -> None: """ - Initialize a VPNGatewayRouteMode object. + Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object. - :param List[VPNGatewayConnectionReference] connections: Collection of - references to VPN gateway connections. - :param datetime created_at: The date and time that this VPN gateway was - created. - :param str crn: The VPN gateway's CRN. - :param str href: The VPN gateway's canonical URL. - :param str id: The unique identifier for this VPN gateway. - :param List[VPNGatewayMember] members: Collection of VPN gateway members. - :param str name: The user-defined name for this VPN gateway. - :param ResourceGroupReference resource_group: The resource group for this - VPN gateway. - :param str resource_type: The resource type. - :param str status: The status of the VPN gateway. - :param SubnetReference subnet: - :param str mode: Route mode VPN gateway. + :param str href: The URL for this reserved IP. """ # pylint: disable=super-init-not-called - self.connections = connections - self.created_at = created_at - self.crn = crn self.href = href - self.id = id - self.members = members - self.name = name - self.resource_group = resource_group - self.resource_type = resource_type - self.status = status - self.subnet = subnet - self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode': - """Initialize a VPNGatewayRouteMode object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref': + """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = [ - VPNGatewayConnectionReference.from_dict(x) - for x in _dict.get('connections') - ] - else: - raise ValueError( - 'Required property \'connections\' not present in VPNGatewayRouteMode JSON' - ) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError( - 'Required property \'created_at\' not present in VPNGatewayRouteMode JSON' - ) - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError( - 'Required property \'crn\' not present in VPNGatewayRouteMode JSON' - ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in VPNGatewayRouteMode JSON' - ) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError( - 'Required property \'id\' not present in VPNGatewayRouteMode JSON' - ) - if 'members' in _dict: - args['members'] = [ - VPNGatewayMember.from_dict(x) for x in _dict.get('members') - ] - else: - raise ValueError( - 'Required property \'members\' not present in VPNGatewayRouteMode JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError( - 'Required property \'name\' not present in VPNGatewayRouteMode JSON' - ) - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict( - _dict.get('resource_group')) - else: - raise ValueError( - 'Required property \'resource_group\' not present in VPNGatewayRouteMode JSON' - ) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in VPNGatewayRouteMode JSON' - ) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError( - 'Required property \'status\' not present in VPNGatewayRouteMode JSON' - ) - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) - else: - raise ValueError( - 'Required property \'subnet\' not present in VPNGatewayRouteMode JSON' - ) - if 'mode' in _dict: - args['mode'] = _dict.get('mode') - else: - raise ValueError( - 'Required property \'mode\' not present in VPNGatewayRouteMode JSON' + 'Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayRouteMode object from a json dictionary.""" + """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref 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, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'subnet') and self.subnet is not None: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -63587,139 +69620,146 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayRouteMode object.""" + """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayRouteMode') -> bool: + def __eq__( + self, other: + 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref' + ) -> 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: 'VPNGatewayRouteMode') -> bool: + def __ne__( + self, other: + 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - VPN_GATEWAY = 'vpn_gateway' - - class StatusEnum(str, Enum): - """ - The status of the VPN gateway. - """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - class ModeEnum(str, Enum): - """ - Route mode VPN gateway. - """ - ROUTE = 'route' - -class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity( - VolumeAttachmentVolumePrototypeInstanceContext): +class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById( + EndpointGatewayReservedIPReservedIPIdentity): """ - Identifies a volume by a unique property. + EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById. + :attr str id: The unique identifier for this reserved IP. """ - def __init__(self) -> None: + def __init__(self, id: str) -> None: """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity object. + Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object. + :param str id: The unique identifier for this reserved IP. """ # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById', - 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN', - 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref' - ])) - raise Exception(msg) + self.id = id + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById': + """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById JSON' + ) + return cls(**args) -class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext( - VolumeAttachmentVolumePrototypeInstanceContext): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext. + @classmethod + def _from_dict(cls, _dict): + """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + return cls.from_dict(_dict) - :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root - key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will be - `provider_managed`. - :attr int iops: (optional) The bandwidth for the volume. - :attr str name: (optional) The unique user-defined name for this volume. - :attr VolumeProfileIdentity profile: The profile to use for this volume. - """ + 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 __init__(self, - profile: 'VolumeProfileIdentity', - *, - encryption_key: 'EncryptionKeyIdentity' = None, - iops: int = None, - name: str = None) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - :param VolumeProfileIdentity profile: The profile to use for this volume. - :param EncryptionKeyIdentity encryption_key: (optional) The identity of the - root key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will - be - `provider_managed`. - :param int iops: (optional) The bandwidth for the volume. - :param str name: (optional) The unique user-defined name for this volume. - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join([ - 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity' - ])) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, + other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById' + ) -> 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: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class VolumeIdentityByCRN(VolumeIdentity): +class EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN( + EndpointGatewayTargetPrototypeProviderCloudServiceIdentity): """ - VolumeIdentityByCRN. + EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN. - :attr str crn: The CRN for this volume. + :attr str resource_type: The type of target for this endpoint gateway. + :attr str crn: The CRN for this provider cloud service, or the CRN for the + user's instance of a provider cloud service. """ - def __init__(self, crn: str) -> None: + def __init__(self, resource_type: str, crn: str) -> None: """ - Initialize a VolumeIdentityByCRN object. + Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object. - :param str crn: The CRN for this volume. + :param str resource_type: The type of target for this endpoint gateway. + :param str crn: The CRN for this provider cloud service, or the CRN for the + user's instance of a provider cloud service. """ # pylint: disable=super-init-not-called + self.resource_type = resource_type self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByCRN': - """Initialize a VolumeIdentityByCRN object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN': + """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary.""" args = {} + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON' + ) if 'crn' in _dict: args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'crn\' not present in VolumeIdentityByCRN JSON' + 'Required property \'crn\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeIdentityByCRN object from a json dictionary.""" + """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn return _dict @@ -63729,58 +69769,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeIdentityByCRN object.""" + """Return a `str` version of this EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeIdentityByCRN') -> bool: + def __eq__( + self, other: + 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN' + ) -> 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: 'VolumeIdentityByCRN') -> bool: + def __ne__( + self, other: + 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The type of target for this endpoint gateway. + """ + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' + -class VolumeIdentityByHref(VolumeIdentity): +class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName( + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity): """ - VolumeIdentityByHref. + The name of this provider infrastructure service. - :attr str href: The URL for this volume. + :attr str resource_type: The type of target for this endpoint gateway. + :attr str name: The name of a provider infrastructure service. Must be: + - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. """ - def __init__(self, href: str) -> None: + def __init__(self, resource_type: str, name: str) -> None: """ - Initialize a VolumeIdentityByHref object. + Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object. - :param str href: The URL for this volume. + :param str resource_type: The type of target for this endpoint gateway. + :param str name: The name of a provider infrastructure service. Must be: + - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. """ # pylint: disable=super-init-not-called - self.href = href + self.resource_type = resource_type + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByHref': - """Initialize a VolumeIdentityByHref object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName': + """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: raise ValueError( - 'Required property \'href\' not present in VolumeIdentityByHref JSON' + 'Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeIdentityByHref object from a json dictionary.""" + """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -63788,58 +69857,74 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeIdentityByHref object.""" + """Return a `str` version of this EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeIdentityByHref') -> bool: + def __eq__( + self, other: + 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName' + ) -> 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: 'VolumeIdentityByHref') -> bool: + def __ne__( + self, other: + 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The type of target for this endpoint gateway. + """ + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' + -class VolumeIdentityById(VolumeIdentity): +class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN( + FlowLogCollectorTargetPrototypeInstanceIdentity): """ - VolumeIdentityById. + FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN. - :attr str id: The unique identifier for this volume. + :attr str crn: The CRN for this virtual server instance. """ - def __init__(self, id: str) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a VolumeIdentityById object. + Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object. - :param str id: The unique identifier for this volume. + :param str crn: The CRN for this virtual server instance. """ # pylint: disable=super-init-not-called - self.id = id + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeIdentityById': - """Initialize a VolumeIdentityById object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN': + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'id\' not present in VolumeIdentityById JSON' + 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeIdentityById object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN 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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -63847,51 +69932,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeIdentityById object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeIdentityById') -> bool: + def __eq__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN' + ) -> 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: 'VolumeIdentityById') -> bool: + def __ne__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeProfileIdentityByHref(VolumeProfileIdentity): +class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref( + FlowLogCollectorTargetPrototypeInstanceIdentity): """ - VolumeProfileIdentityByHref. + FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref. - :attr str href: The URL for this volume profile. + :attr str href: The URL for this virtual server instance. """ def __init__(self, href: str) -> None: """ - Initialize a VolumeProfileIdentityByHref object. + Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object. - :param str href: The URL for this volume profile. + :param str href: The URL for this virtual server instance. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByHref': - """Initialize a VolumeProfileIdentityByHref object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref': + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in VolumeProfileIdentityByHref JSON' + 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileIdentityByHref object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -63906,58 +70000,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileIdentityByHref object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileIdentityByHref') -> bool: + def __eq__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref' + ) -> 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: 'VolumeProfileIdentityByHref') -> bool: + def __ne__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeProfileIdentityByName(VolumeProfileIdentity): +class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById( + FlowLogCollectorTargetPrototypeInstanceIdentity): """ - VolumeProfileIdentityByName. + FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById. - :attr str name: The globally unique name for this volume profile. + :attr str id: The unique identifier for this virtual server instance. """ - def __init__(self, name: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a VolumeProfileIdentityByName object. + Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object. - :param str name: The globally unique name for this volume profile. + :param str id: The unique identifier for this virtual server instance. """ # pylint: disable=super-init-not-called - self.name = name + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByName': - """Initialize a VolumeProfileIdentityByName object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById': + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'name\' not present in VolumeProfileIdentityByName JSON' + 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileIdentityByName object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById 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, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -63965,139 +70068,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileIdentityByName object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileIdentityByName') -> bool: + def __eq__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById' + ) -> 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: 'VolumeProfileIdentityByName') -> bool: + def __ne__( + self, other: + 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumePrototypeVolumeByCapacity(VolumePrototype): +class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity): """ - VolumePrototypeVolumeByCapacity. + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref. - :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root - key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will be - `provider_managed`. - :attr int iops: (optional) The bandwidth for the volume. - :attr str name: (optional) The unique user-defined name for this volume. - :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr ResourceGroupIdentity resource_group: (optional) - :attr ZoneIdentity zone: The zone this volume will reside in. - :attr int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may expand - in the future. + :attr str href: The URL for this network interface. """ - def __init__(self, - profile: 'VolumeProfileIdentity', - zone: 'ZoneIdentity', - capacity: int, - *, - encryption_key: 'EncryptionKeyIdentity' = None, - iops: int = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None) -> None: + def __init__(self, href: str) -> None: """ - Initialize a VolumePrototypeVolumeByCapacity object. + Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object. - :param VolumeProfileIdentity profile: The profile to use for this volume. - :param ZoneIdentity zone: The zone this volume will reside in. - :param int capacity: The capacity of the volume in gigabytes. The specified - minimum and maximum capacity values for creating or updating volumes may - expand in the future. - :param EncryptionKeyIdentity encryption_key: (optional) The identity of the - root key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will - be - `provider_managed`. - :param int iops: (optional) The bandwidth for the volume. - :param str name: (optional) The unique user-defined name for this volume. - :param ResourceGroupIdentity resource_group: (optional) + :param str href: The URL for this network interface. """ # pylint: disable=super-init-not-called - self.encryption_key = encryption_key - self.iops = iops - self.name = name - self.profile = profile - self.resource_group = resource_group - self.zone = zone - self.capacity = capacity + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeByCapacity': - """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref': + """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary.""" args = {} - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - else: - raise ValueError( - 'Required property \'profile\' not present in VolumePrototypeVolumeByCapacity JSON' - ) - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - else: - raise ValueError( - 'Required property \'zone\' not present in VolumePrototypeVolumeByCapacity JSON' - ) - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'capacity\' not present in VolumePrototypeVolumeByCapacity JSON' + 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref 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, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'iops') and self.iops is not None: - _dict['iops'] = self.iops - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -64105,58 +70136,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumePrototypeVolumeByCapacity object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool: + def __eq__( + self, other: + 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref' + ) -> 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: 'VolumePrototypeVolumeByCapacity') -> bool: + def __ne__( + self, other: + 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneIdentityByHref(ZoneIdentity): +class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById( + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity): """ - ZoneIdentityByHref. + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById. - :attr str href: The URL for this zone. + :attr str id: The unique identifier for this network interface. """ - def __init__(self, href: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a ZoneIdentityByHref object. + Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object. - :param str href: The URL for this zone. + :param str id: The unique identifier for this network interface. """ # pylint: disable=super-init-not-called - self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByHref': - """Initialize a ZoneIdentityByHref object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById': + """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'href\' not present in ZoneIdentityByHref JSON' + 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ZoneIdentityByHref object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -64164,58 +70204,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ZoneIdentityByHref object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ZoneIdentityByHref') -> bool: + def __eq__( + self, other: + 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById' + ) -> 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: 'ZoneIdentityByHref') -> bool: + def __ne__( + self, other: + 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneIdentityByName(ZoneIdentity): +class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN( + FlowLogCollectorTargetPrototypeSubnetIdentity): """ - ZoneIdentityByName. + FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN. - :attr str name: The globally unique name for this zone. + :attr str crn: The CRN for this subnet. """ - def __init__(self, name: str) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a ZoneIdentityByName object. + Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object. - :param str name: The globally unique name for this zone. + :param str crn: The CRN for this subnet. """ # pylint: disable=super-init-not-called - self.name = name + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName': - """Initialize a ZoneIdentityByName object from a json dictionary.""" + def from_dict( + cls, _dict: Dict + ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN': + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'name\' not present in ZoneIdentityByName JSON' + 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ZoneIdentityByName object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN 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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -64223,33 +70272,39 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ZoneIdentityByName object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ZoneIdentityByName') -> bool: + def __eq__( + self, + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN' + ) -> 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: 'ZoneIdentityByName') -> bool: + def __ne__( + self, + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN' + ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref( - EndpointGatewayReservedIPReservedIPIdentity): +class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref( + FlowLogCollectorTargetPrototypeSubnetIdentity): """ - EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref. + FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref. - :attr str href: The URL for this reserved IP. + :attr str href: The URL for this subnet. """ def __init__(self, href: str) -> None: """ - Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object. + Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object. - :param str href: The URL for this reserved IP. + :param str href: The URL for this subnet. """ # pylint: disable=super-init-not-called self.href = href @@ -64257,20 +70312,20 @@ def __init__(self, href: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref': - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref': + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref JSON' + 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64285,12 +70340,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref' + self, + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64298,26 +70353,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: - 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref' + self, + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById( - EndpointGatewayReservedIPReservedIPIdentity): +class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById( + FlowLogCollectorTargetPrototypeSubnetIdentity): """ - EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById. + FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById. - :attr str id: The unique identifier for this reserved IP. + :attr str id: The unique identifier for this subnet. """ def __init__(self, id: str) -> None: """ - Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object. + Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object. - :param str id: The unique identifier for this reserved IP. + :param str id: The unique identifier for this subnet. """ # pylint: disable=super-init-not-called self.id = id @@ -64325,20 +70380,20 @@ def __init__(self, id: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById': - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById': + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById JSON' + 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64353,12 +70408,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( self, - other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById' + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64367,64 +70422,51 @@ def __eq__( def __ne__( self, - other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById' + other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN( - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity): +class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN( + FlowLogCollectorTargetPrototypeVPCIdentity): """ - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN. + FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN. - :attr str resource_type: The type of target for this endpoint gateway. - :attr str crn: The CRN for this provider cloud service, or the CRN for the - user's instance of a provider cloud service. + :attr str crn: The CRN for this VPC. """ - def __init__(self, resource_type: str, crn: str) -> None: + def __init__(self, crn: str) -> None: """ - Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object. + Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object. - :param str resource_type: The type of target for this endpoint gateway. - :param str crn: The CRN for this provider cloud service, or the CRN for the - user's instance of a provider cloud service. + :param str crn: The CRN for this VPC. """ # pylint: disable=super-init-not-called - self.resource_type = resource_type self.crn = crn @classmethod def from_dict( cls, _dict: Dict - ) -> 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN': - """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary.""" + ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN': + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary.""" args = {} - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON' - ) if 'crn' in _dict: args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'crn\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON' + 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn return _dict @@ -64434,12 +70476,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN' + self, + other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64447,74 +70489,54 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: - 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN' + self, + other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The type of target for this endpoint gateway. - """ - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - -class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName( - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity): +class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref( + FlowLogCollectorTargetPrototypeVPCIdentity): """ - The name of this provider infrastructure service. + FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref. - :attr str resource_type: The type of target for this endpoint gateway. - :attr str name: The name of a provider infrastructure service. Must be: - - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + :attr str href: The URL for this VPC. """ - def __init__(self, resource_type: str, name: str) -> None: + def __init__(self, href: str) -> None: """ - Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object. + Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object. - :param str resource_type: The type of target for this endpoint gateway. - :param str name: The name of a provider infrastructure service. Must be: - - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + :param str href: The URL for this VPC. """ # pylint: disable=super-init-not-called - self.resource_type = resource_type - self.name = name + self.href = href @classmethod def from_dict( cls, _dict: Dict - ) -> 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName': - """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary.""" + ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref': + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary.""" args = {} - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError( - 'Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON' - ) - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'name\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON' + 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -64522,12 +70544,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName' + self, + other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64535,61 +70557,54 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: - 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName' + self, + other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The type of target for this endpoint gateway. - """ - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - -class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN( - FlowLogCollectorTargetPrototypeInstanceIdentity): +class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById( + FlowLogCollectorTargetPrototypeVPCIdentity): """ - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN. + FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById. - :attr str crn: The CRN for this virtual server instance. + :attr str id: The unique identifier for this VPC. """ - def __init__(self, crn: str) -> None: + def __init__(self, id: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object. + Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object. - :param str crn: The CRN for this virtual server instance. + :param str id: The unique identifier for this VPC. """ # pylint: disable=super-init-not-called - self.crn = crn + self.id = id @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN': - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary.""" + ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById': + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN JSON' + 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById 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, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -64597,12 +70612,11 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object.""" + """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN' + self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64610,54 +70624,299 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN' + self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref( - FlowLogCollectorTargetPrototypeInstanceIdentity): +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec( + InstanceGroupManagerActionPrototypeScheduledActionPrototype): """ - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref. + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec. - :attr str href: The URL for this virtual server instance. + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. """ - def __init__(self, href: str) -> None: + def __init__(self, *, name: str = None, cron_spec: str = None) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object. + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec object. - :param str href: The URL for this virtual server instance. + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup', + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager' + ])) + raise Exception(msg) + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt( + InstanceGroupManagerActionPrototypeScheduledActionPrototype): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr datetime run_at: (optional) The date and time the scheduled action will + run. + """ + + def __init__(self, *, name: str = None, run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt object. + + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param datetime run_at: (optional) The date and time the scheduled action + will run. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join([ + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup', + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager' + ])) + raise Exception(msg) + + +class InstanceGroupManagerActionScheduledActionGroup( + InstanceGroupManagerActionScheduledAction): + """ + InstanceGroupManagerActionScheduledActionGroup. + + :attr bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` time + has passed. + :attr int auto_delete_timeout: Amount of time in hours that are required to pass + before the scheduled action will be automatically deleted once it has finished. + If this value is 0, the action will be deleted on completion. + :attr datetime created_at: The date and time that the instance group manager + action was created. + :attr str href: The URL for this instance group manager action. + :attr str id: The unique identifier for this instance group manager action. + :attr str name: The user-defined name for this instance group manager action. + Names must be unique within the instance group manager. + :attr str resource_type: The resource type. + :attr str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was modified. + :attr str action_type: The type of action for the instance group. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :attr datetime next_run_at: (optional) The date and time the scheduled action + will next run. If empty the system is currently calculating the next run time. + :attr InstanceGroupManagerScheduledActionGroupGroup group: + """ + + def __init__(self, + auto_delete: bool, + auto_delete_timeout: int, + created_at: datetime, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + updated_at: datetime, + action_type: str, + group: 'InstanceGroupManagerScheduledActionGroupGroup', + *, + cron_spec: str = None, + last_applied_at: datetime = None, + next_run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionScheduledActionGroup object. + + :param bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` + time has passed. + :param int auto_delete_timeout: Amount of time in hours that are required + to pass before the scheduled action will be automatically deleted once it + has finished. If this value is 0, the action will be deleted on completion. + :param datetime created_at: The date and time that the instance group + manager action was created. + :param str href: The URL for this instance group manager action. + :param str id: The unique identifier for this instance group manager + action. + :param str name: The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :param str resource_type: The resource type. + :param str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was modified. + :param str action_type: The type of action for the instance group. + :param InstanceGroupManagerScheduledActionGroupGroup group: + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + :param datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :param datetime next_run_at: (optional) The date and time the scheduled + action will next run. If empty the system is currently calculating the next + run time. """ # pylint: disable=super-init-not-called + self.auto_delete = auto_delete + self.auto_delete_timeout = auto_delete_timeout + self.created_at = created_at self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + self.status = status + self.updated_at = updated_at + self.action_type = action_type + self.cron_spec = cron_spec + self.last_applied_at = last_applied_at + self.next_run_at = next_run_at + self.group = group @classmethod def from_dict( - cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref': - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary.""" + cls, + _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionGroup': + """Initialize a InstanceGroupManagerActionScheduledActionGroup object from a json dictionary.""" args = {} + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError( + 'Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'auto_delete_timeout' in _dict: + args['auto_delete_timeout'] = _dict.get('auto_delete_timeout') + else: + raise ValueError( + 'Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref JSON' + 'Required property \'href\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError( + 'Required property \'id\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError( + 'Required property \'status\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'action_type' in _dict: + args['action_type'] = _dict.get('action_type') + else: + raise ValueError( + 'Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' + ) + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'last_applied_at' in _dict: + args['last_applied_at'] = string_to_datetime( + _dict.get('last_applied_at')) + if 'next_run_at' in _dict: + args['next_run_at'] = string_to_datetime(_dict.get('next_run_at')) + if 'group' in _dict: + args[ + 'group'] = InstanceGroupManagerScheduledActionGroupGroup.from_dict( + _dict.get('group')) + else: + raise ValueError( + 'Required property \'group\' not present in InstanceGroupManagerActionScheduledActionGroup JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionScheduledActionGroup 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, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr( + self, + 'auto_delete_timeout') and self.auto_delete_timeout is not None: + _dict['auto_delete_timeout'] = self.auto_delete_timeout + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'action_type') and self.action_type is not None: + _dict['action_type'] = self.action_type + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, + 'last_applied_at') and self.last_applied_at is not None: + _dict['last_applied_at'] = datetime_to_string(self.last_applied_at) + if hasattr(self, 'next_run_at') and self.next_run_at is not None: + _dict['next_run_at'] = datetime_to_string(self.next_run_at) + if hasattr(self, 'group') and self.group is not None: + _dict['group'] = self.group.to_dict() return _dict def _to_dict(self): @@ -64665,67 +70924,278 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object.""" + """Return a `str` version of this InstanceGroupManagerActionScheduledActionGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__( - self, other: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref' - ) -> bool: + def __eq__(self, + other: 'InstanceGroupManagerActionScheduledActionGroup') -> 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: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref' - ) -> bool: + def __ne__(self, + other: 'InstanceGroupManagerActionScheduledActionGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' -class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById( - FlowLogCollectorTargetPrototypeInstanceIdentity): - """ - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById. + class StatusEnum(str, Enum): + """ + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + """ + ACTIVE = 'active' + COMPLETED = 'completed' + FAILED = 'failed' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' - :attr str id: The unique identifier for this virtual server instance. + class ActionTypeEnum(str, Enum): + """ + The type of action for the instance group. + """ + SCHEDULED = 'scheduled' + + +class InstanceGroupManagerActionScheduledActionManager( + InstanceGroupManagerActionScheduledAction): """ + InstanceGroupManagerActionScheduledActionManager. - def __init__(self, id: str) -> None: - """ - Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object. + :attr bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` time + has passed. + :attr int auto_delete_timeout: Amount of time in hours that are required to pass + before the scheduled action will be automatically deleted once it has finished. + If this value is 0, the action will be deleted on completion. + :attr datetime created_at: The date and time that the instance group manager + action was created. + :attr str href: The URL for this instance group manager action. + :attr str id: The unique identifier for this instance group manager action. + :attr str name: The user-defined name for this instance group manager action. + Names must be unique within the instance group manager. + :attr str resource_type: The resource type. + :attr str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was modified. + :attr str action_type: The type of action for the instance group. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :attr datetime next_run_at: (optional) The date and time the scheduled action + will next run. If empty the system is currently calculating the next run time. + :attr InstanceGroupManagerScheduledActionManagerManager manager: + """ - :param str id: The unique identifier for this virtual server instance. + def __init__(self, + auto_delete: bool, + auto_delete_timeout: int, + created_at: datetime, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + updated_at: datetime, + action_type: str, + manager: 'InstanceGroupManagerScheduledActionManagerManager', + *, + cron_spec: str = None, + last_applied_at: datetime = None, + next_run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionScheduledActionManager object. + + :param bool auto_delete: If set to `true`, this scheduled action will be + automatically deleted after it has finished and the `auto_delete_timeout` + time has passed. + :param int auto_delete_timeout: Amount of time in hours that are required + to pass before the scheduled action will be automatically deleted once it + has finished. If this value is 0, the action will be deleted on completion. + :param datetime created_at: The date and time that the instance group + manager action was created. + :param str href: The URL for this instance group manager action. + :param str id: The unique identifier for this instance group manager + action. + :param str name: The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :param str resource_type: The resource type. + :param str status: The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was modified. + :param str action_type: The type of action for the instance group. + :param InstanceGroupManagerScheduledActionManagerManager manager: + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + :param datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If empty the action has never been applied. + :param datetime next_run_at: (optional) The date and time the scheduled + action will next run. If empty the system is currently calculating the next + run time. """ # pylint: disable=super-init-not-called + self.auto_delete = auto_delete + self.auto_delete_timeout = auto_delete_timeout + self.created_at = created_at + self.href = href self.id = id + self.name = name + self.resource_type = resource_type + self.status = status + self.updated_at = updated_at + self.action_type = action_type + self.cron_spec = cron_spec + self.last_applied_at = last_applied_at + self.next_run_at = next_run_at + self.manager = manager @classmethod def from_dict( - cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById': - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary.""" + cls, + _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionManager': + """Initialize a InstanceGroupManagerActionScheduledActionManager object from a json dictionary.""" args = {} + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError( + 'Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'auto_delete_timeout' in _dict: + args['auto_delete_timeout'] = _dict.get('auto_delete_timeout') + else: + raise ValueError( + 'Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError( + 'Required property \'created_at\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError( + 'Required property \'href\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById JSON' + 'Required property \'id\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError( + 'Required property \'name\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError( + 'Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError( + 'Required property \'status\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError( + 'Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'action_type' in _dict: + args['action_type'] = _dict.get('action_type') + else: + raise ValueError( + 'Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionManager JSON' + ) + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'last_applied_at' in _dict: + args['last_applied_at'] = string_to_datetime( + _dict.get('last_applied_at')) + if 'next_run_at' in _dict: + args['next_run_at'] = string_to_datetime(_dict.get('next_run_at')) + if 'manager' in _dict: + args['manager'] = _dict.get('manager') + else: + raise ValueError( + 'Required property \'manager\' not present in InstanceGroupManagerActionScheduledActionManager JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionScheduledActionManager 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, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr( + self, + 'auto_delete_timeout') and self.auto_delete_timeout is not None: + _dict['auto_delete_timeout'] = self.auto_delete_timeout + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'action_type') and self.action_type is not None: + _dict['action_type'] = self.action_type + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, + 'last_applied_at') and self.last_applied_at is not None: + _dict['last_applied_at'] = datetime_to_string(self.last_applied_at) + if hasattr(self, 'next_run_at') and self.next_run_at is not None: + _dict['next_run_at'] = datetime_to_string(self.next_run_at) + if hasattr(self, 'manager') and self.manager is not None: + if isinstance(self.manager, dict): + _dict['manager'] = self.manager + else: + _dict['manager'] = self.manager.to_dict() return _dict def _to_dict(self): @@ -64733,65 +71203,114 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object.""" + """Return a `str` version of this InstanceGroupManagerActionScheduledActionManager object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById' - ) -> bool: + self, + other: 'InstanceGroupManagerActionScheduledActionManager') -> 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: - 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById' - ) -> bool: + self, + other: 'InstanceGroupManagerActionScheduledActionManager') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' -class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity): + class StatusEnum(str, Enum): + """ + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + """ + ACTIVE = 'active' + COMPLETED = 'completed' + FAILED = 'failed' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' + + class ActionTypeEnum(str, Enum): + """ + The type of action for the instance group. + """ + SCHEDULED = 'scheduled' + + +class InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref( + InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototype): """ - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref. + InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref. - :attr str href: The URL for this network interface. + :attr int max_membership_count: (optional) The maximum number of members the + instance group should have at the scheduled time. + :attr int min_membership_count: (optional) The minimum number of members the + instance group should have at the scheduled time. + :attr str href: The URL for this instance group manager. """ - def __init__(self, href: str) -> None: + def __init__(self, + href: str, + *, + max_membership_count: int = None, + min_membership_count: int = None) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object. + Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref object. - :param str href: The URL for this network interface. + :param str href: The URL for this instance group manager. + :param int max_membership_count: (optional) The maximum number of members + the instance group should have at the scheduled time. + :param int min_membership_count: (optional) The minimum number of members + the instance group should have at the scheduled time. """ # pylint: disable=super-init-not-called + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count self.href = href @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref': - """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary.""" + ) -> 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref': + """Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref object from a json dictionary.""" args = {} + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON' + 'Required property \'href\' not present in InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref 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, 'max_membership_count' + ) and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count' + ) and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href return _dict @@ -64801,12 +71320,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.""" + """Return a `str` version of this InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( self, other: - 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref' + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64815,51 +71334,75 @@ def __eq__( def __ne__( self, other: - 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref' + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById( - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity): +class InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById( + InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototype): """ - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById. + InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById. - :attr str id: The unique identifier for this network interface. + :attr int max_membership_count: (optional) The maximum number of members the + instance group should have at the scheduled time. + :attr int min_membership_count: (optional) The minimum number of members the + instance group should have at the scheduled time. + :attr str id: The unique identifier for this instance group manager. """ - def __init__(self, id: str) -> None: + def __init__(self, + id: str, + *, + max_membership_count: int = None, + min_membership_count: int = None) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object. + Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById object. - :param str id: The unique identifier for this network interface. + :param str id: The unique identifier for this instance group manager. + :param int max_membership_count: (optional) The maximum number of members + the instance group should have at the scheduled time. + :param int min_membership_count: (optional) The minimum number of members + the instance group should have at the scheduled time. """ # pylint: disable=super-init-not-called + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count self.id = id @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById': - """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary.""" + ) -> 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById': + """Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById object from a json dictionary.""" args = {} + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON' + 'Required property \'id\' not present in InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById 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, 'max_membership_count' + ) and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count' + ) and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id return _dict @@ -64869,12 +71412,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById object.""" + """Return a `str` version of this InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( self, other: - 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById' + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64883,25 +71426,25 @@ def __eq__( def __ne__( self, other: - 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById' + 'InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN( - FlowLogCollectorTargetPrototypeSubnetIdentity): +class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN( + InstancePlacementTargetPrototypeDedicatedHostGroupIdentity): """ - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN. + InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN. - :attr str crn: The CRN for this subnet. + :attr str crn: The CRN for this dedicated host group. """ def __init__(self, crn: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object. - :param str crn: The CRN for this subnet. + :param str crn: The CRN for this dedicated host group. """ # pylint: disable=super-init-not-called self.crn = crn @@ -64909,20 +71452,20 @@ def __init__(self, crn: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN': - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN JSON' + 'Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64937,12 +71480,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -64950,26 +71493,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref( - FlowLogCollectorTargetPrototypeSubnetIdentity): +class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref( + InstancePlacementTargetPrototypeDedicatedHostGroupIdentity): """ - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref. + InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref. - :attr str href: The URL for this subnet. + :attr str href: The URL for this dedicated host group. """ def __init__(self, href: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object. - :param str href: The URL for this subnet. + :param str href: The URL for this dedicated host group. """ # pylint: disable=super-init-not-called self.href = href @@ -64977,20 +71520,20 @@ def __init__(self, href: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref': - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref JSON' + 'Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65005,12 +71548,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -65018,26 +71561,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById( - FlowLogCollectorTargetPrototypeSubnetIdentity): +class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById( + InstancePlacementTargetPrototypeDedicatedHostGroupIdentity): """ - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById. + InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById. - :attr str id: The unique identifier for this subnet. + :attr str id: The unique identifier for this dedicated host group. """ def __init__(self, id: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object. - :param str id: The unique identifier for this subnet. + :param str id: The unique identifier for this dedicated host group. """ # pylint: disable=super-init-not-called self.id = id @@ -65045,20 +71588,20 @@ def __init__(self, id: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById': - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById JSON' + 'Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65073,12 +71616,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -65086,26 +71629,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN( - FlowLogCollectorTargetPrototypeVPCIdentity): +class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN( + InstancePlacementTargetPrototypeDedicatedHostIdentity): """ - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN. + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN. - :attr str crn: The CRN for this VPC. + :attr str crn: The CRN for this dedicated host. """ def __init__(self, crn: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object. - :param str crn: The CRN for this VPC. + :param str crn: The CRN for this dedicated host. """ # pylint: disable=super-init-not-called self.crn = crn @@ -65113,20 +71656,20 @@ def __init__(self, crn: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN': - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: raise ValueError( - 'Required property \'crn\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN JSON' + 'Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65141,12 +71684,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -65154,26 +71697,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref( - FlowLogCollectorTargetPrototypeVPCIdentity): +class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref( + InstancePlacementTargetPrototypeDedicatedHostIdentity): """ - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref. + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref. - :attr str href: The URL for this VPC. + :attr str href: The URL for this dedicated host. """ def __init__(self, href: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object. - :param str href: The URL for this VPC. + :param str href: The URL for this dedicated host. """ # pylint: disable=super-init-not-called self.href = href @@ -65181,20 +71724,20 @@ def __init__(self, href: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref': - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: raise ValueError( - 'Required property \'href\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref JSON' + 'Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65209,12 +71752,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, - other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -65222,26 +71765,26 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, - other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById( - FlowLogCollectorTargetPrototypeVPCIdentity): +class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById( + InstancePlacementTargetPrototypeDedicatedHostIdentity): """ - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById. + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById. - :attr str id: The unique identifier for this VPC. + :attr str id: The unique identifier for this dedicated host. """ def __init__(self, id: str) -> None: """ - Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object. + Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object. - :param str id: The unique identifier for this VPC. + :param str id: The unique identifier for this dedicated host. """ # pylint: disable=super-init-not-called self.id = id @@ -65249,20 +71792,20 @@ def __init__(self, id: str) -> None: @classmethod def from_dict( cls, _dict: Dict - ) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById': - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary.""" + ) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById': + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError( - 'Required property \'id\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById JSON' + 'Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary.""" + """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65277,11 +71820,12 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object.""" + """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object.""" return json.dumps(self.to_dict(), indent=2) def __eq__( - self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById' ) -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): @@ -65289,7 +71833,8 @@ def __eq__( return self.__dict__ == other.__dict__ def __ne__( - self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById' + self, other: + 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById' ) -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -67001,25 +73546,25 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte """ VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. - :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root - key to use to wrap the data encryption key for the volume. - If this property is not provided, the `encryption` type for the volume will be - `provider_managed`. :attr int iops: (optional) The bandwidth for the volume. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr int capacity: The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. + :attr EncryptionKeyIdentity encryption_key: (optional) The identity of the root + key to use to wrap the data encryption key for the volume. + If this property is not provided, the `encryption` type for the volume will be + `provider_managed`. """ def __init__(self, profile: 'VolumeProfileIdentity', capacity: int, *, - encryption_key: 'EncryptionKeyIdentity' = None, iops: int = None, - name: str = None) -> None: + name: str = None, + encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object. @@ -67027,20 +73572,20 @@ def __init__(self, :param int capacity: The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. + :param int iops: (optional) The bandwidth for the volume. + :param str name: (optional) The unique user-defined name for this volume. :param EncryptionKeyIdentity encryption_key: (optional) The identity of the root key to use to wrap the data encryption key for the volume. If this property is not provided, the `encryption` type for the volume will be `provider_managed`. - :param int iops: (optional) The bandwidth for the volume. - :param str name: (optional) The unique user-defined name for this volume. """ # pylint: disable=super-init-not-called - self.encryption_key = encryption_key self.iops = iops self.name = name self.profile = profile self.capacity = capacity + self.encryption_key = encryption_key @classmethod def from_dict( @@ -67048,8 +73593,6 @@ def from_dict( ) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity': """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object from a json dictionary.""" args = {} - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') if 'iops' in _dict: args['iops'] = _dict.get('iops') if 'name' in _dict: @@ -67066,6 +73609,8 @@ def from_dict( raise ValueError( 'Required property \'capacity\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON' ) + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') return cls(**args) @classmethod @@ -67076,11 +73621,6 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() if hasattr(self, 'iops') and self.iops is not None: _dict['iops'] = self.iops if hasattr(self, 'name') and self.name is not None: @@ -67092,6 +73632,11 @@ def to_dict(self) -> Dict: _dict['profile'] = self.profile.to_dict() if hasattr(self, 'capacity') and self.capacity is not None: _dict['capacity'] = self.capacity + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() return _dict def _to_dict(self): @@ -67115,5 +73660,377 @@ def __ne__( self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity' ) -> bool: - """Return `true` when self and other are notequal, false otherwise.""" + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup( + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr InstanceGroupManagerScheduledActionGroupPrototype group: + """ + + def __init__(self, + group: 'InstanceGroupManagerScheduledActionGroupPrototype', + *, + name: str = None, + cron_spec: str = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object. + + :param InstanceGroupManagerScheduledActionGroupPrototype group: + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + """ + # pylint: disable=super-init-not-called + self.name = name + self.cron_spec = cron_spec + self.group = group + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup': + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'group' in _dict: + args[ + 'group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict( + _dict.get('group')) + else: + raise ValueError( + 'Required property \'group\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup 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, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'group') and self.group is not None: + _dict['group'] = self.group.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 InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup' + ) -> 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: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager( + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr InstanceGroupManagerScheduledActionByManagerManager manager: + """ + + def __init__(self, + manager: 'InstanceGroupManagerScheduledActionByManagerManager', + *, + name: str = None, + cron_spec: str = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object. + + :param InstanceGroupManagerScheduledActionByManagerManager manager: + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + """ + # pylint: disable=super-init-not-called + self.name = name + self.cron_spec = cron_spec + self.manager = manager + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager': + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'manager' in _dict: + args['manager'] = _dict.get('manager') + else: + raise ValueError( + 'Required property \'manager\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager 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, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'manager') and self.manager is not None: + if isinstance(self.manager, dict): + _dict['manager'] = self.manager + else: + _dict['manager'] = self.manager.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 InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager' + ) -> 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: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup( + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr datetime run_at: (optional) The date and time the scheduled action will + run. + :attr InstanceGroupManagerScheduledActionGroupPrototype group: + """ + + def __init__(self, + group: 'InstanceGroupManagerScheduledActionGroupPrototype', + *, + name: str = None, + run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object. + + :param InstanceGroupManagerScheduledActionGroupPrototype group: + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param datetime run_at: (optional) The date and time the scheduled action + will run. + """ + # pylint: disable=super-init-not-called + self.name = name + self.run_at = run_at + self.group = group + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup': + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'run_at' in _dict: + args['run_at'] = string_to_datetime(_dict.get('run_at')) + if 'group' in _dict: + args[ + 'group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict( + _dict.get('group')) + else: + raise ValueError( + 'Required property \'group\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup 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, 'run_at') and self.run_at is not None: + _dict['run_at'] = datetime_to_string(self.run_at) + if hasattr(self, 'group') and self.group is not None: + _dict['group'] = self.group.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 InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup' + ) -> 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: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager( + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt): + """ + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager. + + :attr str name: (optional) The user-defined name for this instance group manager + action. Names must be unique within the instance group manager. + :attr datetime run_at: (optional) The date and time the scheduled action will + run. + :attr InstanceGroupManagerScheduledActionByManagerManager manager: + """ + + def __init__(self, + manager: 'InstanceGroupManagerScheduledActionByManagerManager', + *, + name: str = None, + run_at: datetime = None) -> None: + """ + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object. + + :param InstanceGroupManagerScheduledActionByManagerManager manager: + :param str name: (optional) The user-defined name for this instance group + manager action. Names must be unique within the instance group manager. + :param datetime run_at: (optional) The date and time the scheduled action + will run. + """ + # pylint: disable=super-init-not-called + self.name = name + self.run_at = run_at + self.manager = manager + + @classmethod + def from_dict( + cls, _dict: Dict + ) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager': + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'run_at' in _dict: + args['run_at'] = string_to_datetime(_dict.get('run_at')) + if 'manager' in _dict: + args['manager'] = _dict.get('manager') + else: + raise ValueError( + 'Required property \'manager\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager JSON' + ) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager 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, 'run_at') and self.run_at is not None: + _dict['run_at'] = datetime_to_string(self.run_at) + if hasattr(self, 'manager') and self.manager is not None: + if isinstance(self.manager, dict): + _dict['manager'] = self.manager + else: + _dict['manager'] = self.manager.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 InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__( + self, other: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager' + ) -> 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: + 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager' + ) -> bool: + """Return `true` when self and other are not equal, false otherwise.""" return not self == other diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index 99ce033..b75354e 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -12,12 +12,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + """ Unit Tests for VpcV1 """ from datetime import datetime, timezone 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 base64 import inspect import json @@ -31,17 +33,19 @@ version = 'testString' generation = 2 -service = VpcV1(authenticator=NoAuthAuthenticator(), version=version) +_service = VpcV1( + authenticator=NoAuthAuthenticator(), + version=version + ) -base_url = 'https://us-south.iaas.cloud.ibm.com/v1' -service.set_service_url(base_url) +_base_url = 'https://us-south.iaas.cloud.ibm.com/v1' +_service.set_service_url(_base_url) ############################################################################## # Start of Service: VPCs ############################################################################## # region - class TestListVpcs(): """ Test Class for list_vpcs @@ -62,7 +66,7 @@ def test_list_vpcs_all_params(self): list_vpcs() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}' responses.add(responses.GET, url, @@ -77,23 +81,25 @@ def test_list_vpcs_all_params(self): classic_access = True # Invoke method - response = service.list_vpcs(start=start, - limit=limit, - resource_group_id=resource_group_id, - classic_access=classic_access, - headers={}) + response = _service.list_vpcs( + start=start, + limit=limit, + resource_group_id=resource_group_id, + classic_access=classic_access, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'classic_access={}'.format( - 'true' if classic_access else 'false') in query_string + assert 'classic_access={}'.format('true' if classic_access else 'false') in query_string + @responses.activate def test_list_vpcs_required_params(self): @@ -101,7 +107,7 @@ def test_list_vpcs_required_params(self): test_list_vpcs_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}' responses.add(responses.GET, url, @@ -110,19 +116,21 @@ def test_list_vpcs_required_params(self): status=200) # Invoke method - response = service.list_vpcs() + response = _service.list_vpcs() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpcs_value_error(self): """ test_list_vpcs_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}' responses.add(responses.GET, url, @@ -131,14 +139,13 @@ def test_list_vpcs_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_vpcs(**req_copy) + _service.list_vpcs(**req_copy) + class TestCreateVpc(): @@ -161,7 +168,7 @@ def test_create_vpc_all_params(self): create_vpc() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.POST, url, @@ -180,12 +187,13 @@ def test_create_vpc_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_vpc( + response = _service.create_vpc( address_prefix_management=address_prefix_management, classic_access=classic_access, name=name, resource_group=resource_group, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -197,13 +205,14 @@ def test_create_vpc_all_params(self): assert req_body['name'] == 'my-vpc' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_vpc_required_params(self): """ test_create_vpc_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.POST, url, @@ -212,19 +221,21 @@ def test_create_vpc_required_params(self): status=201) # Invoke method - response = service.create_vpc() + response = _service.create_vpc() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_create_vpc_value_error(self): """ test_create_vpc_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs') + url = self.preprocess_url(_base_url + '/vpcs') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.POST, url, @@ -233,14 +244,13 @@ def test_create_vpc_value_error(self): status=201) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_vpc(**req_copy) + _service.create_vpc(**req_copy) + class TestDeleteVpc(): @@ -263,27 +273,35 @@ def test_delete_vpc_all_params(self): delete_vpc() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_vpc(id, headers={}) + response = _service.delete_vpc( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_vpc_value_error(self): """ test_delete_vpc_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -293,12 +311,10 @@ def test_delete_vpc_value_error(self): "id": 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() - } + 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_vpc(**req_copy) + _service.delete_vpc(**req_copy) + class TestGetVpc(): @@ -321,7 +337,7 @@ def test_get_vpc_all_params(self): get_vpc() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.GET, url, @@ -333,19 +349,23 @@ def test_get_vpc_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc(id, headers={}) + response = _service.get_vpc( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_value_error(self): """ test_get_vpc_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.GET, url, @@ -361,12 +381,10 @@ def test_get_vpc_value_error(self): "id": 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() - } + 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_vpc(**req_copy) + _service.get_vpc(**req_copy) + class TestUpdateVpc(): @@ -389,7 +407,7 @@ def test_update_vpc_all_params(self): update_vpc() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.PATCH, url, @@ -406,7 +424,11 @@ def test_update_vpc_all_params(self): vpc_patch = vpc_patch_model # Invoke method - response = service.update_vpc(id, vpc_patch, headers={}) + response = _service.update_vpc( + id, + vpc_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -415,13 +437,14 @@ def test_update_vpc_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == vpc_patch + @responses.activate def test_update_vpc_value_error(self): """ test_update_vpc_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString') mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}' responses.add(responses.PATCH, url, @@ -443,12 +466,10 @@ def test_update_vpc_value_error(self): "vpc_patch": vpc_patch, } 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() - } + 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_vpc(**req_copy) + _service.update_vpc(**req_copy) + class TestGetVpcDefaultNetworkAcl(): @@ -471,8 +492,7 @@ def test_get_vpc_default_network_acl_all_params(self): get_vpc_default_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_network_acl') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -484,20 +504,23 @@ def test_get_vpc_default_network_acl_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_default_network_acl(id, headers={}) + response = _service.get_vpc_default_network_acl( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_default_network_acl_value_error(self): """ test_get_vpc_default_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_network_acl') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -513,12 +536,10 @@ def test_get_vpc_default_network_acl_value_error(self): "id": 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() - } + 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_vpc_default_network_acl(**req_copy) + _service.get_vpc_default_network_acl(**req_copy) + class TestGetVpcDefaultRoutingTable(): @@ -541,8 +562,7 @@ def test_get_vpc_default_routing_table_all_params(self): get_vpc_default_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_routing_table') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -554,20 +574,23 @@ def test_get_vpc_default_routing_table_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_default_routing_table(id, headers={}) + response = _service.get_vpc_default_routing_table( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_default_routing_table_value_error(self): """ test_get_vpc_default_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_routing_table') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -583,12 +606,10 @@ def test_get_vpc_default_routing_table_value_error(self): "id": 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() - } + 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_vpc_default_routing_table(**req_copy) + _service.get_vpc_default_routing_table(**req_copy) + class TestGetVpcDefaultSecurityGroup(): @@ -611,8 +632,7 @@ def test_get_vpc_default_security_group_all_params(self): get_vpc_default_security_group() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_security_group') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_security_group') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -624,20 +644,23 @@ def test_get_vpc_default_security_group_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_default_security_group(id, headers={}) + response = _service.get_vpc_default_security_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_default_security_group_value_error(self): """ test_get_vpc_default_security_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/default_security_group') + url = self.preprocess_url(_base_url + '/vpcs/testString/default_security_group') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -653,12 +676,10 @@ def test_get_vpc_default_security_group_value_error(self): "id": 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() - } + 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_vpc_default_security_group(**req_copy) + _service.get_vpc_default_security_group(**req_copy) + class TestListVpcAddressPrefixes(): @@ -681,8 +702,7 @@ def test_list_vpc_address_prefixes_all_params(self): list_vpc_address_prefixes() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/address_prefixes') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes') mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -696,28 +716,30 @@ def test_list_vpc_address_prefixes_all_params(self): limit = 1 # Invoke method - response = service.list_vpc_address_prefixes(vpc_id, - start=start, - limit=limit, - headers={}) + response = _service.list_vpc_address_prefixes( + vpc_id, + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_vpc_address_prefixes_required_params(self): """ test_list_vpc_address_prefixes_required_params() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/address_prefixes') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes') mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -729,20 +751,23 @@ def test_list_vpc_address_prefixes_required_params(self): vpc_id = 'testString' # Invoke method - response = service.list_vpc_address_prefixes(vpc_id, headers={}) + response = _service.list_vpc_address_prefixes( + vpc_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpc_address_prefixes_value_error(self): """ test_list_vpc_address_prefixes_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/address_prefixes') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes') mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -758,12 +783,10 @@ def test_list_vpc_address_prefixes_value_error(self): "vpc_id": vpc_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() - } + 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_vpc_address_prefixes(**req_copy) + _service.list_vpc_address_prefixes(**req_copy) + class TestCreateVpcAddressPrefix(): @@ -786,8 +809,7 @@ def test_create_vpc_address_prefix_all_params(self): create_vpc_address_prefix() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/address_prefixes') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -807,12 +829,14 @@ def test_create_vpc_address_prefix_all_params(self): name = 'my-address-prefix-2' # Invoke method - response = service.create_vpc_address_prefix(vpc_id, - cidr, - zone, - is_default=is_default, - name=name, - headers={}) + response = _service.create_vpc_address_prefix( + vpc_id, + cidr, + zone, + is_default=is_default, + name=name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -824,14 +848,14 @@ def test_create_vpc_address_prefix_all_params(self): assert req_body['is_default'] == True assert req_body['name'] == 'my-address-prefix-2' + @responses.activate def test_create_vpc_address_prefix_value_error(self): """ test_create_vpc_address_prefix_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/address_prefixes') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -857,12 +881,10 @@ def test_create_vpc_address_prefix_value_error(self): "zone": zone, } 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() - } + 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_vpc_address_prefix(**req_copy) + _service.create_vpc_address_prefix(**req_copy) + class TestDeleteVpcAddressPrefix(): @@ -885,30 +907,37 @@ def test_delete_vpc_address_prefix_all_params(self): delete_vpc_address_prefix() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' id = 'testString' # Invoke method - response = service.delete_vpc_address_prefix(vpc_id, id, headers={}) + response = _service.delete_vpc_address_prefix( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_vpc_address_prefix_value_error(self): """ test_delete_vpc_address_prefix_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' @@ -920,12 +949,10 @@ def test_delete_vpc_address_prefix_value_error(self): "id": 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() - } + 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_vpc_address_prefix(**req_copy) + _service.delete_vpc_address_prefix(**req_copy) + class TestGetVpcAddressPrefix(): @@ -948,8 +975,7 @@ def test_get_vpc_address_prefix_all_params(self): get_vpc_address_prefix() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -962,20 +988,24 @@ def test_get_vpc_address_prefix_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_address_prefix(vpc_id, id, headers={}) + response = _service.get_vpc_address_prefix( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_address_prefix_value_error(self): """ test_get_vpc_address_prefix_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -993,12 +1023,10 @@ def test_get_vpc_address_prefix_value_error(self): "id": 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() - } + 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_vpc_address_prefix(**req_copy) + _service.get_vpc_address_prefix(**req_copy) + class TestUpdateVpcAddressPrefix(): @@ -1021,8 +1049,7 @@ def test_update_vpc_address_prefix_all_params(self): update_vpc_address_prefix() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -1041,10 +1068,12 @@ def test_update_vpc_address_prefix_all_params(self): address_prefix_patch = address_prefix_patch_model # Invoke method - response = service.update_vpc_address_prefix(vpc_id, - id, - address_prefix_patch, - headers={}) + response = _service.update_vpc_address_prefix( + vpc_id, + id, + address_prefix_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -1053,14 +1082,14 @@ def test_update_vpc_address_prefix_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == address_prefix_patch + @responses.activate def test_update_vpc_address_prefix_value_error(self): """ test_update_vpc_address_prefix_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/address_prefixes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString') mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -1085,12 +1114,10 @@ def test_update_vpc_address_prefix_value_error(self): "address_prefix_patch": address_prefix_patch, } 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() - } + 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_vpc_address_prefix(**req_copy) + _service.update_vpc_address_prefix(**req_copy) + class TestListVpcRoutes(): @@ -1113,7 +1140,7 @@ def test_list_vpc_routes_all_params(self): list_vpc_routes() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -1128,29 +1155,32 @@ def test_list_vpc_routes_all_params(self): limit = 1 # Invoke method - response = service.list_vpc_routes(vpc_id, - zone_name=zone_name, - start=start, - limit=limit, - headers={}) + response = _service.list_vpc_routes( + vpc_id, + zone_name=zone_name, + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'zone.name={}'.format(zone_name) in query_string assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_vpc_routes_required_params(self): """ test_list_vpc_routes_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -1162,19 +1192,23 @@ def test_list_vpc_routes_required_params(self): vpc_id = 'testString' # Invoke method - response = service.list_vpc_routes(vpc_id, headers={}) + response = _service.list_vpc_routes( + vpc_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpc_routes_value_error(self): """ test_list_vpc_routes_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -1190,12 +1224,10 @@ def test_list_vpc_routes_value_error(self): "vpc_id": vpc_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() - } + 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_vpc_routes(**req_copy) + _service.list_vpc_routes(**req_copy) + class TestCreateVpcRoute(): @@ -1218,7 +1250,7 @@ def test_create_vpc_route_all_params(self): create_vpc_route() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -1243,13 +1275,15 @@ def test_create_vpc_route_all_params(self): next_hop = route_next_hop_prototype_model # Invoke method - response = service.create_vpc_route(vpc_id, - destination, - zone, - action=action, - name=name, - next_hop=next_hop, - headers={}) + response = _service.create_vpc_route( + vpc_id, + destination, + zone, + action=action, + name=name, + next_hop=next_hop, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -1262,13 +1296,14 @@ def test_create_vpc_route_all_params(self): assert req_body['name'] == 'my-route-2' assert req_body['next_hop'] == route_next_hop_prototype_model + @responses.activate def test_create_vpc_route_value_error(self): """ test_create_vpc_route_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -1299,12 +1334,10 @@ def test_create_vpc_route_value_error(self): "zone": zone, } 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() - } + 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_vpc_route(**req_copy) + _service.create_vpc_route(**req_copy) + class TestDeleteVpcRoute(): @@ -1327,30 +1360,37 @@ def test_delete_vpc_route_all_params(self): delete_vpc_route() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' id = 'testString' # Invoke method - response = service.delete_vpc_route(vpc_id, id, headers={}) + response = _service.delete_vpc_route( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_vpc_route_value_error(self): """ test_delete_vpc_route_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' @@ -1362,12 +1402,10 @@ def test_delete_vpc_route_value_error(self): "id": 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() - } + 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_vpc_route(**req_copy) + _service.delete_vpc_route(**req_copy) + class TestGetVpcRoute(): @@ -1390,8 +1428,7 @@ def test_get_vpc_route_all_params(self): get_vpc_route() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -1404,20 +1441,24 @@ def test_get_vpc_route_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_route(vpc_id, id, headers={}) + response = _service.get_vpc_route( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_route_value_error(self): """ test_get_vpc_route_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -1435,12 +1476,10 @@ def test_get_vpc_route_value_error(self): "id": 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() - } + 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_vpc_route(**req_copy) + _service.get_vpc_route(**req_copy) + class TestUpdateVpcRoute(): @@ -1463,8 +1502,7 @@ def test_update_vpc_route_all_params(self): update_vpc_route() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -1482,7 +1520,12 @@ def test_update_vpc_route_all_params(self): route_patch = route_patch_model # Invoke method - response = service.update_vpc_route(vpc_id, id, route_patch, headers={}) + response = _service.update_vpc_route( + vpc_id, + id, + route_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -1491,14 +1534,14 @@ def test_update_vpc_route_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == route_patch + @responses.activate def test_update_vpc_route_value_error(self): """ test_update_vpc_route_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -1522,12 +1565,10 @@ def test_update_vpc_route_value_error(self): "route_patch": route_patch, } 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() - } + 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_vpc_route(**req_copy) + _service.update_vpc_route(**req_copy) + class TestListVpcRoutingTables(): @@ -1550,7 +1591,7 @@ def test_list_vpc_routing_tables_all_params(self): list_vpc_routing_tables() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routing_tables') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, @@ -1565,22 +1606,24 @@ def test_list_vpc_routing_tables_all_params(self): is_default = True # Invoke method - response = service.list_vpc_routing_tables(vpc_id, - start=start, - limit=limit, - is_default=is_default, - headers={}) + response = _service.list_vpc_routing_tables( + vpc_id, + start=start, + limit=limit, + is_default=is_default, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'is_default={}'.format( - 'true' if is_default else 'false') in query_string + assert 'is_default={}'.format('true' if is_default else 'false') in query_string + @responses.activate def test_list_vpc_routing_tables_required_params(self): @@ -1588,7 +1631,7 @@ def test_list_vpc_routing_tables_required_params(self): test_list_vpc_routing_tables_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routing_tables') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, @@ -1600,19 +1643,23 @@ def test_list_vpc_routing_tables_required_params(self): vpc_id = 'testString' # Invoke method - response = service.list_vpc_routing_tables(vpc_id, headers={}) + response = _service.list_vpc_routing_tables( + vpc_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpc_routing_tables_value_error(self): """ test_list_vpc_routing_tables_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routing_tables') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, @@ -1628,12 +1675,10 @@ def test_list_vpc_routing_tables_value_error(self): "vpc_id": vpc_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() - } + 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_vpc_routing_tables(**req_copy) + _service.list_vpc_routing_tables(**req_copy) + class TestCreateVpcRoutingTable(): @@ -1656,7 +1701,7 @@ def test_create_vpc_routing_table_all_params(self): create_vpc_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routing_tables') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.POST, url, @@ -1689,14 +1734,15 @@ def test_create_vpc_routing_table_all_params(self): routes = [route_prototype_model] # Invoke method - response = service.create_vpc_routing_table( + response = _service.create_vpc_routing_table( vpc_id, name=name, route_direct_link_ingress=route_direct_link_ingress, route_transit_gateway_ingress=route_transit_gateway_ingress, route_vpc_zone_ingress=route_vpc_zone_ingress, routes=routes, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -1709,13 +1755,14 @@ def test_create_vpc_routing_table_all_params(self): assert req_body['route_vpc_zone_ingress'] == True assert req_body['routes'] == [route_prototype_model] + @responses.activate def test_create_vpc_routing_table_value_error(self): """ test_create_vpc_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpcs/testString/routing_tables') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.POST, url, @@ -1752,12 +1799,10 @@ def test_create_vpc_routing_table_value_error(self): "vpc_id": vpc_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() - } + 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_vpc_routing_table(**req_copy) + _service.create_vpc_routing_table(**req_copy) + class TestDeleteVpcRoutingTable(): @@ -1780,30 +1825,37 @@ def test_delete_vpc_routing_table_all_params(self): delete_vpc_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' id = 'testString' # Invoke method - response = service.delete_vpc_routing_table(vpc_id, id, headers={}) + response = _service.delete_vpc_routing_table( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_vpc_routing_table_value_error(self): """ test_delete_vpc_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' @@ -1815,12 +1867,10 @@ def test_delete_vpc_routing_table_value_error(self): "id": 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() - } + 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_vpc_routing_table(**req_copy) + _service.delete_vpc_routing_table(**req_copy) + class TestGetVpcRoutingTable(): @@ -1843,8 +1893,7 @@ def test_get_vpc_routing_table_all_params(self): get_vpc_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -1857,20 +1906,24 @@ def test_get_vpc_routing_table_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_routing_table(vpc_id, id, headers={}) + response = _service.get_vpc_routing_table( + vpc_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_routing_table_value_error(self): """ test_get_vpc_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -1888,12 +1941,10 @@ def test_get_vpc_routing_table_value_error(self): "id": 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() - } + 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_vpc_routing_table(**req_copy) + _service.get_vpc_routing_table(**req_copy) + class TestUpdateVpcRoutingTable(): @@ -1916,8 +1967,7 @@ def test_update_vpc_routing_table_all_params(self): update_vpc_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PATCH, url, @@ -1938,10 +1988,12 @@ def test_update_vpc_routing_table_all_params(self): routing_table_patch = routing_table_patch_model # Invoke method - response = service.update_vpc_routing_table(vpc_id, - id, - routing_table_patch, - headers={}) + response = _service.update_vpc_routing_table( + vpc_id, + id, + routing_table_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -1950,14 +2002,14 @@ def test_update_vpc_routing_table_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == routing_table_patch + @responses.activate def test_update_vpc_routing_table_value_error(self): """ test_update_vpc_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpcs/testString/routing_tables/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PATCH, url, @@ -1984,12 +2036,10 @@ def test_update_vpc_routing_table_value_error(self): "routing_table_patch": routing_table_patch, } 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() - } + 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_vpc_routing_table(**req_copy) + _service.update_vpc_routing_table(**req_copy) + class TestListVpcRoutingTableRoutes(): @@ -2012,8 +2062,7 @@ def test_list_vpc_routing_table_routes_all_params(self): list_vpc_routing_table_routes() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/routing_tables/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2028,29 +2077,31 @@ def test_list_vpc_routing_table_routes_all_params(self): limit = 1 # Invoke method - response = service.list_vpc_routing_table_routes(vpc_id, - routing_table_id, - start=start, - limit=limit, - headers={}) + response = _service.list_vpc_routing_table_routes( + vpc_id, + routing_table_id, + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_vpc_routing_table_routes_required_params(self): """ test_list_vpc_routing_table_routes_required_params() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/routing_tables/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2063,22 +2114,24 @@ def test_list_vpc_routing_table_routes_required_params(self): routing_table_id = 'testString' # Invoke method - response = service.list_vpc_routing_table_routes(vpc_id, - routing_table_id, - headers={}) + response = _service.list_vpc_routing_table_routes( + vpc_id, + routing_table_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpc_routing_table_routes_value_error(self): """ test_list_vpc_routing_table_routes_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/routing_tables/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2096,12 +2149,10 @@ def test_list_vpc_routing_table_routes_value_error(self): "routing_table_id": routing_table_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() - } + 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_vpc_routing_table_routes(**req_copy) + _service.list_vpc_routing_table_routes(**req_copy) + class TestCreateVpcRoutingTableRoute(): @@ -2124,8 +2175,7 @@ def test_create_vpc_routing_table_route_all_params(self): create_vpc_routing_table_route() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/routing_tables/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -2151,14 +2201,16 @@ def test_create_vpc_routing_table_route_all_params(self): next_hop = route_next_hop_prototype_model # Invoke method - response = service.create_vpc_routing_table_route(vpc_id, - routing_table_id, - destination, - zone, - action=action, - name=name, - next_hop=next_hop, - headers={}) + response = _service.create_vpc_routing_table_route( + vpc_id, + routing_table_id, + destination, + zone, + action=action, + name=name, + next_hop=next_hop, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -2171,14 +2223,14 @@ def test_create_vpc_routing_table_route_all_params(self): assert req_body['name'] == 'my-route-2' assert req_body['next_hop'] == route_next_hop_prototype_model + @responses.activate def test_create_vpc_routing_table_route_value_error(self): """ test_create_vpc_routing_table_route_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpcs/testString/routing_tables/testString/routes') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -2211,12 +2263,10 @@ def test_create_vpc_routing_table_route_value_error(self): "zone": zone, } 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() - } + 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_vpc_routing_table_route(**req_copy) + _service.create_vpc_routing_table_route(**req_copy) + class TestDeleteVpcRoutingTableRoute(): @@ -2239,10 +2289,10 @@ def test_delete_vpc_routing_table_route_all_params(self): delete_vpc_routing_table_route() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' @@ -2250,25 +2300,28 @@ def test_delete_vpc_routing_table_route_all_params(self): id = 'testString' # Invoke method - response = service.delete_vpc_routing_table_route(vpc_id, - routing_table_id, - id, - headers={}) + response = _service.delete_vpc_routing_table_route( + vpc_id, + routing_table_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_vpc_routing_table_route_value_error(self): """ test_delete_vpc_routing_table_route_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpc_id = 'testString' @@ -2282,12 +2335,10 @@ def test_delete_vpc_routing_table_route_value_error(self): "id": 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() - } + 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_vpc_routing_table_route(**req_copy) + _service.delete_vpc_routing_table_route(**req_copy) + class TestGetVpcRoutingTableRoute(): @@ -2310,9 +2361,7 @@ def test_get_vpc_routing_table_route_all_params(self): get_vpc_routing_table_route() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -2326,24 +2375,25 @@ def test_get_vpc_routing_table_route_all_params(self): id = 'testString' # Invoke method - response = service.get_vpc_routing_table_route(vpc_id, - routing_table_id, - id, - headers={}) + response = _service.get_vpc_routing_table_route( + vpc_id, + routing_table_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpc_routing_table_route_value_error(self): """ test_get_vpc_routing_table_route_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -2363,12 +2413,10 @@ def test_get_vpc_routing_table_route_value_error(self): "id": 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() - } + 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_vpc_routing_table_route(**req_copy) + _service.get_vpc_routing_table_route(**req_copy) + class TestUpdateVpcRoutingTableRoute(): @@ -2391,9 +2439,7 @@ def test_update_vpc_routing_table_route_all_params(self): update_vpc_routing_table_route() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -2412,11 +2458,13 @@ def test_update_vpc_routing_table_route_all_params(self): route_patch = route_patch_model # Invoke method - response = service.update_vpc_routing_table_route(vpc_id, - routing_table_id, - id, - route_patch, - headers={}) + response = _service.update_vpc_routing_table_route( + vpc_id, + routing_table_id, + id, + route_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -2425,15 +2473,14 @@ def test_update_vpc_routing_table_route_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == route_patch + @responses.activate def test_update_vpc_routing_table_route_value_error(self): """ test_update_vpc_routing_table_route_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpcs/testString/routing_tables/testString/routes/testString') + url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -2459,12 +2506,10 @@ def test_update_vpc_routing_table_route_value_error(self): "route_patch": route_patch, } 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() - } + 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_vpc_routing_table_route(**req_copy) + _service.update_vpc_routing_table_route(**req_copy) + # endregion @@ -2477,7 +2522,6 @@ def test_update_vpc_routing_table_route_value_error(self): ############################################################################## # region - class TestListSubnets(): """ Test Class for list_subnets @@ -2498,7 +2542,7 @@ def test_list_subnets_all_params(self): list_subnets() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets') + url = self.preprocess_url(_base_url + '/subnets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2514,25 +2558,27 @@ def test_list_subnets_all_params(self): routing_table_name = 'testString' # Invoke method - response = service.list_subnets(start=start, - limit=limit, - resource_group_id=resource_group_id, - routing_table_id=routing_table_id, - routing_table_name=routing_table_name, - headers={}) + response = _service.list_subnets( + start=start, + limit=limit, + resource_group_id=resource_group_id, + routing_table_id=routing_table_id, + routing_table_name=routing_table_name, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'routing_table.id={}'.format(routing_table_id) in query_string - assert 'routing_table.name={}'.format( - routing_table_name) in query_string + assert 'routing_table.name={}'.format(routing_table_name) in query_string + @responses.activate def test_list_subnets_required_params(self): @@ -2540,7 +2586,7 @@ def test_list_subnets_required_params(self): test_list_subnets_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets') + url = self.preprocess_url(_base_url + '/subnets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2549,19 +2595,21 @@ def test_list_subnets_required_params(self): status=200) # Invoke method - response = service.list_subnets() + response = _service.list_subnets() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_subnets_value_error(self): """ test_list_subnets_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets') + url = self.preprocess_url(_base_url + '/subnets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -2570,14 +2618,13 @@ def test_list_subnets_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_subnets(**req_copy) + _service.list_subnets(**req_copy) + class TestCreateSubnet(): @@ -2600,7 +2647,7 @@ def test_create_subnet_all_params(self): create_subnet() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets') + url = self.preprocess_url(_base_url + '/subnets') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -2610,13 +2657,11 @@ def test_create_subnet_all_params(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -2624,8 +2669,7 @@ def test_create_subnet_all_params(self): # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -2651,7 +2695,10 @@ def test_create_subnet_all_params(self): subnet_prototype = subnet_prototype_model # Invoke method - response = service.create_subnet(subnet_prototype, headers={}) + response = _service.create_subnet( + subnet_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -2660,13 +2707,14 @@ def test_create_subnet_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == subnet_prototype + @responses.activate def test_create_subnet_value_error(self): """ test_create_subnet_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets') + url = self.preprocess_url(_base_url + '/subnets') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -2676,13 +2724,11 @@ def test_create_subnet_value_error(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -2690,8 +2736,7 @@ def test_create_subnet_value_error(self): # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -2721,12 +2766,10 @@ def test_create_subnet_value_error(self): "subnet_prototype": subnet_prototype, } 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() - } + 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_subnet(**req_copy) + _service.create_subnet(**req_copy) + class TestDeleteSubnet(): @@ -2749,27 +2792,35 @@ def test_delete_subnet_all_params(self): delete_subnet() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_subnet(id, headers={}) + response = _service.delete_subnet( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_subnet_value_error(self): """ test_delete_subnet_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -2779,12 +2830,10 @@ def test_delete_subnet_value_error(self): "id": 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() - } + 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_subnet(**req_copy) + _service.delete_subnet(**req_copy) + class TestGetSubnet(): @@ -2807,7 +2856,7 @@ def test_get_subnet_all_params(self): get_subnet() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') + url = self.preprocess_url(_base_url + '/subnets/testString') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -2819,19 +2868,23 @@ def test_get_subnet_all_params(self): id = 'testString' # Invoke method - response = service.get_subnet(id, headers={}) + response = _service.get_subnet( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_subnet_value_error(self): """ test_get_subnet_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') + url = self.preprocess_url(_base_url + '/subnets/testString') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -2847,12 +2900,10 @@ def test_get_subnet_value_error(self): "id": 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() - } + 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_subnet(**req_copy) + _service.get_subnet(**req_copy) + class TestUpdateSubnet(): @@ -2875,7 +2926,7 @@ def test_update_subnet_all_params(self): update_subnet() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') + url = self.preprocess_url(_base_url + '/subnets/testString') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -2885,18 +2936,15 @@ def test_update_subnet_all_params(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a dict representation of a SubnetPatch model subnet_patch_model = {} @@ -2910,7 +2958,11 @@ def test_update_subnet_all_params(self): subnet_patch = subnet_patch_model # Invoke method - response = service.update_subnet(id, subnet_patch, headers={}) + response = _service.update_subnet( + id, + subnet_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -2919,13 +2971,14 @@ def test_update_subnet_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == subnet_patch + @responses.activate def test_update_subnet_value_error(self): """ test_update_subnet_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString') + url = self.preprocess_url(_base_url + '/subnets/testString') mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -2935,18 +2988,15 @@ def test_update_subnet_value_error(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a dict representation of a SubnetPatch model subnet_patch_model = {} @@ -2965,12 +3015,10 @@ def test_update_subnet_value_error(self): "subnet_patch": subnet_patch, } 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() - } + 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_subnet(**req_copy) + _service.update_subnet(**req_copy) + class TestGetSubnetNetworkAcl(): @@ -2993,7 +3041,7 @@ def test_get_subnet_network_acl_all_params(self): get_subnet_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/network_acl') + url = self.preprocess_url(_base_url + '/subnets/testString/network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -3005,19 +3053,23 @@ def test_get_subnet_network_acl_all_params(self): id = 'testString' # Invoke method - response = service.get_subnet_network_acl(id, headers={}) + response = _service.get_subnet_network_acl( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_subnet_network_acl_value_error(self): """ test_get_subnet_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/network_acl') + url = self.preprocess_url(_base_url + '/subnets/testString/network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -3033,12 +3085,10 @@ def test_get_subnet_network_acl_value_error(self): "id": 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() - } + 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_subnet_network_acl(**req_copy) + _service.get_subnet_network_acl(**req_copy) + class TestReplaceSubnetNetworkAcl(): @@ -3061,7 +3111,7 @@ def test_replace_subnet_network_acl_all_params(self): replace_subnet_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/network_acl') + url = self.preprocess_url(_base_url + '/subnets/testString/network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PUT, url, @@ -3071,17 +3121,18 @@ def test_replace_subnet_network_acl_all_params(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Set up parameter values id = 'testString' network_acl_identity = network_acl_identity_model # Invoke method - response = service.replace_subnet_network_acl(id, - network_acl_identity, - headers={}) + response = _service.replace_subnet_network_acl( + id, + network_acl_identity, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -3090,13 +3141,14 @@ def test_replace_subnet_network_acl_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_acl_identity + @responses.activate def test_replace_subnet_network_acl_value_error(self): """ test_replace_subnet_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/network_acl') + url = self.preprocess_url(_base_url + '/subnets/testString/network_acl') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PUT, url, @@ -3106,8 +3158,7 @@ def test_replace_subnet_network_acl_value_error(self): # Construct a dict representation of a NetworkACLIdentityById model network_acl_identity_model = {} - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Set up parameter values id = 'testString' @@ -3119,12 +3170,10 @@ def test_replace_subnet_network_acl_value_error(self): "network_acl_identity": network_acl_identity, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.replace_subnet_network_acl(**req_copy) + _service.replace_subnet_network_acl(**req_copy) + class TestUnsetSubnetPublicGateway(): @@ -3147,29 +3196,35 @@ def test_unset_subnet_public_gateway_all_params(self): unset_subnet_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.unset_subnet_public_gateway(id, headers={}) + response = _service.unset_subnet_public_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_unset_subnet_public_gateway_value_error(self): """ test_unset_subnet_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -3179,12 +3234,10 @@ def test_unset_subnet_public_gateway_value_error(self): "id": 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.unset_subnet_public_gateway(**req_copy) + _service.unset_subnet_public_gateway(**req_copy) + class TestGetSubnetPublicGateway(): @@ -3207,8 +3260,7 @@ def test_get_subnet_public_gateway_all_params(self): get_subnet_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -3220,20 +3272,23 @@ def test_get_subnet_public_gateway_all_params(self): id = 'testString' # Invoke method - response = service.get_subnet_public_gateway(id, headers={}) + response = _service.get_subnet_public_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_subnet_public_gateway_value_error(self): """ test_get_subnet_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -3249,12 +3304,10 @@ def test_get_subnet_public_gateway_value_error(self): "id": 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() - } + 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_subnet_public_gateway(**req_copy) + _service.get_subnet_public_gateway(**req_copy) + class TestSetSubnetPublicGateway(): @@ -3277,8 +3330,7 @@ def test_set_subnet_public_gateway_all_params(self): set_subnet_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PUT, url, @@ -3288,17 +3340,18 @@ def test_set_subnet_public_gateway_all_params(self): # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Set up parameter values id = 'testString' public_gateway_identity = public_gateway_identity_model # Invoke method - response = service.set_subnet_public_gateway(id, - public_gateway_identity, - headers={}) + response = _service.set_subnet_public_gateway( + id, + public_gateway_identity, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -3307,14 +3360,14 @@ def test_set_subnet_public_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == public_gateway_identity + @responses.activate def test_set_subnet_public_gateway_value_error(self): """ test_set_subnet_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/public_gateway') + url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PUT, url, @@ -3324,8 +3377,7 @@ def test_set_subnet_public_gateway_value_error(self): # Construct a dict representation of a PublicGatewayIdentityById model public_gateway_identity_model = {} - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Set up parameter values id = 'testString' @@ -3337,12 +3389,10 @@ def test_set_subnet_public_gateway_value_error(self): "public_gateway_identity": public_gateway_identity, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.set_subnet_public_gateway(**req_copy) + _service.set_subnet_public_gateway(**req_copy) + class TestGetSubnetRoutingTable(): @@ -3365,8 +3415,7 @@ def test_get_subnet_routing_table_all_params(self): get_subnet_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/routing_table') + url = self.preprocess_url(_base_url + '/subnets/testString/routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -3378,20 +3427,23 @@ def test_get_subnet_routing_table_all_params(self): id = 'testString' # Invoke method - response = service.get_subnet_routing_table(id, headers={}) + response = _service.get_subnet_routing_table( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_subnet_routing_table_value_error(self): """ test_get_subnet_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/routing_table') + url = self.preprocess_url(_base_url + '/subnets/testString/routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -3407,12 +3459,10 @@ def test_get_subnet_routing_table_value_error(self): "id": 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() - } + 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_subnet_routing_table(**req_copy) + _service.get_subnet_routing_table(**req_copy) + class TestReplaceSubnetRoutingTable(): @@ -3435,8 +3485,7 @@ def test_replace_subnet_routing_table_all_params(self): replace_subnet_routing_table() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/routing_table') + url = self.preprocess_url(_base_url + '/subnets/testString/routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PUT, url, @@ -3446,17 +3495,18 @@ def test_replace_subnet_routing_table_all_params(self): # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_identity_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' # Set up parameter values id = 'testString' routing_table_identity = routing_table_identity_model # Invoke method - response = service.replace_subnet_routing_table(id, - routing_table_identity, - headers={}) + response = _service.replace_subnet_routing_table( + id, + routing_table_identity, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -3465,14 +3515,14 @@ def test_replace_subnet_routing_table_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == routing_table_identity + @responses.activate def test_replace_subnet_routing_table_value_error(self): """ test_replace_subnet_routing_table_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/routing_table') + url = self.preprocess_url(_base_url + '/subnets/testString/routing_table') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PUT, url, @@ -3482,8 +3532,7 @@ def test_replace_subnet_routing_table_value_error(self): # Construct a dict representation of a RoutingTableIdentityById model routing_table_identity_model = {} - routing_table_identity_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_identity_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' # Set up parameter values id = 'testString' @@ -3495,12 +3544,10 @@ def test_replace_subnet_routing_table_value_error(self): "routing_table_identity": routing_table_identity, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.replace_subnet_routing_table(**req_copy) + _service.replace_subnet_routing_table(**req_copy) + class TestListSubnetReservedIps(): @@ -3523,7 +3570,7 @@ def test_list_subnet_reserved_ips_all_params(self): list_subnet_reserved_ips() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/reserved_ips') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -3538,29 +3585,32 @@ def test_list_subnet_reserved_ips_all_params(self): sort = 'name' # Invoke method - response = service.list_subnet_reserved_ips(subnet_id, - start=start, - limit=limit, - sort=sort, - headers={}) + response = _service.list_subnet_reserved_ips( + subnet_id, + start=start, + limit=limit, + sort=sort, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'sort={}'.format(sort) in query_string + @responses.activate def test_list_subnet_reserved_ips_required_params(self): """ test_list_subnet_reserved_ips_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/reserved_ips') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -3572,19 +3622,23 @@ def test_list_subnet_reserved_ips_required_params(self): subnet_id = 'testString' # Invoke method - response = service.list_subnet_reserved_ips(subnet_id, headers={}) + response = _service.list_subnet_reserved_ips( + subnet_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_subnet_reserved_ips_value_error(self): """ test_list_subnet_reserved_ips_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/reserved_ips') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -3600,12 +3654,10 @@ def test_list_subnet_reserved_ips_value_error(self): "subnet_id": subnet_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() - } + 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_subnet_reserved_ips(**req_copy) + _service.list_subnet_reserved_ips(**req_copy) + class TestCreateSubnetReservedIp(): @@ -3628,7 +3680,7 @@ def test_create_subnet_reserved_ip_all_params(self): create_subnet_reserved_ip() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/reserved_ips') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.POST, url, @@ -3638,8 +3690,7 @@ def test_create_subnet_reserved_ip_all_params(self): # Construct a dict representation of a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById model reserved_ip_target_prototype_model = {} - reserved_ip_target_prototype_model[ - 'id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_prototype_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' # Set up parameter values subnet_id = 'testString' @@ -3648,11 +3699,13 @@ def test_create_subnet_reserved_ip_all_params(self): target = reserved_ip_target_prototype_model # Invoke method - response = service.create_subnet_reserved_ip(subnet_id, - auto_delete=auto_delete, - name=name, - target=target, - headers={}) + response = _service.create_subnet_reserved_ip( + subnet_id, + auto_delete=auto_delete, + name=name, + target=target, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -3663,13 +3716,14 @@ def test_create_subnet_reserved_ip_all_params(self): assert req_body['name'] == 'my-reserved-ip' assert req_body['target'] == reserved_ip_target_prototype_model + @responses.activate def test_create_subnet_reserved_ip_value_error(self): """ test_create_subnet_reserved_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/subnets/testString/reserved_ips') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.POST, url, @@ -3679,8 +3733,7 @@ def test_create_subnet_reserved_ip_value_error(self): # Construct a dict representation of a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById model reserved_ip_target_prototype_model = {} - reserved_ip_target_prototype_model[ - 'id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_prototype_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' # Set up parameter values subnet_id = 'testString' @@ -3693,12 +3746,10 @@ def test_create_subnet_reserved_ip_value_error(self): "subnet_id": subnet_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() - } + 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_subnet_reserved_ip(**req_copy) + _service.create_subnet_reserved_ip(**req_copy) + class TestDeleteSubnetReservedIp(): @@ -3721,30 +3772,37 @@ def test_delete_subnet_reserved_ip_all_params(self): delete_subnet_reserved_ip() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values subnet_id = 'testString' id = 'testString' # Invoke method - response = service.delete_subnet_reserved_ip(subnet_id, id, headers={}) + response = _service.delete_subnet_reserved_ip( + subnet_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_subnet_reserved_ip_value_error(self): """ test_delete_subnet_reserved_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values subnet_id = 'testString' @@ -3756,12 +3814,10 @@ def test_delete_subnet_reserved_ip_value_error(self): "id": 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() - } + 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_subnet_reserved_ip(**req_copy) + _service.delete_subnet_reserved_ip(**req_copy) + class TestGetSubnetReservedIp(): @@ -3784,8 +3840,7 @@ def test_get_subnet_reserved_ip_all_params(self): get_subnet_reserved_ip() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, @@ -3798,20 +3853,24 @@ def test_get_subnet_reserved_ip_all_params(self): id = 'testString' # Invoke method - response = service.get_subnet_reserved_ip(subnet_id, id, headers={}) + response = _service.get_subnet_reserved_ip( + subnet_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_subnet_reserved_ip_value_error(self): """ test_get_subnet_reserved_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, @@ -3829,12 +3888,10 @@ def test_get_subnet_reserved_ip_value_error(self): "id": 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() - } + 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_subnet_reserved_ip(**req_copy) + _service.get_subnet_reserved_ip(**req_copy) + class TestUpdateSubnetReservedIp(): @@ -3857,8 +3914,7 @@ def test_update_subnet_reserved_ip_all_params(self): update_subnet_reserved_ip() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PATCH, url, @@ -3877,10 +3933,12 @@ def test_update_subnet_reserved_ip_all_params(self): reserved_ip_patch = reserved_ip_patch_model # Invoke method - response = service.update_subnet_reserved_ip(subnet_id, - id, - reserved_ip_patch, - headers={}) + response = _service.update_subnet_reserved_ip( + subnet_id, + id, + reserved_ip_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -3889,14 +3947,14 @@ def test_update_subnet_reserved_ip_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == reserved_ip_patch + @responses.activate def test_update_subnet_reserved_ip_value_error(self): """ test_update_subnet_reserved_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/subnets/testString/reserved_ips/testString') + url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PATCH, url, @@ -3921,12 +3979,10 @@ def test_update_subnet_reserved_ip_value_error(self): "reserved_ip_patch": reserved_ip_patch, } 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() - } + 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_subnet_reserved_ip(**req_copy) + _service.update_subnet_reserved_ip(**req_copy) + # endregion @@ -3939,7 +3995,6 @@ def test_update_subnet_reserved_ip_value_error(self): ############################################################################## # region - class TestListImages(): """ Test Class for list_images @@ -3960,8 +4015,8 @@ def test_list_images_all_params(self): list_images() """ # Set up mock - url = self.preprocess_url(base_url + '/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + url = self.preprocess_url(_base_url + '/images') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -3976,18 +4031,20 @@ def test_list_images_all_params(self): visibility = 'private' # Invoke method - response = service.list_images(start=start, - limit=limit, - resource_group_id=resource_group_id, - name=name, - visibility=visibility, - headers={}) + response = _service.list_images( + start=start, + limit=limit, + resource_group_id=resource_group_id, + name=name, + visibility=visibility, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string @@ -3995,14 +4052,15 @@ def test_list_images_all_params(self): assert 'name={}'.format(name) in query_string assert 'visibility={}'.format(visibility) in query_string + @responses.activate def test_list_images_required_params(self): """ test_list_images_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + url = self.preprocess_url(_base_url + '/images') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -4010,20 +4068,22 @@ def test_list_images_required_params(self): status=200) # Invoke method - response = service.list_images() + response = _service.list_images() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_images_value_error(self): """ test_list_images_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + url = self.preprocess_url(_base_url + '/images') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -4031,14 +4091,13 @@ def test_list_images_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_images(**req_copy) + _service.list_images(**req_copy) + class TestCreateImage(): @@ -4061,8 +4120,8 @@ def test_create_image_all_params(self): create_image() """ # Set up mock - url = self.preprocess_url(base_url + '/images') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.POST, url, body=mock_response, @@ -4075,13 +4134,11 @@ def test_create_image_all_params(self): # Construct a dict representation of a EncryptionKeyIdentityByCRN model encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a dict representation of a ImageFilePrototype model image_file_prototype_model = {} - image_file_prototype_model[ - 'href'] = 'cos://us-south/my-bucket/my-image.qcow2' + image_file_prototype_model['href'] = 'cos://us-south/my-bucket/my-image.qcow2' # Construct a dict representation of a OperatingSystemIdentityByName model operating_system_identity_model = {} @@ -4094,14 +4151,16 @@ def test_create_image_all_params(self): image_prototype_model['encrypted_data_key'] = 'testString' image_prototype_model['encryption_key'] = encryption_key_identity_model image_prototype_model['file'] = image_file_prototype_model - image_prototype_model[ - 'operating_system'] = operating_system_identity_model + image_prototype_model['operating_system'] = operating_system_identity_model # Set up parameter values image_prototype = image_prototype_model # Invoke method - response = service.create_image(image_prototype, headers={}) + response = _service.create_image( + image_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -4110,14 +4169,15 @@ def test_create_image_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == image_prototype + @responses.activate def test_create_image_value_error(self): """ test_create_image_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/images') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.POST, url, body=mock_response, @@ -4130,13 +4190,11 @@ def test_create_image_value_error(self): # Construct a dict representation of a EncryptionKeyIdentityByCRN model encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a dict representation of a ImageFilePrototype model image_file_prototype_model = {} - image_file_prototype_model[ - 'href'] = 'cos://us-south/my-bucket/my-image.qcow2' + image_file_prototype_model['href'] = 'cos://us-south/my-bucket/my-image.qcow2' # Construct a dict representation of a OperatingSystemIdentityByName model operating_system_identity_model = {} @@ -4149,8 +4207,7 @@ def test_create_image_value_error(self): image_prototype_model['encrypted_data_key'] = 'testString' image_prototype_model['encryption_key'] = encryption_key_identity_model image_prototype_model['file'] = image_file_prototype_model - image_prototype_model[ - 'operating_system'] = operating_system_identity_model + image_prototype_model['operating_system'] = operating_system_identity_model # Set up parameter values image_prototype = image_prototype_model @@ -4160,12 +4217,10 @@ def test_create_image_value_error(self): "image_prototype": image_prototype, } 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() - } + 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_image(**req_copy) + _service.create_image(**req_copy) + class TestDeleteImage(): @@ -4188,27 +4243,35 @@ def test_delete_image_all_params(self): delete_image() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/images/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_image(id, headers={}) + response = _service.delete_image( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 202 + @responses.activate def test_delete_image_value_error(self): """ test_delete_image_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/images/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values id = 'testString' @@ -4218,12 +4281,10 @@ def test_delete_image_value_error(self): "id": 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() - } + 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_image(**req_copy) + _service.delete_image(**req_copy) + class TestGetImage(): @@ -4246,8 +4307,8 @@ def test_get_image_all_params(self): get_image() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.GET, url, body=mock_response, @@ -4258,20 +4319,24 @@ def test_get_image_all_params(self): id = 'testString' # Invoke method - response = service.get_image(id, headers={}) + response = _service.get_image( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_image_value_error(self): """ test_get_image_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.GET, url, body=mock_response, @@ -4286,12 +4351,10 @@ def test_get_image_value_error(self): "id": 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() - } + 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_image(**req_copy) + _service.get_image(**req_copy) + class TestUpdateImage(): @@ -4314,8 +4377,8 @@ def test_update_image_all_params(self): update_image() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.PATCH, url, body=mock_response, @@ -4331,7 +4394,11 @@ def test_update_image_all_params(self): image_patch = image_patch_model # Invoke method - response = service.update_image(id, image_patch, headers={}) + response = _service.update_image( + id, + image_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -4340,14 +4407,15 @@ def test_update_image_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == image_patch + @responses.activate def test_update_image_value_error(self): """ test_update_image_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + url = self.preprocess_url(_base_url + '/images/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.PATCH, url, body=mock_response, @@ -4368,12 +4436,10 @@ def test_update_image_value_error(self): "image_patch": image_patch, } 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() - } + 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_image(**req_copy) + _service.update_image(**req_copy) + class TestListOperatingSystems(): @@ -4396,8 +4462,8 @@ def test_list_operating_systems_all_params(self): list_operating_systems() """ # Set up mock - url = self.preprocess_url(base_url + '/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' + url = self.preprocess_url(_base_url + '/operating_systems') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' responses.add(responses.GET, url, body=mock_response, @@ -4409,27 +4475,30 @@ def test_list_operating_systems_all_params(self): limit = 1 # Invoke method - response = service.list_operating_systems(start=start, - limit=limit, - headers={}) + response = _service.list_operating_systems( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_operating_systems_required_params(self): """ test_list_operating_systems_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' + url = self.preprocess_url(_base_url + '/operating_systems') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' responses.add(responses.GET, url, body=mock_response, @@ -4437,20 +4506,22 @@ def test_list_operating_systems_required_params(self): status=200) # Invoke method - response = service.list_operating_systems() + response = _service.list_operating_systems() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_operating_systems_value_error(self): """ test_list_operating_systems_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' + url = self.preprocess_url(_base_url + '/operating_systems') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}]}' responses.add(responses.GET, url, body=mock_response, @@ -4458,14 +4529,13 @@ def test_list_operating_systems_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_operating_systems(**req_copy) + _service.list_operating_systems(**req_copy) + class TestGetOperatingSystem(): @@ -4488,8 +4558,8 @@ def test_get_operating_system_all_params(self): get_operating_system() """ # Set up mock - url = self.preprocess_url(base_url + '/operating_systems/testString') - mock_response = '{"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}' + url = self.preprocess_url(_base_url + '/operating_systems/testString') + mock_response = '{"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}' responses.add(responses.GET, url, body=mock_response, @@ -4500,20 +4570,24 @@ def test_get_operating_system_all_params(self): name = 'testString' # Invoke method - response = service.get_operating_system(name, headers={}) + response = _service.get_operating_system( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_operating_system_value_error(self): """ test_get_operating_system_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/operating_systems/testString') - mock_response = '{"architecture": "amd64", "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}' + url = self.preprocess_url(_base_url + '/operating_systems/testString') + mock_response = '{"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}' responses.add(responses.GET, url, body=mock_response, @@ -4528,12 +4602,10 @@ def test_get_operating_system_value_error(self): "name": name, } 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() - } + 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_operating_system(**req_copy) + _service.get_operating_system(**req_copy) + # endregion @@ -4546,7 +4618,6 @@ def test_get_operating_system_value_error(self): ############################################################################## # region - class TestListKeys(): """ Test Class for list_keys @@ -4567,7 +4638,7 @@ def test_list_keys_all_params(self): list_keys() """ # Set up mock - url = self.preprocess_url(base_url + '/keys') + url = self.preprocess_url(_base_url + '/keys') mock_response = '{"keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}]}' responses.add(responses.GET, url, @@ -4579,24 +4650,27 @@ def test_list_keys_all_params(self): resource_group_id = 'testString' # Invoke method - response = service.list_keys(resource_group_id=resource_group_id, - headers={}) + response = _service.list_keys( + resource_group_id=resource_group_id, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'resource_group.id={}'.format(resource_group_id) in query_string + @responses.activate def test_list_keys_required_params(self): """ test_list_keys_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/keys') + url = self.preprocess_url(_base_url + '/keys') mock_response = '{"keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}]}' responses.add(responses.GET, url, @@ -4605,19 +4679,21 @@ def test_list_keys_required_params(self): status=200) # Invoke method - response = service.list_keys() + response = _service.list_keys() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_keys_value_error(self): """ test_list_keys_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/keys') + url = self.preprocess_url(_base_url + '/keys') mock_response = '{"keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}]}' responses.add(responses.GET, url, @@ -4626,14 +4702,13 @@ def test_list_keys_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_keys(**req_copy) + _service.list_keys(**req_copy) + class TestCreateKey(): @@ -4656,7 +4731,7 @@ def test_create_key_all_params(self): create_key() """ # Set up mock - url = self.preprocess_url(base_url + '/keys') + url = self.preprocess_url(_base_url + '/keys') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.POST, url, @@ -4675,30 +4750,32 @@ def test_create_key_all_params(self): type = 'rsa' # Invoke method - response = service.create_key(public_key, - name=name, - resource_group=resource_group, - type=type, - headers={}) + response = _service.create_key( + public_key, + name=name, + resource_group=resource_group, + type=type, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body[ - 'public_key'] == 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + assert req_body['public_key'] == 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' assert req_body['name'] == 'my-key' assert req_body['resource_group'] == resource_group_identity_model assert req_body['type'] == 'rsa' + @responses.activate def test_create_key_value_error(self): """ test_create_key_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/keys') + url = self.preprocess_url(_base_url + '/keys') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.POST, url, @@ -4721,12 +4798,10 @@ def test_create_key_value_error(self): "public_key": public_key, } 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() - } + 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_key(**req_copy) + _service.create_key(**req_copy) + class TestDeleteKey(): @@ -4749,27 +4824,35 @@ def test_delete_key_all_params(self): delete_key() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/keys/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_key(id, headers={}) + response = _service.delete_key( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_key_value_error(self): """ test_delete_key_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/keys/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -4779,12 +4862,10 @@ def test_delete_key_value_error(self): "id": 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() - } + 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_key(**req_copy) + _service.delete_key(**req_copy) + class TestGetKey(): @@ -4807,7 +4888,7 @@ def test_get_key_all_params(self): get_key() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') + url = self.preprocess_url(_base_url + '/keys/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.GET, url, @@ -4819,19 +4900,23 @@ def test_get_key_all_params(self): id = 'testString' # Invoke method - response = service.get_key(id, headers={}) + response = _service.get_key( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_key_value_error(self): """ test_get_key_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') + url = self.preprocess_url(_base_url + '/keys/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.GET, url, @@ -4847,12 +4932,10 @@ def test_get_key_value_error(self): "id": 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() - } + 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_key(**req_copy) + _service.get_key(**req_copy) + class TestUpdateKey(): @@ -4875,7 +4958,7 @@ def test_update_key_all_params(self): update_key() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') + url = self.preprocess_url(_base_url + '/keys/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.PATCH, url, @@ -4892,7 +4975,11 @@ def test_update_key_all_params(self): key_patch = key_patch_model # Invoke method - response = service.update_key(id, key_patch, headers={}) + response = _service.update_key( + id, + key_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -4901,13 +4988,14 @@ def test_update_key_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == key_patch + @responses.activate def test_update_key_value_error(self): """ test_update_key_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/keys/testString') + url = self.preprocess_url(_base_url + '/keys/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}' responses.add(responses.PATCH, url, @@ -4929,12 +5017,10 @@ def test_update_key_value_error(self): "key_patch": key_patch, } 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() - } + 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_key(**req_copy) + _service.update_key(**req_copy) + # endregion @@ -4947,7 +5033,6 @@ def test_update_key_value_error(self): ############################################################################## # region - class TestListInstanceProfiles(): """ Test Class for list_instance_profiles @@ -4968,8 +5053,8 @@ def test_list_instance_profiles_all_params(self): list_instance_profiles() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/profiles') - mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + url = self.preprocess_url(_base_url + '/instance/profiles') + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -4977,20 +5062,22 @@ def test_list_instance_profiles_all_params(self): status=200) # Invoke method - response = service.list_instance_profiles() + response = _service.list_instance_profiles() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_profiles_value_error(self): """ test_list_instance_profiles_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/profiles') - mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + url = self.preprocess_url(_base_url + '/instance/profiles') + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -4998,14 +5085,13 @@ def test_list_instance_profiles_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_instance_profiles(**req_copy) + _service.list_instance_profiles(**req_copy) + class TestGetInstanceProfile(): @@ -5028,8 +5114,8 @@ def test_get_instance_profile_all_params(self): get_instance_profile() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + url = self.preprocess_url(_base_url + '/instance/profiles/testString') + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5040,20 +5126,24 @@ def test_get_instance_profile_all_params(self): name = 'testString' # Invoke method - response = service.get_instance_profile(name, headers={}) + response = _service.get_instance_profile( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_profile_value_error(self): """ test_get_instance_profile_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + url = self.preprocess_url(_base_url + '/instance/profiles/testString') + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "virtio_blk", "type": "enum", "values": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5068,12 +5158,10 @@ def test_get_instance_profile_value_error(self): "name": name, } 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() - } + 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_instance_profile(**req_copy) + _service.get_instance_profile(**req_copy) + class TestListInstanceTemplates(): @@ -5096,8 +5184,8 @@ def test_list_instance_templates_all_params(self): list_instance_templates() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance/templates') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5105,20 +5193,22 @@ def test_list_instance_templates_all_params(self): status=200) # Invoke method - response = service.list_instance_templates() + response = _service.list_instance_templates() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_templates_value_error(self): """ test_list_instance_templates_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance/templates') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5126,14 +5216,13 @@ def test_list_instance_templates_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_instance_templates(**req_copy) + _service.list_instance_templates(**req_copy) + class TestCreateInstanceTemplate(): @@ -5156,8 +5245,8 @@ def test_create_instance_template_all_params(self): create_instance_template() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5170,8 +5259,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -5182,11 +5270,13 @@ def test_create_instance_template_all_params(self): network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model + # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + instance_placement_target_prototype_model = {} + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + # Construct a dict representation of a InstanceProfileIdentityByName model instance_profile_identity_model = {} instance_profile_identity_model['name'] = 'bx2-2x8' @@ -5197,17 +5287,13 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model volume_attachment_prototype_instance_context_model = {} - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -5215,8 +5301,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a EncryptionKeyIdentityByCRN model encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} @@ -5225,21 +5310,16 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model # Construct a dict representation of a ImageIdentityById model image_identity_model = {} @@ -5253,31 +5333,26 @@ def test_create_instance_template_all_params(self): instance_template_prototype_model = {} instance_template_prototype_model['keys'] = [key_identity_model] instance_template_prototype_model['name'] = 'my-instance-template' - instance_template_prototype_model['network_interfaces'] = [ - network_interface_prototype_model - ] - instance_template_prototype_model[ - 'profile'] = instance_profile_identity_model - instance_template_prototype_model[ - 'resource_group'] = resource_group_identity_model + instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_model['profile'] = instance_profile_identity_model + instance_template_prototype_model['resource_group'] = resource_group_identity_model instance_template_prototype_model['user_data'] = 'testString' - instance_template_prototype_model['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] + instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_model['vpc'] = vpc_identity_model - instance_template_prototype_model[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_prototype_model['image'] = image_identity_model - instance_template_prototype_model[ - 'primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_model['primary_network_interface'] = network_interface_prototype_model instance_template_prototype_model['zone'] = zone_identity_model # Set up parameter values instance_template_prototype = instance_template_prototype_model # Invoke method - response = service.create_instance_template(instance_template_prototype, - headers={}) + response = _service.create_instance_template( + instance_template_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -5286,14 +5361,15 @@ def test_create_instance_template_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_template_prototype + @responses.activate def test_create_instance_template_value_error(self): """ test_create_instance_template_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5306,8 +5382,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -5318,11 +5393,13 @@ def test_create_instance_template_value_error(self): network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model + # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + instance_placement_target_prototype_model = {} + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + # Construct a dict representation of a InstanceProfileIdentityByName model instance_profile_identity_model = {} instance_profile_identity_model['name'] = 'bx2-2x8' @@ -5333,17 +5410,13 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model volume_attachment_prototype_instance_context_model = {} - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -5351,8 +5424,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a EncryptionKeyIdentityByCRN model encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} @@ -5361,21 +5433,16 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model # Construct a dict representation of a ImageIdentityById model image_identity_model = {} @@ -5389,23 +5456,16 @@ def test_create_instance_template_value_error(self): instance_template_prototype_model = {} instance_template_prototype_model['keys'] = [key_identity_model] instance_template_prototype_model['name'] = 'my-instance-template' - instance_template_prototype_model['network_interfaces'] = [ - network_interface_prototype_model - ] - instance_template_prototype_model[ - 'profile'] = instance_profile_identity_model - instance_template_prototype_model[ - 'resource_group'] = resource_group_identity_model + instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_model['profile'] = instance_profile_identity_model + instance_template_prototype_model['resource_group'] = resource_group_identity_model instance_template_prototype_model['user_data'] = 'testString' - instance_template_prototype_model['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] + instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_model['vpc'] = vpc_identity_model - instance_template_prototype_model[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_prototype_model['image'] = image_identity_model - instance_template_prototype_model[ - 'primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_model['primary_network_interface'] = network_interface_prototype_model instance_template_prototype_model['zone'] = zone_identity_model # Set up parameter values @@ -5416,12 +5476,10 @@ def test_create_instance_template_value_error(self): "instance_template_prototype": instance_template_prototype, } 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() - } + 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_instance_template(**req_copy) + _service.create_instance_template(**req_copy) + class TestDeleteInstanceTemplate(): @@ -5444,27 +5502,35 @@ def test_delete_instance_template_all_params(self): delete_instance_template() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance/templates/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_instance_template(id, headers={}) + response = _service.delete_instance_template( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_template_value_error(self): """ test_delete_instance_template_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance/templates/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -5474,12 +5540,10 @@ def test_delete_instance_template_value_error(self): "id": 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() - } + 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_instance_template(**req_copy) + _service.delete_instance_template(**req_copy) + class TestGetInstanceTemplate(): @@ -5502,8 +5566,8 @@ def test_get_instance_template_all_params(self): get_instance_template() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -5514,20 +5578,24 @@ def test_get_instance_template_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_template(id, headers={}) + response = _service.get_instance_template( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_template_value_error(self): """ test_get_instance_template_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -5542,12 +5610,10 @@ def test_get_instance_template_value_error(self): "id": 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() - } + 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_instance_template(**req_copy) + _service.get_instance_template(**req_copy) + class TestUpdateInstanceTemplate(): @@ -5570,8 +5636,8 @@ def test_update_instance_template_all_params(self): update_instance_template() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -5587,9 +5653,11 @@ def test_update_instance_template_all_params(self): instance_template_patch = instance_template_patch_model # Invoke method - response = service.update_instance_template(id, - instance_template_patch, - headers={}) + response = _service.update_instance_template( + id, + instance_template_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -5598,14 +5666,15 @@ def test_update_instance_template_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_template_patch + @responses.activate def test_update_instance_template_value_error(self): """ test_update_instance_template_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instance/templates/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -5626,12 +5695,10 @@ def test_update_instance_template_value_error(self): "instance_template_patch": instance_template_patch, } 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() - } + 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_instance_template(**req_copy) + _service.update_instance_template(**req_copy) + class TestListInstances(): @@ -5654,8 +5721,8 @@ def test_list_instances_all_params(self): list_instances() """ # Set up mock - url = self.preprocess_url(base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instances') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5672,20 +5739,22 @@ def test_list_instances_all_params(self): vpc_name = 'testString' # Invoke method - response = service.list_instances(start=start, - limit=limit, - resource_group_id=resource_group_id, - name=name, - vpc_id=vpc_id, - vpc_crn=vpc_crn, - vpc_name=vpc_name, - headers={}) + response = _service.list_instances( + start=start, + limit=limit, + resource_group_id=resource_group_id, + name=name, + vpc_id=vpc_id, + vpc_crn=vpc_crn, + vpc_name=vpc_name, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string @@ -5695,14 +5764,15 @@ def test_list_instances_all_params(self): assert 'vpc.crn={}'.format(vpc_crn) in query_string assert 'vpc.name={}'.format(vpc_name) in query_string + @responses.activate def test_list_instances_required_params(self): """ test_list_instances_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instances') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5710,20 +5780,22 @@ def test_list_instances_required_params(self): status=200) # Invoke method - response = service.list_instances() + response = _service.list_instances() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instances_value_error(self): """ test_list_instances_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instances') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5731,14 +5803,13 @@ def test_list_instances_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_instances(**req_copy) + _service.list_instances(**req_copy) + class TestCreateInstance(): @@ -5761,8 +5832,8 @@ def test_create_instance_all_params(self): create_instance() """ # Set up mock - url = self.preprocess_url(base_url + '/instances') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5775,8 +5846,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -5787,11 +5857,13 @@ def test_create_instance_all_params(self): network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model + # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + instance_placement_target_prototype_model = {} + instance_placement_target_prototype_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221' + # Construct a dict representation of a InstanceProfileIdentityByName model instance_profile_identity_model = {} instance_profile_identity_model['name'] = 'bx2-2x8' @@ -5800,35 +5872,27 @@ def test_create_instance_all_params(self): resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a EncryptionKeyIdentityByCRN model - encryption_key_identity_model = {} - encryption_key_identity_model['crn'] = 'crn:[...]' - # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} volume_profile_identity_model['name'] = '5iops-tier' + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + encryption_key_identity_model['crn'] = 'crn:[...]' + # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model[ - 'encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_context_model[ - 'iops'] = 10000 - volume_attachment_volume_prototype_instance_context_model[ - 'name'] = 'my-data-volume' - volume_attachment_volume_prototype_instance_context_model[ - 'profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_context_model[ - 'capacity'] = 1000 + volume_attachment_volume_prototype_instance_context_model['iops'] = 10000 + volume_attachment_volume_prototype_instance_context_model['name'] = 'my-data-volume' + volume_attachment_volume_prototype_instance_context_model['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_model['capacity'] = 1000 + volume_attachment_volume_prototype_instance_context_model['encryption_key'] = encryption_key_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model volume_attachment_prototype_instance_context_model = {} - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -5837,22 +5901,16 @@ def test_create_instance_all_params(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 - volume_prototype_instance_by_image_context_model[ - 'name'] = 'my-boot-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model # Construct a dict representation of a ImageIdentityById model image_identity_model = {} @@ -5866,29 +5924,26 @@ def test_create_instance_all_params(self): instance_prototype_model = {} instance_prototype_model['keys'] = [key_identity_model] instance_prototype_model['name'] = 'my-instance' - instance_prototype_model['network_interfaces'] = [ - network_interface_prototype_model - ] + instance_prototype_model['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_model['placement_target'] = instance_placement_target_prototype_model instance_prototype_model['profile'] = instance_profile_identity_model - instance_prototype_model[ - 'resource_group'] = resource_group_identity_model + instance_prototype_model['resource_group'] = resource_group_identity_model instance_prototype_model['user_data'] = 'testString' - instance_prototype_model['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] + instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_prototype_model['vpc'] = vpc_identity_model - instance_prototype_model[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_prototype_model['image'] = image_identity_model - instance_prototype_model[ - 'primary_network_interface'] = network_interface_prototype_model + instance_prototype_model['primary_network_interface'] = network_interface_prototype_model instance_prototype_model['zone'] = zone_identity_model # Set up parameter values instance_prototype = instance_prototype_model # Invoke method - response = service.create_instance(instance_prototype, headers={}) + response = _service.create_instance( + instance_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -5897,14 +5952,15 @@ def test_create_instance_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_prototype + @responses.activate def test_create_instance_value_error(self): """ test_create_instance_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -5917,8 +5973,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -5929,11 +5984,13 @@ def test_create_instance_value_error(self): network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model + # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + instance_placement_target_prototype_model = {} + instance_placement_target_prototype_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221' + # Construct a dict representation of a InstanceProfileIdentityByName model instance_profile_identity_model = {} instance_profile_identity_model['name'] = 'bx2-2x8' @@ -5942,35 +5999,27 @@ def test_create_instance_value_error(self): resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a EncryptionKeyIdentityByCRN model - encryption_key_identity_model = {} - encryption_key_identity_model['crn'] = 'crn:[...]' - # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} volume_profile_identity_model['name'] = '5iops-tier' + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + encryption_key_identity_model['crn'] = 'crn:[...]' + # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model[ - 'encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_context_model[ - 'iops'] = 10000 - volume_attachment_volume_prototype_instance_context_model[ - 'name'] = 'my-data-volume' - volume_attachment_volume_prototype_instance_context_model[ - 'profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_context_model[ - 'capacity'] = 1000 + volume_attachment_volume_prototype_instance_context_model['iops'] = 10000 + volume_attachment_volume_prototype_instance_context_model['name'] = 'my-data-volume' + volume_attachment_volume_prototype_instance_context_model['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_model['capacity'] = 1000 + volume_attachment_volume_prototype_instance_context_model['encryption_key'] = encryption_key_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model volume_attachment_prototype_instance_context_model = {} - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -5979,22 +6028,16 @@ def test_create_instance_value_error(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 - volume_prototype_instance_by_image_context_model[ - 'name'] = 'my-boot-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model # Construct a dict representation of a ImageIdentityById model image_identity_model = {} @@ -6008,22 +6051,16 @@ def test_create_instance_value_error(self): instance_prototype_model = {} instance_prototype_model['keys'] = [key_identity_model] instance_prototype_model['name'] = 'my-instance' - instance_prototype_model['network_interfaces'] = [ - network_interface_prototype_model - ] + instance_prototype_model['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_model['placement_target'] = instance_placement_target_prototype_model instance_prototype_model['profile'] = instance_profile_identity_model - instance_prototype_model[ - 'resource_group'] = resource_group_identity_model + instance_prototype_model['resource_group'] = resource_group_identity_model instance_prototype_model['user_data'] = 'testString' - instance_prototype_model['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] + instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_prototype_model['vpc'] = vpc_identity_model - instance_prototype_model[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_prototype_model['image'] = image_identity_model - instance_prototype_model[ - 'primary_network_interface'] = network_interface_prototype_model + instance_prototype_model['primary_network_interface'] = network_interface_prototype_model instance_prototype_model['zone'] = zone_identity_model # Set up parameter values @@ -6034,12 +6071,10 @@ def test_create_instance_value_error(self): "instance_prototype": instance_prototype, } 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() - } + 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_instance(**req_copy) + _service.create_instance(**req_copy) + class TestDeleteInstance(): @@ -6062,27 +6097,35 @@ def test_delete_instance_all_params(self): delete_instance() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_instance(id, headers={}) + response = _service.delete_instance( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_value_error(self): """ test_delete_instance_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -6092,12 +6135,10 @@ def test_delete_instance_value_error(self): "id": 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() - } + 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_instance(**req_copy) + _service.delete_instance(**req_copy) + class TestGetInstance(): @@ -6120,8 +6161,8 @@ def test_get_instance_all_params(self): get_instance() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances/testString') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6132,20 +6173,24 @@ def test_get_instance_all_params(self): id = 'testString' # Invoke method - response = service.get_instance(id, headers={}) + response = _service.get_instance( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_value_error(self): """ test_get_instance_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances/testString') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6160,12 +6205,10 @@ def test_get_instance_value_error(self): "id": 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() - } + 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_instance(**req_copy) + _service.get_instance(**req_copy) + class TestUpdateInstance(): @@ -6188,24 +6231,33 @@ def test_update_instance_all_params(self): update_instance() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances/testString') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, content_type='application/json', status=200) + # Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model + instance_patch_profile_model = {} + instance_patch_profile_model['name'] = 'bc1-4x16' + # Construct a dict representation of a InstancePatch model instance_patch_model = {} instance_patch_model['name'] = 'my-instance' + instance_patch_model['profile'] = instance_patch_profile_model # Set up parameter values id = 'testString' instance_patch = instance_patch_model # Invoke method - response = service.update_instance(id, instance_patch, headers={}) + response = _service.update_instance( + id, + instance_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -6214,23 +6266,29 @@ def test_update_instance_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_patch + @responses.activate def test_update_instance_value_error(self): """ test_update_instance_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString') - mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/instances/testString') + mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, content_type='application/json', status=200) + # Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model + instance_patch_profile_model = {} + instance_patch_profile_model['name'] = 'bc1-4x16' + # Construct a dict representation of a InstancePatch model instance_patch_model = {} instance_patch_model['name'] = 'my-instance' + instance_patch_model['profile'] = instance_patch_profile_model # Set up parameter values id = 'testString' @@ -6242,12 +6300,10 @@ def test_update_instance_value_error(self): "instance_patch": instance_patch, } 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() - } + 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_instance(**req_copy) + _service.update_instance(**req_copy) + class TestGetInstanceInitialization(): @@ -6270,8 +6326,7 @@ def test_get_instance_initialization_all_params(self): get_instance_initialization() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/initialization') + url = self.preprocess_url(_base_url + '/instances/testString/initialization') mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}}}' responses.add(responses.GET, url, @@ -6283,20 +6338,23 @@ def test_get_instance_initialization_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_initialization(id, headers={}) + response = _service.get_instance_initialization( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_initialization_value_error(self): """ test_get_instance_initialization_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/initialization') + url = self.preprocess_url(_base_url + '/instances/testString/initialization') mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}}}' responses.add(responses.GET, url, @@ -6312,12 +6370,10 @@ def test_get_instance_initialization_value_error(self): "id": 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() - } + 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_instance_initialization(**req_copy) + _service.get_instance_initialization(**req_copy) + class TestCreateInstanceAction(): @@ -6340,7 +6396,7 @@ def test_create_instance_action_all_params(self): create_instance_action() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString/actions') + url = self.preprocess_url(_base_url + '/instances/testString/actions') mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' responses.add(responses.POST, url, @@ -6354,10 +6410,12 @@ def test_create_instance_action_all_params(self): force = True # Invoke method - response = service.create_instance_action(instance_id, - type, - force=force, - headers={}) + response = _service.create_instance_action( + instance_id, + type, + force=force, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -6367,13 +6425,14 @@ def test_create_instance_action_all_params(self): assert req_body['type'] == 'reboot' assert req_body['force'] == True + @responses.activate def test_create_instance_action_value_error(self): """ test_create_instance_action_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instances/testString/actions') + url = self.preprocess_url(_base_url + '/instances/testString/actions') mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' responses.add(responses.POST, url, @@ -6392,12 +6451,324 @@ def test_create_instance_action_value_error(self): "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() - } + 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_instance_action(**req_copy) + + + +class TestCreateInstanceConsoleAccessToken(): + """ + Test Class for create_instance_console_access_token + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_create_instance_console_access_token_all_params(self): + """ + create_instance_console_access_token() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/console_access_token') + mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}' + responses.add(responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + console_type = 'serial' + force = False + + # Invoke method + response = _service.create_instance_console_access_token( + instance_id, + console_type, + force=force, + 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['console_type'] == 'serial' + assert req_body['force'] == False + + + @responses.activate + def test_create_instance_console_access_token_value_error(self): + """ + test_create_instance_console_access_token_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/console_access_token') + mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}' + responses.add(responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + console_type = 'serial' + force = False + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "console_type": console_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_instance_console_access_token(**req_copy) + + + +class TestListInstanceDisks(): + """ + Test Class for list_instance_disks + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_list_instance_disks_all_params(self): + """ + list_instance_disks() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks') + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + + # Invoke method + response = _service.list_instance_disks( + instance_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_list_instance_disks_value_error(self): + """ + test_list_instance_disks_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks') + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_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.create_instance_action(**req_copy) + _service.list_instance_disks(**req_copy) + + + +class TestGetInstanceDisk(): + """ + Test Class for get_instance_disk + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_get_instance_disk_all_params(self): + """ + get_instance_disk() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_instance_disk( + instance_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_get_instance_disk_value_error(self): + """ + test_get_instance_disk_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "id": 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_instance_disk(**req_copy) + + + +class TestUpdateInstanceDisk(): + """ + Test Class for update_instance_disk + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_update_instance_disk_all_params(self): + """ + update_instance_disk() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a InstanceDiskPatch model + instance_disk_patch_model = {} + instance_disk_patch_model['name'] = 'my-instance-disk-updated' + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + instance_disk_patch = instance_disk_patch_model + + # Invoke method + response = _service.update_instance_disk( + instance_id, + id, + instance_disk_patch, + 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 == instance_disk_patch + + + @responses.activate + def test_update_instance_disk_value_error(self): + """ + test_update_instance_disk_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instances/testString/disks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "virtio_blk", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a InstanceDiskPatch model + instance_disk_patch_model = {} + instance_disk_patch_model['name'] = 'my-instance-disk-updated' + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + instance_disk_patch = instance_disk_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "id": id, + "instance_disk_patch": instance_disk_patch, + } + 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_instance_disk(**req_copy) + class TestListInstanceNetworkInterfaces(): @@ -6420,8 +6791,7 @@ def test_list_instance_network_interfaces_all_params(self): list_instance_network_interfaces() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces') mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}' responses.add(responses.GET, url, @@ -6433,21 +6803,23 @@ def test_list_instance_network_interfaces_all_params(self): instance_id = 'testString' # Invoke method - response = service.list_instance_network_interfaces(instance_id, - headers={}) + response = _service.list_instance_network_interfaces( + instance_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_network_interfaces_value_error(self): """ test_list_instance_network_interfaces_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces') mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}' responses.add(responses.GET, url, @@ -6463,12 +6835,10 @@ def test_list_instance_network_interfaces_value_error(self): "instance_id": instance_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() - } + 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_instance_network_interfaces(**req_copy) + _service.list_instance_network_interfaces(**req_copy) + class TestCreateInstanceNetworkInterface(): @@ -6491,8 +6861,7 @@ def test_create_instance_network_interface_all_params(self): create_instance_network_interface() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.POST, url, @@ -6506,8 +6875,7 @@ def test_create_instance_network_interface_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values instance_id = 'testString' @@ -6518,14 +6886,15 @@ def test_create_instance_network_interface_all_params(self): security_groups = [security_group_identity_model] # Invoke method - response = service.create_instance_network_interface( + response = _service.create_instance_network_interface( instance_id, subnet, allow_ip_spoofing=allow_ip_spoofing, name=name, primary_ipv4_address=primary_ipv4_address, security_groups=security_groups, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -6538,14 +6907,14 @@ def test_create_instance_network_interface_all_params(self): assert req_body['primary_ipv4_address'] == '10.0.0.5' assert req_body['security_groups'] == [security_group_identity_model] + @responses.activate def test_create_instance_network_interface_value_error(self): """ test_create_instance_network_interface_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.POST, url, @@ -6559,8 +6928,7 @@ def test_create_instance_network_interface_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values instance_id = 'testString' @@ -6576,12 +6944,10 @@ def test_create_instance_network_interface_value_error(self): "subnet": subnet, } 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() - } + 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_instance_network_interface(**req_copy) + _service.create_instance_network_interface(**req_copy) + class TestDeleteInstanceNetworkInterface(): @@ -6604,32 +6970,37 @@ def test_delete_instance_network_interface_all_params(self): delete_instance_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' id = 'testString' # Invoke method - response = service.delete_instance_network_interface(instance_id, - id, - headers={}) + response = _service.delete_instance_network_interface( + instance_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_network_interface_value_error(self): """ test_delete_instance_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' @@ -6641,12 +7012,10 @@ def test_delete_instance_network_interface_value_error(self): "id": 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() - } + 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_instance_network_interface(**req_copy) + _service.delete_instance_network_interface(**req_copy) + class TestGetInstanceNetworkInterface(): @@ -6669,8 +7038,7 @@ def test_get_instance_network_interface_all_params(self): get_instance_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, @@ -6683,22 +7051,24 @@ def test_get_instance_network_interface_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_network_interface(instance_id, - id, - headers={}) + response = _service.get_instance_network_interface( + instance_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_network_interface_value_error(self): """ test_get_instance_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, @@ -6716,12 +7086,10 @@ def test_get_instance_network_interface_value_error(self): "id": 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() - } + 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_instance_network_interface(**req_copy) + _service.get_instance_network_interface(**req_copy) + class TestUpdateInstanceNetworkInterface(): @@ -6744,8 +7112,7 @@ def test_update_instance_network_interface_all_params(self): update_instance_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PATCH, url, @@ -6764,8 +7131,12 @@ def test_update_instance_network_interface_all_params(self): network_interface_patch = network_interface_patch_model # Invoke method - response = service.update_instance_network_interface( - instance_id, id, network_interface_patch, headers={}) + response = _service.update_instance_network_interface( + instance_id, + id, + network_interface_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -6774,14 +7145,14 @@ def test_update_instance_network_interface_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_interface_patch + @responses.activate def test_update_instance_network_interface_value_error(self): """ test_update_instance_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PATCH, url, @@ -6806,12 +7177,10 @@ def test_update_instance_network_interface_value_error(self): "network_interface_patch": network_interface_patch, } 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() - } + 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_instance_network_interface(**req_copy) + _service.update_instance_network_interface(**req_copy) + class TestListInstanceNetworkInterfaceFloatingIps(): @@ -6834,9 +7203,7 @@ def test_list_instance_network_interface_floating_ips_all_params(self): list_instance_network_interface_floating_ips() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips') mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, @@ -6849,22 +7216,24 @@ def test_list_instance_network_interface_floating_ips_all_params(self): network_interface_id = 'testString' # Invoke method - response = service.list_instance_network_interface_floating_ips( - instance_id, network_interface_id, headers={}) + response = _service.list_instance_network_interface_floating_ips( + instance_id, + network_interface_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_network_interface_floating_ips_value_error(self): """ test_list_instance_network_interface_floating_ips_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips') + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips') mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, @@ -6882,12 +7251,10 @@ def test_list_instance_network_interface_floating_ips_value_error(self): "network_interface_id": network_interface_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() - } + 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_instance_network_interface_floating_ips(**req_copy) + _service.list_instance_network_interface_floating_ips(**req_copy) + class TestRemoveInstanceNetworkInterfaceFloatingIp(): @@ -6910,11 +7277,10 @@ def test_remove_instance_network_interface_floating_ip_all_params(self): remove_instance_network_interface_floating_ip() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' @@ -6922,24 +7288,28 @@ def test_remove_instance_network_interface_floating_ip_all_params(self): id = 'testString' # Invoke method - response = service.remove_instance_network_interface_floating_ip( - instance_id, network_interface_id, id, headers={}) + response = _service.remove_instance_network_interface_floating_ip( + instance_id, + network_interface_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_remove_instance_network_interface_floating_ip_value_error(self): """ test_remove_instance_network_interface_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' @@ -6953,13 +7323,10 @@ def test_remove_instance_network_interface_floating_ip_value_error(self): "id": 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() - } + 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_instance_network_interface_floating_ip( - **req_copy) + _service.remove_instance_network_interface_floating_ip(**req_copy) + class TestGetInstanceNetworkInterfaceFloatingIp(): @@ -6982,10 +7349,7 @@ def test_get_instance_network_interface_floating_ip_all_params(self): get_instance_network_interface_floating_ip() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -6999,23 +7363,25 @@ def test_get_instance_network_interface_floating_ip_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_network_interface_floating_ip( - instance_id, network_interface_id, id, headers={}) + response = _service.get_instance_network_interface_floating_ip( + instance_id, + network_interface_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_network_interface_floating_ip_value_error(self): """ test_get_instance_network_interface_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -7035,12 +7401,10 @@ def test_get_instance_network_interface_floating_ip_value_error(self): "id": 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() - } + 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_instance_network_interface_floating_ip(**req_copy) + _service.get_instance_network_interface_floating_ip(**req_copy) + class TestAddInstanceNetworkInterfaceFloatingIp(): @@ -7063,10 +7427,7 @@ def test_add_instance_network_interface_floating_ip_all_params(self): add_instance_network_interface_floating_ip() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PUT, url, @@ -7080,23 +7441,25 @@ def test_add_instance_network_interface_floating_ip_all_params(self): id = 'testString' # Invoke method - response = service.add_instance_network_interface_floating_ip( - instance_id, network_interface_id, id, headers={}) + response = _service.add_instance_network_interface_floating_ip( + instance_id, + network_interface_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_add_instance_network_interface_floating_ip_value_error(self): """ test_add_instance_network_interface_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instances/testString/network_interfaces/testString/floating_ips/testString' - ) + url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PUT, url, @@ -7116,12 +7479,10 @@ def test_add_instance_network_interface_floating_ip_value_error(self): "id": 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() - } + 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_instance_network_interface_floating_ip(**req_copy) + _service.add_instance_network_interface_floating_ip(**req_copy) + class TestListInstanceVolumeAttachments(): @@ -7144,8 +7505,7 @@ def test_list_instance_volume_attachments_all_params(self): list_instance_volume_attachments() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/volume_attachments') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') mock_response = '{"volume_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' responses.add(responses.GET, url, @@ -7157,21 +7517,23 @@ def test_list_instance_volume_attachments_all_params(self): instance_id = 'testString' # Invoke method - response = service.list_instance_volume_attachments(instance_id, - headers={}) + response = _service.list_instance_volume_attachments( + instance_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_volume_attachments_value_error(self): """ test_list_instance_volume_attachments_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/volume_attachments') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') mock_response = '{"volume_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}]}' responses.add(responses.GET, url, @@ -7187,12 +7549,10 @@ def test_list_instance_volume_attachments_value_error(self): "instance_id": instance_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() - } + 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_instance_volume_attachments(**req_copy) + _service.list_instance_volume_attachments(**req_copy) + class TestCreateInstanceVolumeAttachment(): @@ -7215,8 +7575,7 @@ def test_create_instance_volume_attachment_all_params(self): create_instance_volume_attachment() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/volume_attachments') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.POST, url, @@ -7235,12 +7594,13 @@ def test_create_instance_volume_attachment_all_params(self): name = 'my-volume-attachment' # Invoke method - response = service.create_instance_volume_attachment( + response = _service.create_instance_volume_attachment( instance_id, volume, delete_volume_on_instance_delete=delete_volume_on_instance_delete, name=name, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -7251,14 +7611,14 @@ def test_create_instance_volume_attachment_all_params(self): assert req_body['delete_volume_on_instance_delete'] == True assert req_body['name'] == 'my-volume-attachment' + @responses.activate def test_create_instance_volume_attachment_value_error(self): """ test_create_instance_volume_attachment_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instances/testString/volume_attachments') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.POST, url, @@ -7282,12 +7642,10 @@ def test_create_instance_volume_attachment_value_error(self): "volume": volume, } 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() - } + 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_instance_volume_attachment(**req_copy) + _service.create_instance_volume_attachment(**req_copy) + class TestDeleteInstanceVolumeAttachment(): @@ -7310,32 +7668,37 @@ def test_delete_instance_volume_attachment_all_params(self): delete_instance_volume_attachment() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' id = 'testString' # Invoke method - response = service.delete_instance_volume_attachment(instance_id, - id, - headers={}) + response = _service.delete_instance_volume_attachment( + instance_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_volume_attachment_value_error(self): """ test_delete_instance_volume_attachment_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_id = 'testString' @@ -7347,12 +7710,10 @@ def test_delete_instance_volume_attachment_value_error(self): "id": 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() - } + 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_instance_volume_attachment(**req_copy) + _service.delete_instance_volume_attachment(**req_copy) + class TestGetInstanceVolumeAttachment(): @@ -7375,8 +7736,7 @@ def test_get_instance_volume_attachment_all_params(self): get_instance_volume_attachment() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.GET, url, @@ -7389,22 +7749,24 @@ def test_get_instance_volume_attachment_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_volume_attachment(instance_id, - id, - headers={}) + response = _service.get_instance_volume_attachment( + instance_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_volume_attachment_value_error(self): """ test_get_instance_volume_attachment_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.GET, url, @@ -7422,12 +7784,10 @@ def test_get_instance_volume_attachment_value_error(self): "id": 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() - } + 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_instance_volume_attachment(**req_copy) + _service.get_instance_volume_attachment(**req_copy) + class TestUpdateInstanceVolumeAttachment(): @@ -7450,8 +7810,7 @@ def test_update_instance_volume_attachment_all_params(self): update_instance_volume_attachment() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.PATCH, url, @@ -7470,8 +7829,12 @@ def test_update_instance_volume_attachment_all_params(self): volume_attachment_patch = volume_attachment_patch_model # Invoke method - response = service.update_instance_volume_attachment( - instance_id, id, volume_attachment_patch, headers={}) + response = _service.update_instance_volume_attachment( + instance_id, + id, + volume_attachment_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -7480,14 +7843,14 @@ def test_update_instance_volume_attachment_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == volume_attachment_patch + @responses.activate def test_update_instance_volume_attachment_value_error(self): """ test_update_instance_volume_attachment_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instances/testString/volume_attachments/testString') + url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' responses.add(responses.PATCH, url, @@ -7512,12 +7875,10 @@ def test_update_instance_volume_attachment_value_error(self): "volume_attachment_patch": volume_attachment_patch, } 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() - } + 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_instance_volume_attachment(**req_copy) + _service.update_instance_volume_attachment(**req_copy) + # endregion @@ -7530,7 +7891,6 @@ def test_update_instance_volume_attachment_value_error(self): ############################################################################## # region - class TestListInstanceGroups(): """ Test Class for list_instance_groups @@ -7551,8 +7911,8 @@ def test_list_instance_groups_all_params(self): list_instance_groups() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -7564,27 +7924,30 @@ def test_list_instance_groups_all_params(self): limit = 1 # Invoke method - response = service.list_instance_groups(start=start, - limit=limit, - headers={}) + response = _service.list_instance_groups( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_instance_groups_required_params(self): """ test_list_instance_groups_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -7592,20 +7955,22 @@ def test_list_instance_groups_required_params(self): status=200) # Invoke method - response = service.list_instance_groups() + response = _service.list_instance_groups() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_instance_groups_value_error(self): """ test_list_instance_groups_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -7613,14 +7978,13 @@ def test_list_instance_groups_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_instance_groups(**req_copy) + _service.list_instance_groups(**req_copy) + class TestCreateInstanceGroup(): @@ -7643,8 +8007,8 @@ def test_create_instance_group_all_params(self): create_instance_group() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -7653,8 +8017,7 @@ def test_create_instance_group_all_params(self): # Construct a dict representation of a InstanceTemplateIdentityById model instance_template_identity_model = {} - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -7662,13 +8025,11 @@ def test_create_instance_group_all_params(self): # Construct a dict representation of a LoadBalancerIdentityById model load_balancer_identity_model = {} - load_balancer_identity_model[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -7685,7 +8046,7 @@ def test_create_instance_group_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_instance_group( + response = _service.create_instance_group( instance_template, subnets, application_port=application_port, @@ -7694,7 +8055,8 @@ def test_create_instance_group_all_params(self): membership_count=membership_count, name=name, resource_group=resource_group, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -7705,20 +8067,20 @@ def test_create_instance_group_all_params(self): assert req_body['subnets'] == [subnet_identity_model] assert req_body['application_port'] == 22 assert req_body['load_balancer'] == load_balancer_identity_model - assert req_body[ - 'load_balancer_pool'] == load_balancer_pool_identity_model + assert req_body['load_balancer_pool'] == load_balancer_pool_identity_model assert req_body['membership_count'] == 10 assert req_body['name'] == 'my-instance-group' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_instance_group_value_error(self): """ test_create_instance_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -7727,8 +8089,7 @@ def test_create_instance_group_value_error(self): # Construct a dict representation of a InstanceTemplateIdentityById model instance_template_identity_model = {} - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -7736,13 +8097,11 @@ def test_create_instance_group_value_error(self): # Construct a dict representation of a LoadBalancerIdentityById model load_balancer_identity_model = {} - load_balancer_identity_model[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -7764,12 +8123,10 @@ def test_create_instance_group_value_error(self): "subnets": subnets, } 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() - } + 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_instance_group(**req_copy) + _service.create_instance_group(**req_copy) + class TestDeleteInstanceGroup(): @@ -7792,27 +8149,35 @@ def test_delete_instance_group_all_params(self): delete_instance_group() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_instance_group(id, headers={}) + response = _service.delete_instance_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_group_value_error(self): """ test_delete_instance_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -7822,12 +8187,10 @@ def test_delete_instance_group_value_error(self): "id": 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() - } + 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_instance_group(**req_copy) + _service.delete_instance_group(**req_copy) + class TestGetInstanceGroup(): @@ -7850,8 +8213,8 @@ def test_get_instance_group_all_params(self): get_instance_group() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups/testString') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -7862,20 +8225,24 @@ def test_get_instance_group_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_group(id, headers={}) + response = _service.get_instance_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_group_value_error(self): """ test_get_instance_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups/testString') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -7890,12 +8257,10 @@ def test_get_instance_group_value_error(self): "id": 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() - } + 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_instance_group(**req_copy) + _service.get_instance_group(**req_copy) + class TestUpdateInstanceGroup(): @@ -7918,8 +8283,8 @@ def test_update_instance_group_all_params(self): update_instance_group() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups/testString') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -7928,18 +8293,15 @@ def test_update_instance_group_all_params(self): # Construct a dict representation of a InstanceTemplateIdentityById model instance_template_identity_model = {} - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a dict representation of a LoadBalancerIdentityById model load_balancer_identity_model = {} - load_balancer_identity_model[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -7948,12 +8310,9 @@ def test_update_instance_group_all_params(self): # Construct a dict representation of a InstanceGroupPatch model instance_group_patch_model = {} instance_group_patch_model['application_port'] = 22 - instance_group_patch_model[ - 'instance_template'] = instance_template_identity_model - instance_group_patch_model[ - 'load_balancer'] = load_balancer_identity_model - instance_group_patch_model[ - 'load_balancer_pool'] = load_balancer_pool_identity_model + instance_group_patch_model['instance_template'] = instance_template_identity_model + instance_group_patch_model['load_balancer'] = load_balancer_identity_model + instance_group_patch_model['load_balancer_pool'] = load_balancer_pool_identity_model instance_group_patch_model['membership_count'] = 10 instance_group_patch_model['name'] = 'my-instance-group' instance_group_patch_model['subnets'] = [subnet_identity_model] @@ -7963,9 +8322,11 @@ def test_update_instance_group_all_params(self): instance_group_patch = instance_group_patch_model # Invoke method - response = service.update_instance_group(id, - instance_group_patch, - headers={}) + response = _service.update_instance_group( + id, + instance_group_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -7974,14 +8335,15 @@ def test_update_instance_group_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_group_patch + @responses.activate def test_update_instance_group_value_error(self): """ test_update_instance_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/instance_groups/testString') - mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/instance_groups/testString') + mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -7990,18 +8352,15 @@ def test_update_instance_group_value_error(self): # Construct a dict representation of a InstanceTemplateIdentityById model instance_template_identity_model = {} - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a dict representation of a LoadBalancerIdentityById model load_balancer_identity_model = {} - load_balancer_identity_model[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -8010,12 +8369,9 @@ def test_update_instance_group_value_error(self): # Construct a dict representation of a InstanceGroupPatch model instance_group_patch_model = {} instance_group_patch_model['application_port'] = 22 - instance_group_patch_model[ - 'instance_template'] = instance_template_identity_model - instance_group_patch_model[ - 'load_balancer'] = load_balancer_identity_model - instance_group_patch_model[ - 'load_balancer_pool'] = load_balancer_pool_identity_model + instance_group_patch_model['instance_template'] = instance_template_identity_model + instance_group_patch_model['load_balancer'] = load_balancer_identity_model + instance_group_patch_model['load_balancer_pool'] = load_balancer_pool_identity_model instance_group_patch_model['membership_count'] = 10 instance_group_patch_model['name'] = 'my-instance-group' instance_group_patch_model['subnets'] = [subnet_identity_model] @@ -8030,12 +8386,10 @@ def test_update_instance_group_value_error(self): "instance_group_patch": instance_group_patch, } 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() - } + 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_instance_group(**req_copy) + _service.update_instance_group(**req_copy) + class TestDeleteInstanceGroupLoadBalancer(): @@ -8058,30 +8412,35 @@ def test_delete_instance_group_load_balancer_all_params(self): delete_instance_group_load_balancer() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/load_balancer') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/load_balancer') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' # Invoke method - response = service.delete_instance_group_load_balancer( - instance_group_id, headers={}) + response = _service.delete_instance_group_load_balancer( + instance_group_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_group_load_balancer_value_error(self): """ test_delete_instance_group_load_balancer_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/load_balancer') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/load_balancer') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -8091,12 +8450,10 @@ def test_delete_instance_group_load_balancer_value_error(self): "instance_group_id": instance_group_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() - } + 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_instance_group_load_balancer(**req_copy) + _service.delete_instance_group_load_balancer(**req_copy) + class TestListInstanceGroupManagers(): @@ -8119,9 +8476,8 @@ def test_list_instance_group_managers_all_params(self): list_instance_group_managers() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/managers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -8130,14 +8486,54 @@ def test_list_instance_group_managers_all_params(self): # Set up parameter values instance_group_id = 'testString' + start = 'testString' + limit = 1 # Invoke method - response = service.list_instance_group_managers(instance_group_id, - headers={}) + response = _service.list_instance_group_managers( + instance_group_id, + start=start, + limit=limit, + 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 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + + @responses.activate + def test_list_instance_group_managers_required_params(self): + """ + test_list_instance_group_managers_required_params() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + + # Invoke method + response = _service.list_instance_group_managers( + instance_group_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + @responses.activate def test_list_instance_group_managers_value_error(self): @@ -8145,9 +8541,8 @@ def test_list_instance_group_managers_value_error(self): test_list_instance_group_managers_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/managers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -8162,12 +8557,10 @@ def test_list_instance_group_managers_value_error(self): "instance_group_id": instance_group_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() - } + 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_instance_group_managers(**req_copy) + _service.list_instance_group_managers(**req_copy) + class TestCreateInstanceGroupManager(): @@ -8190,9 +8583,8 @@ def test_create_instance_group_manager_all_params(self): create_instance_group_manager() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/managers') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.POST, url, body=mock_response, @@ -8202,8 +8594,7 @@ def test_create_instance_group_manager_all_params(self): # Construct a dict representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model instance_group_manager_prototype_model = {} instance_group_manager_prototype_model['management_enabled'] = True - instance_group_manager_prototype_model[ - 'name'] = 'my-instance-group-manager' + instance_group_manager_prototype_model['name'] = 'my-instance-group-manager' instance_group_manager_prototype_model['aggregation_window'] = 120 instance_group_manager_prototype_model['cooldown'] = 210 instance_group_manager_prototype_model['manager_type'] = 'autoscale' @@ -8215,8 +8606,11 @@ def test_create_instance_group_manager_all_params(self): instance_group_manager_prototype = instance_group_manager_prototype_model # Invoke method - response = service.create_instance_group_manager( - instance_group_id, instance_group_manager_prototype, headers={}) + response = _service.create_instance_group_manager( + instance_group_id, + instance_group_manager_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -8225,15 +8619,15 @@ def test_create_instance_group_manager_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_group_manager_prototype + @responses.activate def test_create_instance_group_manager_value_error(self): """ test_create_instance_group_manager_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/managers') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.POST, url, body=mock_response, @@ -8243,8 +8637,7 @@ def test_create_instance_group_manager_value_error(self): # Construct a dict representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model instance_group_manager_prototype_model = {} instance_group_manager_prototype_model['management_enabled'] = True - instance_group_manager_prototype_model[ - 'name'] = 'my-instance-group-manager' + instance_group_manager_prototype_model['name'] = 'my-instance-group-manager' instance_group_manager_prototype_model['aggregation_window'] = 120 instance_group_manager_prototype_model['cooldown'] = 210 instance_group_manager_prototype_model['manager_type'] = 'autoscale' @@ -8257,18 +8650,14 @@ def test_create_instance_group_manager_value_error(self): # Pass in all but one required param and check for a ValueError req_param_dict = { - "instance_group_id": - instance_group_id, - "instance_group_manager_prototype": - instance_group_manager_prototype, + "instance_group_id": instance_group_id, + "instance_group_manager_prototype": instance_group_manager_prototype, } 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() - } + 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_instance_group_manager(**req_copy) + _service.create_instance_group_manager(**req_copy) + class TestDeleteInstanceGroupManager(): @@ -8291,32 +8680,37 @@ def test_delete_instance_group_manager_all_params(self): delete_instance_group_manager() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' id = 'testString' # Invoke method - response = service.delete_instance_group_manager(instance_group_id, - id, - headers={}) + response = _service.delete_instance_group_manager( + instance_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_group_manager_value_error(self): """ test_delete_instance_group_manager_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -8328,12 +8722,10 @@ def test_delete_instance_group_manager_value_error(self): "id": 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() - } + 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_instance_group_manager(**req_copy) + _service.delete_instance_group_manager(**req_copy) + class TestGetInstanceGroupManager(): @@ -8356,9 +8748,8 @@ def test_get_instance_group_manager_all_params(self): get_instance_group_manager() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.GET, url, body=mock_response, @@ -8370,23 +8761,25 @@ def test_get_instance_group_manager_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_group_manager(instance_group_id, - id, - headers={}) + response = _service.get_instance_group_manager( + instance_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_group_manager_value_error(self): """ test_get_instance_group_manager_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.GET, url, body=mock_response, @@ -8403,12 +8796,10 @@ def test_get_instance_group_manager_value_error(self): "id": 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() - } + 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_instance_group_manager(**req_copy) + _service.get_instance_group_manager(**req_copy) + class TestUpdateInstanceGroupManager(): @@ -8431,9 +8822,8 @@ def test_update_instance_group_manager_all_params(self): update_instance_group_manager() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.PATCH, url, body=mock_response, @@ -8455,8 +8845,12 @@ def test_update_instance_group_manager_all_params(self): instance_group_manager_patch = instance_group_manager_patch_model # Invoke method - response = service.update_instance_group_manager( - instance_group_id, id, instance_group_manager_patch, headers={}) + response = _service.update_instance_group_manager( + instance_group_id, + id, + instance_group_manager_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -8465,15 +8859,15 @@ def test_update_instance_group_manager_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_group_manager_patch + @responses.activate def test_update_instance_group_manager_value_error(self): """ test_update_instance_group_manager_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/managers/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}' responses.add(responses.PATCH, url, body=mock_response, @@ -8501,17 +8895,15 @@ def test_update_instance_group_manager_value_error(self): "instance_group_manager_patch": instance_group_manager_patch, } 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() - } + 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_instance_group_manager(**req_copy) + _service.update_instance_group_manager(**req_copy) -class TestListInstanceGroupManagerPolicies(): + +class TestListInstanceGroupManagerActions(): """ - Test Class for list_instance_group_manager_policies + Test Class for list_instance_group_manager_actions """ def preprocess_url(self, request_url: str): @@ -8524,15 +8916,13 @@ def preprocess_url(self, request_url: str): return re.compile(request_url.rstrip('/') + '/+') @responses.activate - def test_list_instance_group_manager_policies_all_params(self): + def test_list_instance_group_manager_actions_all_params(self): """ - list_instance_group_manager_policies() + list_instance_group_manager_actions() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions') + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -8542,25 +8932,66 @@ def test_list_instance_group_manager_policies_all_params(self): # Set up parameter values instance_group_id = 'testString' instance_group_manager_id = 'testString' + start = 'testString' + limit = 1 # Invoke method - response = service.list_instance_group_manager_policies( - instance_group_id, instance_group_manager_id, headers={}) + response = _service.list_instance_group_manager_actions( + instance_group_id, + instance_group_manager_id, + start=start, + limit=limit, + 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 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + @responses.activate - def test_list_instance_group_manager_policies_value_error(self): + def test_list_instance_group_manager_actions_required_params(self): """ - test_list_instance_group_manager_policies_value_error() + test_list_instance_group_manager_actions_required_params() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions') + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + + # Invoke method + response = _service.list_instance_group_manager_actions( + instance_group_id, + instance_group_manager_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_list_instance_group_manager_actions_value_error(self): + """ + test_list_instance_group_manager_actions_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions') + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -8577,17 +9008,15 @@ def test_list_instance_group_manager_policies_value_error(self): "instance_group_manager_id": instance_group_manager_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() - } + 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_instance_group_manager_policies(**req_copy) + _service.list_instance_group_manager_actions(**req_copy) -class TestCreateInstanceGroupManagerPolicy(): + +class TestCreateInstanceGroupManagerAction(): """ - Test Class for create_instance_group_manager_policy + Test Class for create_instance_group_manager_action """ def preprocess_url(self, request_url: str): @@ -8600,98 +9029,95 @@ def preprocess_url(self, request_url: str): return re.compile(request_url.rstrip('/') + '/+') @responses.activate - def test_create_instance_group_manager_policy_all_params(self): + def test_create_instance_group_manager_action_all_params(self): """ - create_instance_group_manager_policy() + create_instance_group_manager_action() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) - # Construct a dict representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model - instance_group_manager_policy_prototype_model = {} - instance_group_manager_policy_prototype_model[ - 'name'] = 'my-instance-group-manager-policy' - instance_group_manager_policy_prototype_model['metric_type'] = 'cpu' - instance_group_manager_policy_prototype_model['metric_value'] = 38 - instance_group_manager_policy_prototype_model['policy_type'] = 'target' + # Construct a dict representation of a InstanceGroupManagerScheduledActionGroupPrototype model + instance_group_manager_scheduled_action_group_prototype_model = {} + instance_group_manager_scheduled_action_group_prototype_model['membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup model + instance_group_manager_action_prototype_model = {} + instance_group_manager_action_prototype_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_model['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_prototype_model['group'] = instance_group_manager_scheduled_action_group_prototype_model # Set up parameter values instance_group_id = 'testString' instance_group_manager_id = 'testString' - instance_group_manager_policy_prototype = instance_group_manager_policy_prototype_model + instance_group_manager_action_prototype = instance_group_manager_action_prototype_model # Invoke method - response = service.create_instance_group_manager_policy( + response = _service.create_instance_group_manager_action( instance_group_id, instance_group_manager_id, - instance_group_manager_policy_prototype, - headers={}) + instance_group_manager_action_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == instance_group_manager_policy_prototype + assert req_body == instance_group_manager_action_prototype + @responses.activate - def test_create_instance_group_manager_policy_value_error(self): + def test_create_instance_group_manager_action_value_error(self): """ - test_create_instance_group_manager_policy_value_error() + test_create_instance_group_manager_action_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) - # Construct a dict representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model - instance_group_manager_policy_prototype_model = {} - instance_group_manager_policy_prototype_model[ - 'name'] = 'my-instance-group-manager-policy' - instance_group_manager_policy_prototype_model['metric_type'] = 'cpu' - instance_group_manager_policy_prototype_model['metric_value'] = 38 - instance_group_manager_policy_prototype_model['policy_type'] = 'target' + # Construct a dict representation of a InstanceGroupManagerScheduledActionGroupPrototype model + instance_group_manager_scheduled_action_group_prototype_model = {} + instance_group_manager_scheduled_action_group_prototype_model['membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup model + instance_group_manager_action_prototype_model = {} + instance_group_manager_action_prototype_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_model['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_prototype_model['group'] = instance_group_manager_scheduled_action_group_prototype_model # Set up parameter values instance_group_id = 'testString' instance_group_manager_id = 'testString' - instance_group_manager_policy_prototype = instance_group_manager_policy_prototype_model + instance_group_manager_action_prototype = instance_group_manager_action_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "instance_group_id": - instance_group_id, - "instance_group_manager_id": - instance_group_manager_id, - "instance_group_manager_policy_prototype": - instance_group_manager_policy_prototype, + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "instance_group_manager_action_prototype": instance_group_manager_action_prototype, } 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() - } + 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_instance_group_manager_policy(**req_copy) + _service.create_instance_group_manager_action(**req_copy) -class TestDeleteInstanceGroupManagerPolicy(): + +class TestDeleteInstanceGroupManagerAction(): """ - Test Class for delete_instance_group_manager_policy + Test Class for delete_instance_group_manager_action """ def preprocess_url(self, request_url: str): @@ -8704,16 +9130,15 @@ def preprocess_url(self, request_url: str): return re.compile(request_url.rstrip('/') + '/+') @responses.activate - def test_delete_instance_group_manager_policy_all_params(self): + def test_delete_instance_group_manager_action_all_params(self): """ - delete_instance_group_manager_policy() + delete_instance_group_manager_action() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -8721,24 +9146,28 @@ def test_delete_instance_group_manager_policy_all_params(self): id = 'testString' # Invoke method - response = service.delete_instance_group_manager_policy( - instance_group_id, instance_group_manager_id, id, headers={}) + response = _service.delete_instance_group_manager_action( + instance_group_id, + instance_group_manager_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate - def test_delete_instance_group_manager_policy_value_error(self): + def test_delete_instance_group_manager_action_value_error(self): """ - test_delete_instance_group_manager_policy_value_error() + test_delete_instance_group_manager_action_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -8752,17 +9181,15 @@ def test_delete_instance_group_manager_policy_value_error(self): "id": 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() - } + 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_instance_group_manager_policy(**req_copy) + _service.delete_instance_group_manager_action(**req_copy) -class TestGetInstanceGroupManagerPolicy(): + +class TestGetInstanceGroupManagerAction(): """ - Test Class for get_instance_group_manager_policy + Test Class for get_instance_group_manager_action """ def preprocess_url(self, request_url: str): @@ -8775,16 +9202,13 @@ def preprocess_url(self, request_url: str): return re.compile(request_url.rstrip('/') + '/+') @responses.activate - def test_get_instance_group_manager_policy_all_params(self): + def test_get_instance_group_manager_action_all_params(self): """ - get_instance_group_manager_policy() + get_instance_group_manager_action() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.GET, url, body=mock_response, @@ -8797,24 +9221,26 @@ def test_get_instance_group_manager_policy_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_group_manager_policy( - instance_group_id, instance_group_manager_id, id, headers={}) + response = _service.get_instance_group_manager_action( + instance_group_id, + instance_group_manager_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate - def test_get_instance_group_manager_policy_value_error(self): + def test_get_instance_group_manager_action_value_error(self): """ - test_get_instance_group_manager_policy_value_error() + test_get_instance_group_manager_action_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.GET, url, body=mock_response, @@ -8833,12 +9259,487 @@ def test_get_instance_group_manager_policy_value_error(self): "id": 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() - } + 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_instance_group_manager_policy(**req_copy) + _service.get_instance_group_manager_action(**req_copy) + + + +class TestUpdateInstanceGroupManagerAction(): + """ + Test Class for update_instance_group_manager_action + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_update_instance_group_manager_action_all_params(self): + """ + update_instance_group_manager_action() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a InstanceGroupManagerScheduledActionGroupPatch model + instance_group_manager_scheduled_action_group_patch_model = {} + instance_group_manager_scheduled_action_group_patch_model['membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch model + instance_group_manager_scheduled_action_by_manager_patch_manager_model = {} + instance_group_manager_scheduled_action_by_manager_patch_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_patch_manager_model['min_membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerActionPatchScheduledActionPatch model + instance_group_manager_action_patch_model = {} + instance_group_manager_action_patch_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_model['group'] = instance_group_manager_scheduled_action_group_patch_model + instance_group_manager_action_patch_model['manager'] = instance_group_manager_scheduled_action_by_manager_patch_manager_model + instance_group_manager_action_patch_model['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + instance_group_manager_action_patch = instance_group_manager_action_patch_model + + # Invoke method + response = _service.update_instance_group_manager_action( + instance_group_id, + instance_group_manager_id, + id, + instance_group_manager_action_patch, + 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 == instance_group_manager_action_patch + + + @responses.activate + def test_update_instance_group_manager_action_value_error(self): + """ + test_update_instance_group_manager_action_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString') + mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a InstanceGroupManagerScheduledActionGroupPatch model + instance_group_manager_scheduled_action_group_patch_model = {} + instance_group_manager_scheduled_action_group_patch_model['membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch model + instance_group_manager_scheduled_action_by_manager_patch_manager_model = {} + instance_group_manager_scheduled_action_by_manager_patch_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_patch_manager_model['min_membership_count'] = 10 + + # Construct a dict representation of a InstanceGroupManagerActionPatchScheduledActionPatch model + instance_group_manager_action_patch_model = {} + instance_group_manager_action_patch_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_model['group'] = instance_group_manager_scheduled_action_group_patch_model + instance_group_manager_action_patch_model['manager'] = instance_group_manager_scheduled_action_by_manager_patch_manager_model + instance_group_manager_action_patch_model['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + instance_group_manager_action_patch = instance_group_manager_action_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "id": id, + "instance_group_manager_action_patch": instance_group_manager_action_patch, + } + 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_instance_group_manager_action(**req_copy) + + + +class TestListInstanceGroupManagerPolicies(): + """ + Test Class for list_instance_group_manager_policies + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_list_instance_group_manager_policies_all_params(self): + """ + list_instance_group_manager_policies() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + start = 'testString' + limit = 1 + + # Invoke method + response = _service.list_instance_group_manager_policies( + instance_group_id, + instance_group_manager_id, + start=start, + limit=limit, + 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 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + + @responses.activate + def test_list_instance_group_manager_policies_required_params(self): + """ + test_list_instance_group_manager_policies_required_params() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + + # Invoke method + response = _service.list_instance_group_manager_policies( + instance_group_id, + instance_group_manager_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_list_instance_group_manager_policies_value_error(self): + """ + test_list_instance_group_manager_policies_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_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_instance_group_manager_policies(**req_copy) + + + +class TestCreateInstanceGroupManagerPolicy(): + """ + Test Class for create_instance_group_manager_policy + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_create_instance_group_manager_policy_all_params(self): + """ + create_instance_group_manager_policy() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + responses.add(responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201) + + # Construct a dict representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model + instance_group_manager_policy_prototype_model = {} + instance_group_manager_policy_prototype_model['name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_prototype_model['metric_type'] = 'cpu' + instance_group_manager_policy_prototype_model['metric_value'] = 38 + instance_group_manager_policy_prototype_model['policy_type'] = 'target' + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + instance_group_manager_policy_prototype = instance_group_manager_policy_prototype_model + + # Invoke method + response = _service.create_instance_group_manager_policy( + instance_group_id, + instance_group_manager_id, + instance_group_manager_policy_prototype, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == instance_group_manager_policy_prototype + + + @responses.activate + def test_create_instance_group_manager_policy_value_error(self): + """ + test_create_instance_group_manager_policy_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + responses.add(responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201) + + # Construct a dict representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model + instance_group_manager_policy_prototype_model = {} + instance_group_manager_policy_prototype_model['name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_prototype_model['metric_type'] = 'cpu' + instance_group_manager_policy_prototype_model['metric_value'] = 38 + instance_group_manager_policy_prototype_model['policy_type'] = 'target' + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + instance_group_manager_policy_prototype = instance_group_manager_policy_prototype_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "instance_group_manager_policy_prototype": instance_group_manager_policy_prototype, + } + 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_instance_group_manager_policy(**req_copy) + + + +class TestDeleteInstanceGroupManagerPolicy(): + """ + Test Class for delete_instance_group_manager_policy + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_delete_instance_group_manager_policy_all_params(self): + """ + delete_instance_group_manager_policy() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + responses.add(responses.DELETE, + url, + status=204) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_instance_group_manager_policy( + instance_group_id, + instance_group_manager_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + + @responses.activate + def test_delete_instance_group_manager_policy_value_error(self): + """ + test_delete_instance_group_manager_policy_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + responses.add(responses.DELETE, + url, + status=204) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "id": 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_instance_group_manager_policy(**req_copy) + + + +class TestGetInstanceGroupManagerPolicy(): + """ + Test Class for get_instance_group_manager_policy + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_get_instance_group_manager_policy_all_params(self): + """ + get_instance_group_manager_policy() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_instance_group_manager_policy( + instance_group_id, + instance_group_manager_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_get_instance_group_manager_policy_value_error(self): + """ + test_get_instance_group_manager_policy_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + instance_group_manager_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "id": 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_instance_group_manager_policy(**req_copy) + class TestUpdateInstanceGroupManagerPolicy(): @@ -8861,11 +9762,8 @@ def test_update_instance_group_manager_policy_all_params(self): update_instance_group_manager_policy() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' responses.add(responses.PATCH, url, body=mock_response, @@ -8876,8 +9774,7 @@ def test_update_instance_group_manager_policy_all_params(self): instance_group_manager_policy_patch_model = {} instance_group_manager_policy_patch_model['metric_type'] = 'cpu' instance_group_manager_policy_patch_model['metric_value'] = 38 - instance_group_manager_policy_patch_model[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_patch_model['name'] = 'my-instance-group-manager-policy' # Set up parameter values instance_group_id = 'testString' @@ -8886,12 +9783,13 @@ def test_update_instance_group_manager_policy_all_params(self): instance_group_manager_policy_patch = instance_group_manager_policy_patch_model # Invoke method - response = service.update_instance_group_manager_policy( + response = _service.update_instance_group_manager_policy( instance_group_id, instance_group_manager_id, id, instance_group_manager_policy_patch, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -8900,17 +9798,15 @@ def test_update_instance_group_manager_policy_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_group_manager_policy_patch + @responses.activate def test_update_instance_group_manager_policy_value_error(self): """ test_update_instance_group_manager_policy_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/instance_groups/testString/managers/testString/policies/testString' - ) - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}' responses.add(responses.PATCH, url, body=mock_response, @@ -8921,8 +9817,7 @@ def test_update_instance_group_manager_policy_value_error(self): instance_group_manager_policy_patch_model = {} instance_group_manager_policy_patch_model['metric_type'] = 'cpu' instance_group_manager_policy_patch_model['metric_value'] = 38 - instance_group_manager_policy_patch_model[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_patch_model['name'] = 'my-instance-group-manager-policy' # Set up parameter values instance_group_id = 'testString' @@ -8932,22 +9827,16 @@ def test_update_instance_group_manager_policy_value_error(self): # Pass in all but one required param and check for a ValueError req_param_dict = { - "instance_group_id": - instance_group_id, - "instance_group_manager_id": - instance_group_manager_id, - "id": - id, - "instance_group_manager_policy_patch": - instance_group_manager_policy_patch, + "instance_group_id": instance_group_id, + "instance_group_manager_id": instance_group_manager_id, + "id": id, + "instance_group_manager_policy_patch": instance_group_manager_policy_patch, } 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() - } + 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_instance_group_manager_policy(**req_copy) + _service.update_instance_group_manager_policy(**req_copy) + class TestDeleteInstanceGroupMemberships(): @@ -8970,30 +9859,35 @@ def test_delete_instance_group_memberships_all_params(self): delete_instance_group_memberships() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/memberships') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' # Invoke method - response = service.delete_instance_group_memberships(instance_group_id, - headers={}) + response = _service.delete_instance_group_memberships( + instance_group_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_group_memberships_value_error(self): """ test_delete_instance_group_memberships_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/memberships') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -9003,12 +9897,10 @@ def test_delete_instance_group_memberships_value_error(self): "instance_group_id": instance_group_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() - } + 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_instance_group_memberships(**req_copy) + _service.delete_instance_group_memberships(**req_copy) + class TestListInstanceGroupMemberships(): @@ -9031,9 +9923,8 @@ def test_list_instance_group_memberships_all_params(self): list_instance_group_memberships() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/memberships') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9042,14 +9933,54 @@ def test_list_instance_group_memberships_all_params(self): # Set up parameter values instance_group_id = 'testString' + start = 'testString' + limit = 1 # Invoke method - response = service.list_instance_group_memberships(instance_group_id, - headers={}) + response = _service.list_instance_group_memberships( + instance_group_id, + start=start, + limit=limit, + 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 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + + @responses.activate + def test_list_instance_group_memberships_required_params(self): + """ + test_list_instance_group_memberships_required_params() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_group_id = 'testString' + + # Invoke method + response = _service.list_instance_group_memberships( + instance_group_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + @responses.activate def test_list_instance_group_memberships_value_error(self): @@ -9057,9 +9988,8 @@ def test_list_instance_group_memberships_value_error(self): test_list_instance_group_memberships_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/instance_groups/testString/memberships') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9074,12 +10004,10 @@ def test_list_instance_group_memberships_value_error(self): "instance_group_id": instance_group_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() - } + 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_instance_group_memberships(**req_copy) + _service.list_instance_group_memberships(**req_copy) + class TestDeleteInstanceGroupMembership(): @@ -9102,32 +10030,37 @@ def test_delete_instance_group_membership_all_params(self): delete_instance_group_membership() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' id = 'testString' # Invoke method - response = service.delete_instance_group_membership(instance_group_id, - id, - headers={}) + response = _service.delete_instance_group_membership( + instance_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_instance_group_membership_value_error(self): """ test_delete_instance_group_membership_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values instance_group_id = 'testString' @@ -9139,12 +10072,10 @@ def test_delete_instance_group_membership_value_error(self): "id": 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() - } + 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_instance_group_membership(**req_copy) + _service.delete_instance_group_membership(**req_copy) + class TestGetInstanceGroupMembership(): @@ -9167,9 +10098,8 @@ def test_get_instance_group_membership_all_params(self): get_instance_group_membership() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - mock_response = '{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response, @@ -9181,23 +10111,25 @@ def test_get_instance_group_membership_all_params(self): id = 'testString' # Invoke method - response = service.get_instance_group_membership(instance_group_id, - id, - headers={}) + response = _service.get_instance_group_membership( + instance_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_instance_group_membership_value_error(self): """ test_get_instance_group_membership_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - mock_response = '{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response, @@ -9214,12 +10146,10 @@ def test_get_instance_group_membership_value_error(self): "id": 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() - } + 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_instance_group_membership(**req_copy) + _service.get_instance_group_membership(**req_copy) + class TestUpdateInstanceGroupMembership(): @@ -9242,9 +10172,8 @@ def test_update_instance_group_membership_all_params(self): update_instance_group_membership() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - mock_response = '{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.PATCH, url, body=mock_response, @@ -9253,8 +10182,7 @@ def test_update_instance_group_membership_all_params(self): # Construct a dict representation of a InstanceGroupMembershipPatch model instance_group_membership_patch_model = {} - instance_group_membership_patch_model[ - 'name'] = 'my-instance-group-membership' + instance_group_membership_patch_model['name'] = 'my-instance-group-membership' # Set up parameter values instance_group_id = 'testString' @@ -9262,8 +10190,12 @@ def test_update_instance_group_membership_all_params(self): instance_group_membership_patch = instance_group_membership_patch_model # Invoke method - response = service.update_instance_group_membership( - instance_group_id, id, instance_group_membership_patch, headers={}) + response = _service.update_instance_group_membership( + instance_group_id, + id, + instance_group_membership_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -9272,15 +10204,15 @@ def test_update_instance_group_membership_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == instance_group_membership_patch + @responses.activate def test_update_instance_group_membership_value_error(self): """ test_update_instance_group_membership_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/instance_groups/testString/memberships/testString') - mock_response = '{"delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting"}' + url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.PATCH, url, body=mock_response, @@ -9289,8 +10221,7 @@ def test_update_instance_group_membership_value_error(self): # Construct a dict representation of a InstanceGroupMembershipPatch model instance_group_membership_patch_model = {} - instance_group_membership_patch_model[ - 'name'] = 'my-instance-group-membership' + instance_group_membership_patch_model['name'] = 'my-instance-group-membership' # Set up parameter values instance_group_id = 'testString' @@ -9304,12 +10235,10 @@ def test_update_instance_group_membership_value_error(self): "instance_group_membership_patch": instance_group_membership_patch, } 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() - } + 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_instance_group_membership(**req_copy) + _service.update_instance_group_membership(**req_copy) + # endregion @@ -9322,7 +10251,6 @@ def test_update_instance_group_membership_value_error(self): ############################################################################## # region - class TestListDedicatedHostGroups(): """ Test Class for list_dedicated_host_groups @@ -9343,7 +10271,7 @@ def test_list_dedicated_host_groups_all_params(self): list_dedicated_host_groups() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -9358,31 +10286,33 @@ def test_list_dedicated_host_groups_all_params(self): zone_name = 'testString' # Invoke method - response = service.list_dedicated_host_groups( + response = _service.list_dedicated_host_groups( start=start, limit=limit, resource_group_id=resource_group_id, zone_name=zone_name, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'zone.name={}'.format(zone_name) in query_string + @responses.activate def test_list_dedicated_host_groups_required_params(self): """ test_list_dedicated_host_groups_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -9391,19 +10321,21 @@ def test_list_dedicated_host_groups_required_params(self): status=200) # Invoke method - response = service.list_dedicated_host_groups() + response = _service.list_dedicated_host_groups() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_dedicated_host_groups_value_error(self): """ test_list_dedicated_host_groups_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -9412,14 +10344,13 @@ def test_list_dedicated_host_groups_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_dedicated_host_groups(**req_copy) + _service.list_dedicated_host_groups(**req_copy) + class TestCreateDedicatedHostGroup(): @@ -9442,7 +10373,7 @@ def test_create_dedicated_host_group_all_params(self): create_dedicated_host_group() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -9466,13 +10397,14 @@ def test_create_dedicated_host_group_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_dedicated_host_group( + response = _service.create_dedicated_host_group( class_=class_, family=family, zone=zone, name=name, resource_group=resource_group, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -9485,13 +10417,14 @@ def test_create_dedicated_host_group_all_params(self): assert req_body['name'] == 'testString' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_dedicated_host_group_required_params(self): """ test_create_dedicated_host_group_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -9500,19 +10433,21 @@ def test_create_dedicated_host_group_required_params(self): status=201) # Invoke method - response = service.create_dedicated_host_group() + response = _service.create_dedicated_host_group() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_create_dedicated_host_group_value_error(self): """ test_create_dedicated_host_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/groups') + url = self.preprocess_url(_base_url + '/dedicated_host/groups') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -9521,14 +10456,13 @@ def test_create_dedicated_host_group_value_error(self): status=201) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_dedicated_host_group(**req_copy) + _service.create_dedicated_host_group(**req_copy) + class TestDeleteDedicatedHostGroup(): @@ -9551,29 +10485,35 @@ def test_delete_dedicated_host_group_all_params(self): delete_dedicated_host_group() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_dedicated_host_group(id, headers={}) + response = _service.delete_dedicated_host_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_dedicated_host_group_value_error(self): """ test_delete_dedicated_host_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -9583,12 +10523,10 @@ def test_delete_dedicated_host_group_value_error(self): "id": 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() - } + 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_dedicated_host_group(**req_copy) + _service.delete_dedicated_host_group(**req_copy) + class TestGetDedicatedHostGroup(): @@ -9611,8 +10549,7 @@ def test_get_dedicated_host_group_all_params(self): get_dedicated_host_group() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -9624,20 +10561,23 @@ def test_get_dedicated_host_group_all_params(self): id = 'testString' # Invoke method - response = service.get_dedicated_host_group(id, headers={}) + response = _service.get_dedicated_host_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_dedicated_host_group_value_error(self): """ test_get_dedicated_host_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -9653,12 +10593,10 @@ def test_get_dedicated_host_group_value_error(self): "id": 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() - } + 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_dedicated_host_group(**req_copy) + _service.get_dedicated_host_group(**req_copy) + class TestUpdateDedicatedHostGroup(): @@ -9681,8 +10619,7 @@ def test_update_dedicated_host_group_all_params(self): update_dedicated_host_group() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -9699,8 +10636,11 @@ def test_update_dedicated_host_group_all_params(self): dedicated_host_group_patch = dedicated_host_group_patch_model # Invoke method - response = service.update_dedicated_host_group( - id, dedicated_host_group_patch, headers={}) + response = _service.update_dedicated_host_group( + id, + dedicated_host_group_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -9709,14 +10649,14 @@ def test_update_dedicated_host_group_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == dedicated_host_group_patch + @responses.activate def test_update_dedicated_host_group_value_error(self): """ test_update_dedicated_host_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/groups/testString') + url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString') mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -9738,12 +10678,10 @@ def test_update_dedicated_host_group_value_error(self): "dedicated_host_group_patch": dedicated_host_group_patch, } 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() - } + 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_dedicated_host_group(**req_copy) + _service.update_dedicated_host_group(**req_copy) + class TestListDedicatedHostProfiles(): @@ -9766,8 +10704,8 @@ def test_list_dedicated_host_profiles_all_params(self): list_dedicated_host_profiles() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_host/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9779,27 +10717,30 @@ def test_list_dedicated_host_profiles_all_params(self): limit = 1 # Invoke method - response = service.list_dedicated_host_profiles(start=start, - limit=limit, - headers={}) + response = _service.list_dedicated_host_profiles( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_dedicated_host_profiles_required_params(self): """ test_list_dedicated_host_profiles_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_host/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9807,20 +10748,22 @@ def test_list_dedicated_host_profiles_required_params(self): status=200) # Invoke method - response = service.list_dedicated_host_profiles() + response = _service.list_dedicated_host_profiles() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_dedicated_host_profiles_value_error(self): """ test_list_dedicated_host_profiles_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_host/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9828,14 +10771,13 @@ def test_list_dedicated_host_profiles_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_dedicated_host_profiles(**req_copy) + _service.list_dedicated_host_profiles(**req_copy) + class TestGetDedicatedHostProfile(): @@ -9858,9 +10800,8 @@ def test_get_dedicated_host_profile_all_params(self): get_dedicated_host_profile() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/profiles/testString') - mock_response = '{"class": "mx2", "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + url = self.preprocess_url(_base_url + '/dedicated_host/profiles/testString') + mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -9871,21 +10812,24 @@ def test_get_dedicated_host_profile_all_params(self): name = 'testString' # Invoke method - response = service.get_dedicated_host_profile(name, headers={}) + response = _service.get_dedicated_host_profile( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_dedicated_host_profile_value_error(self): """ test_get_dedicated_host_profile_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/dedicated_host/profiles/testString') - mock_response = '{"class": "mx2", "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + url = self.preprocess_url(_base_url + '/dedicated_host/profiles/testString') + mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["virtio_blk"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -9900,12 +10844,10 @@ def test_get_dedicated_host_profile_value_error(self): "name": name, } 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() - } + 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_dedicated_host_profile(**req_copy) + _service.get_dedicated_host_profile(**req_copy) + class TestListDedicatedHosts(): @@ -9928,8 +10870,8 @@ def test_list_dedicated_hosts_all_params(self): list_dedicated_hosts() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_hosts') + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9944,35 +10886,36 @@ def test_list_dedicated_hosts_all_params(self): zone_name = 'testString' # Invoke method - response = service.list_dedicated_hosts( + response = _service.list_dedicated_hosts( dedicated_host_group_id=dedicated_host_group_id, start=start, limit=limit, resource_group_id=resource_group_id, zone_name=zone_name, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) - assert 'dedicated_host_group.id={}'.format( - dedicated_host_group_id) in query_string + assert 'dedicated_host_group.id={}'.format(dedicated_host_group_id) in query_string assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'zone.name={}'.format(zone_name) in query_string + @responses.activate def test_list_dedicated_hosts_required_params(self): """ test_list_dedicated_hosts_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_hosts') + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -9980,20 +10923,22 @@ def test_list_dedicated_hosts_required_params(self): status=200) # Invoke method - response = service.list_dedicated_hosts() + response = _service.list_dedicated_hosts() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_dedicated_hosts_value_error(self): """ test_list_dedicated_hosts_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/dedicated_hosts') + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -10001,14 +10946,13 @@ def test_list_dedicated_hosts_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_dedicated_hosts(**req_copy) + _service.list_dedicated_hosts(**req_copy) + class TestCreateDedicatedHost(): @@ -10031,8 +10975,8 @@ def test_create_dedicated_host_all_params(self): create_dedicated_host() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -10049,26 +10993,24 @@ def test_create_dedicated_host_all_params(self): # Construct a dict representation of a DedicatedHostGroupIdentityById model dedicated_host_group_identity_model = {} - dedicated_host_group_identity_model[ - 'id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b' + dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b' # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model dedicated_host_prototype_model = {} dedicated_host_prototype_model['instance_placement_enabled'] = True dedicated_host_prototype_model['name'] = 'my-host' - dedicated_host_prototype_model[ - 'profile'] = dedicated_host_profile_identity_model - dedicated_host_prototype_model[ - 'resource_group'] = resource_group_identity_model - dedicated_host_prototype_model[ - 'group'] = dedicated_host_group_identity_model + dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model + dedicated_host_prototype_model['resource_group'] = resource_group_identity_model + dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model # Set up parameter values dedicated_host_prototype = dedicated_host_prototype_model # Invoke method - response = service.create_dedicated_host(dedicated_host_prototype, - headers={}) + response = _service.create_dedicated_host( + dedicated_host_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -10077,14 +11019,15 @@ def test_create_dedicated_host_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == dedicated_host_prototype + @responses.activate def test_create_dedicated_host_value_error(self): """ test_create_dedicated_host_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -10101,19 +11044,15 @@ def test_create_dedicated_host_value_error(self): # Construct a dict representation of a DedicatedHostGroupIdentityById model dedicated_host_group_identity_model = {} - dedicated_host_group_identity_model[ - 'id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b' + dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b' # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model dedicated_host_prototype_model = {} dedicated_host_prototype_model['instance_placement_enabled'] = True dedicated_host_prototype_model['name'] = 'my-host' - dedicated_host_prototype_model[ - 'profile'] = dedicated_host_profile_identity_model - dedicated_host_prototype_model[ - 'resource_group'] = resource_group_identity_model - dedicated_host_prototype_model[ - 'group'] = dedicated_host_group_identity_model + dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model + dedicated_host_prototype_model['resource_group'] = resource_group_identity_model + dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model # Set up parameter values dedicated_host_prototype = dedicated_host_prototype_model @@ -10123,12 +11062,243 @@ def test_create_dedicated_host_value_error(self): "dedicated_host_prototype": dedicated_host_prototype, } 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() - } + 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_dedicated_host(**req_copy) + _service.create_dedicated_host(**req_copy) + + + +class TestListDedicatedHostDisks(): + """ + Test Class for list_dedicated_host_disks + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_list_dedicated_host_disks_all_params(self): + """ + list_dedicated_host_disks() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks') + mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + dedicated_host_id = 'testString' + + # Invoke method + response = _service.list_dedicated_host_disks( + dedicated_host_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_list_dedicated_host_disks_value_error(self): + """ + test_list_dedicated_host_disks_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks') + mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + dedicated_host_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "dedicated_host_id": dedicated_host_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_dedicated_host_disks(**req_copy) + + + +class TestGetDedicatedHostDisk(): + """ + Test Class for get_dedicated_host_disk + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_get_dedicated_host_disk_all_params(self): + """ + get_dedicated_host_disk() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString') + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + dedicated_host_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_dedicated_host_disk( + dedicated_host_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + + @responses.activate + def test_get_dedicated_host_disk_value_error(self): + """ + test_get_dedicated_host_disk_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString') + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + dedicated_host_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "dedicated_host_id": dedicated_host_id, + "id": 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_dedicated_host_disk(**req_copy) + + + +class TestUpdateDedicatedHostDisk(): + """ + Test Class for update_dedicated_host_disk + """ + + def preprocess_url(self, request_url: str): + """ + Preprocess the request URL to ensure the mock response will be found. + """ + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + @responses.activate + def test_update_dedicated_host_disk_all_params(self): + """ + update_dedicated_host_disk() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString') + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a DedicatedHostDiskPatch model + dedicated_host_disk_patch_model = {} + dedicated_host_disk_patch_model['name'] = 'my-disk-updated' + + # Set up parameter values + dedicated_host_id = 'testString' + id = 'testString' + dedicated_host_disk_patch = dedicated_host_disk_patch_model + + # Invoke method + response = _service.update_dedicated_host_disk( + dedicated_host_id, + id, + dedicated_host_disk_patch, + 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 == dedicated_host_disk_patch + + + @responses.activate + def test_update_dedicated_host_disk_value_error(self): + """ + test_update_dedicated_host_disk_value_error() + """ + # Set up mock + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString') + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a DedicatedHostDiskPatch model + dedicated_host_disk_patch_model = {} + dedicated_host_disk_patch_model['name'] = 'my-disk-updated' + + # Set up parameter values + dedicated_host_id = 'testString' + id = 'testString' + dedicated_host_disk_patch = dedicated_host_disk_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "dedicated_host_id": dedicated_host_id, + "id": id, + "dedicated_host_disk_patch": dedicated_host_disk_patch, + } + 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_dedicated_host_disk(**req_copy) + class TestDeleteDedicatedHost(): @@ -10151,27 +11321,35 @@ def test_delete_dedicated_host_all_params(self): delete_dedicated_host() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_dedicated_host(id, headers={}) + response = _service.delete_dedicated_host( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_dedicated_host_value_error(self): """ test_delete_dedicated_host_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -10181,12 +11359,10 @@ def test_delete_dedicated_host_value_error(self): "id": 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() - } + 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_dedicated_host(**req_copy) + _service.delete_dedicated_host(**req_copy) + class TestGetDedicatedHost(): @@ -10209,8 +11385,8 @@ def test_get_dedicated_host_all_params(self): get_dedicated_host() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -10221,20 +11397,24 @@ def test_get_dedicated_host_all_params(self): id = 'testString' # Invoke method - response = service.get_dedicated_host(id, headers={}) + response = _service.get_dedicated_host( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_dedicated_host_value_error(self): """ test_get_dedicated_host_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -10249,12 +11429,10 @@ def test_get_dedicated_host_value_error(self): "id": 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() - } + 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_dedicated_host(**req_copy) + _service.get_dedicated_host(**req_copy) + class TestUpdateDedicatedHost(): @@ -10277,8 +11455,8 @@ def test_update_dedicated_host_all_params(self): update_dedicated_host() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -10295,9 +11473,11 @@ def test_update_dedicated_host_all_params(self): dedicated_host_patch = dedicated_host_patch_model # Invoke method - response = service.update_dedicated_host(id, - dedicated_host_patch, - headers={}) + response = _service.update_dedicated_host( + id, + dedicated_host_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -10306,14 +11486,15 @@ def test_update_dedicated_host_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == dedicated_host_patch + @responses.activate def test_update_dedicated_host_value_error(self): """ test_update_dedicated_host_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = self.preprocess_url(_base_url + '/dedicated_hosts/testString') + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["virtio_blk"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -10335,12 +11516,10 @@ def test_update_dedicated_host_value_error(self): "dedicated_host_patch": dedicated_host_patch, } 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() - } + 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_dedicated_host(**req_copy) + _service.update_dedicated_host(**req_copy) + # endregion @@ -10353,7 +11532,6 @@ def test_update_dedicated_host_value_error(self): ############################################################################## # region - class TestListVolumeProfiles(): """ Test Class for list_volume_profiles @@ -10374,7 +11552,7 @@ def test_list_volume_profiles_all_params(self): list_volume_profiles() """ # Set up mock - url = self.preprocess_url(base_url + '/volume/profiles') + url = self.preprocess_url(_base_url + '/volume/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}' responses.add(responses.GET, url, @@ -10387,26 +11565,29 @@ def test_list_volume_profiles_all_params(self): limit = 1 # Invoke method - response = service.list_volume_profiles(start=start, - limit=limit, - headers={}) + response = _service.list_volume_profiles( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_volume_profiles_required_params(self): """ test_list_volume_profiles_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/volume/profiles') + url = self.preprocess_url(_base_url + '/volume/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}' responses.add(responses.GET, url, @@ -10415,19 +11596,21 @@ def test_list_volume_profiles_required_params(self): status=200) # Invoke method - response = service.list_volume_profiles() + response = _service.list_volume_profiles() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_volume_profiles_value_error(self): """ test_list_volume_profiles_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volume/profiles') + url = self.preprocess_url(_base_url + '/volume/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}' responses.add(responses.GET, url, @@ -10436,14 +11619,13 @@ def test_list_volume_profiles_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_volume_profiles(**req_copy) + _service.list_volume_profiles(**req_copy) + class TestGetVolumeProfile(): @@ -10466,7 +11648,7 @@ def test_get_volume_profile_all_params(self): get_volume_profile() """ # Set up mock - url = self.preprocess_url(base_url + '/volume/profiles/testString') + url = self.preprocess_url(_base_url + '/volume/profiles/testString') mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}' responses.add(responses.GET, url, @@ -10478,19 +11660,23 @@ def test_get_volume_profile_all_params(self): name = 'testString' # Invoke method - response = service.get_volume_profile(name, headers={}) + response = _service.get_volume_profile( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_volume_profile_value_error(self): """ test_get_volume_profile_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volume/profiles/testString') + url = self.preprocess_url(_base_url + '/volume/profiles/testString') mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}' responses.add(responses.GET, url, @@ -10506,12 +11692,10 @@ def test_get_volume_profile_value_error(self): "name": name, } 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() - } + 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_volume_profile(**req_copy) + _service.get_volume_profile(**req_copy) + class TestListVolumes(): @@ -10534,7 +11718,7 @@ def test_list_volumes_all_params(self): list_volumes() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes') + url = self.preprocess_url(_base_url + '/volumes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, @@ -10549,30 +11733,33 @@ def test_list_volumes_all_params(self): zone_name = 'testString' # Invoke method - response = service.list_volumes(start=start, - limit=limit, - name=name, - zone_name=zone_name, - headers={}) + response = _service.list_volumes( + start=start, + limit=limit, + name=name, + zone_name=zone_name, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'name={}'.format(name) in query_string assert 'zone.name={}'.format(zone_name) in query_string + @responses.activate def test_list_volumes_required_params(self): """ test_list_volumes_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes') + url = self.preprocess_url(_base_url + '/volumes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, @@ -10581,19 +11768,21 @@ def test_list_volumes_required_params(self): status=200) # Invoke method - response = service.list_volumes() + response = _service.list_volumes() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_volumes_value_error(self): """ test_list_volumes_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes') + url = self.preprocess_url(_base_url + '/volumes') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, @@ -10602,14 +11791,13 @@ def test_list_volumes_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_volumes(**req_copy) + _service.list_volumes(**req_copy) + class TestCreateVolume(): @@ -10632,7 +11820,7 @@ def test_create_volume_all_params(self): create_volume() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes') + url = self.preprocess_url(_base_url + '/volumes') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -10640,11 +11828,6 @@ def test_create_volume_all_params(self): content_type='application/json', status=201) - # Construct a dict representation of a EncryptionKeyIdentityByCRN model - encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} volume_profile_identity_model['name'] = '5iops-tier' @@ -10657,21 +11840,28 @@ def test_create_volume_all_params(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + # Construct a dict representation of a VolumePrototypeVolumeByCapacity model volume_prototype_model = {} - volume_prototype_model['encryption_key'] = encryption_key_identity_model volume_prototype_model['iops'] = 10000 volume_prototype_model['name'] = 'my-volume' volume_prototype_model['profile'] = volume_profile_identity_model volume_prototype_model['resource_group'] = resource_group_identity_model volume_prototype_model['zone'] = zone_identity_model volume_prototype_model['capacity'] = 100 + volume_prototype_model['encryption_key'] = encryption_key_identity_model # Set up parameter values volume_prototype = volume_prototype_model # Invoke method - response = service.create_volume(volume_prototype, headers={}) + response = _service.create_volume( + volume_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -10680,13 +11870,14 @@ def test_create_volume_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == volume_prototype + @responses.activate def test_create_volume_value_error(self): """ test_create_volume_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes') + url = self.preprocess_url(_base_url + '/volumes') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -10694,11 +11885,6 @@ def test_create_volume_value_error(self): content_type='application/json', status=201) - # Construct a dict representation of a EncryptionKeyIdentityByCRN model - encryption_key_identity_model = {} - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - # Construct a dict representation of a VolumeProfileIdentityByName model volume_profile_identity_model = {} volume_profile_identity_model['name'] = '5iops-tier' @@ -10711,15 +11897,19 @@ def test_create_volume_value_error(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + # Construct a dict representation of a VolumePrototypeVolumeByCapacity model volume_prototype_model = {} - volume_prototype_model['encryption_key'] = encryption_key_identity_model volume_prototype_model['iops'] = 10000 volume_prototype_model['name'] = 'my-volume' volume_prototype_model['profile'] = volume_profile_identity_model volume_prototype_model['resource_group'] = resource_group_identity_model volume_prototype_model['zone'] = zone_identity_model volume_prototype_model['capacity'] = 100 + volume_prototype_model['encryption_key'] = encryption_key_identity_model # Set up parameter values volume_prototype = volume_prototype_model @@ -10729,12 +11919,10 @@ def test_create_volume_value_error(self): "volume_prototype": volume_prototype, } 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() - } + 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_volume(**req_copy) + _service.create_volume(**req_copy) + class TestDeleteVolume(): @@ -10757,27 +11945,35 @@ def test_delete_volume_all_params(self): delete_volume() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/volumes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_volume(id, headers={}) + response = _service.delete_volume( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_volume_value_error(self): """ test_delete_volume_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/volumes/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -10787,12 +11983,10 @@ def test_delete_volume_value_error(self): "id": 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() - } + 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_volume(**req_copy) + _service.delete_volume(**req_copy) + class TestGetVolume(): @@ -10815,7 +12009,7 @@ def test_get_volume_all_params(self): get_volume() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') + url = self.preprocess_url(_base_url + '/volumes/testString') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -10827,19 +12021,23 @@ def test_get_volume_all_params(self): id = 'testString' # Invoke method - response = service.get_volume(id, headers={}) + response = _service.get_volume( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_volume_value_error(self): """ test_get_volume_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') + url = self.preprocess_url(_base_url + '/volumes/testString') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -10855,12 +12053,10 @@ def test_get_volume_value_error(self): "id": 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() - } + 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_volume(**req_copy) + _service.get_volume(**req_copy) + class TestUpdateVolume(): @@ -10883,7 +12079,7 @@ def test_update_volume_all_params(self): update_volume() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') + url = self.preprocess_url(_base_url + '/volumes/testString') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -10900,7 +12096,11 @@ def test_update_volume_all_params(self): volume_patch = volume_patch_model # Invoke method - response = service.update_volume(id, volume_patch, headers={}) + response = _service.update_volume( + id, + volume_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -10909,13 +12109,14 @@ def test_update_volume_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == volume_patch + @responses.activate def test_update_volume_value_error(self): """ test_update_volume_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/volumes/testString') + url = self.preprocess_url(_base_url + '/volumes/testString') mock_response = '{"capacity": 100, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -10937,12 +12138,10 @@ def test_update_volume_value_error(self): "volume_patch": volume_patch, } 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() - } + 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_volume(**req_copy) + _service.update_volume(**req_copy) + # endregion @@ -10955,7 +12154,6 @@ def test_update_volume_value_error(self): ############################################################################## # region - class TestListRegions(): """ Test Class for list_regions @@ -10976,7 +12174,7 @@ def test_list_regions_all_params(self): list_regions() """ # Set up mock - url = self.preprocess_url(base_url + '/regions') + url = self.preprocess_url(_base_url + '/regions') mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' responses.add(responses.GET, url, @@ -10985,19 +12183,21 @@ def test_list_regions_all_params(self): status=200) # Invoke method - response = service.list_regions() + response = _service.list_regions() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_regions_value_error(self): """ test_list_regions_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/regions') + url = self.preprocess_url(_base_url + '/regions') mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' responses.add(responses.GET, url, @@ -11006,14 +12206,13 @@ def test_list_regions_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_regions(**req_copy) + _service.list_regions(**req_copy) + class TestGetRegion(): @@ -11036,7 +12235,7 @@ def test_get_region_all_params(self): get_region() """ # Set up mock - url = self.preprocess_url(base_url + '/regions/testString') + url = self.preprocess_url(_base_url + '/regions/testString') mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' responses.add(responses.GET, url, @@ -11048,19 +12247,23 @@ def test_get_region_all_params(self): name = 'testString' # Invoke method - response = service.get_region(name, headers={}) + response = _service.get_region( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_region_value_error(self): """ test_get_region_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/regions/testString') + url = self.preprocess_url(_base_url + '/regions/testString') mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' responses.add(responses.GET, url, @@ -11076,12 +12279,10 @@ def test_get_region_value_error(self): "name": name, } 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() - } + 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_region(**req_copy) + _service.get_region(**req_copy) + class TestListRegionZones(): @@ -11104,7 +12305,7 @@ def test_list_region_zones_all_params(self): list_region_zones() """ # Set up mock - url = self.preprocess_url(base_url + '/regions/testString/zones') + url = self.preprocess_url(_base_url + '/regions/testString/zones') mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' responses.add(responses.GET, url, @@ -11116,19 +12317,23 @@ def test_list_region_zones_all_params(self): region_name = 'testString' # Invoke method - response = service.list_region_zones(region_name, headers={}) + response = _service.list_region_zones( + region_name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_region_zones_value_error(self): """ test_list_region_zones_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/regions/testString/zones') + url = self.preprocess_url(_base_url + '/regions/testString/zones') mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' responses.add(responses.GET, url, @@ -11144,12 +12349,10 @@ def test_list_region_zones_value_error(self): "region_name": region_name, } 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() - } + 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_region_zones(**req_copy) + _service.list_region_zones(**req_copy) + class TestGetRegionZone(): @@ -11172,8 +12375,7 @@ def test_get_region_zone_all_params(self): get_region_zone() """ # Set up mock - url = self.preprocess_url(base_url + - '/regions/testString/zones/testString') + url = self.preprocess_url(_base_url + '/regions/testString/zones/testString') mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' responses.add(responses.GET, url, @@ -11186,20 +12388,24 @@ def test_get_region_zone_all_params(self): name = 'testString' # Invoke method - response = service.get_region_zone(region_name, name, headers={}) + response = _service.get_region_zone( + region_name, + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_region_zone_value_error(self): """ test_get_region_zone_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/regions/testString/zones/testString') + url = self.preprocess_url(_base_url + '/regions/testString/zones/testString') mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' responses.add(responses.GET, url, @@ -11217,12 +12423,10 @@ def test_get_region_zone_value_error(self): "name": name, } 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() - } + 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_region_zone(**req_copy) + _service.get_region_zone(**req_copy) + # endregion @@ -11235,7 +12439,6 @@ def test_get_region_zone_value_error(self): ############################################################################## # region - class TestListPublicGateways(): """ Test Class for list_public_gateways @@ -11256,7 +12459,7 @@ def test_list_public_gateways_all_params(self): list_public_gateways() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways') + url = self.preprocess_url(_base_url + '/public_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -11270,29 +12473,31 @@ def test_list_public_gateways_all_params(self): resource_group_id = 'testString' # Invoke method - response = service.list_public_gateways( + response = _service.list_public_gateways( start=start, limit=limit, resource_group_id=resource_group_id, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string + @responses.activate def test_list_public_gateways_required_params(self): """ test_list_public_gateways_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways') + url = self.preprocess_url(_base_url + '/public_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -11301,19 +12506,21 @@ def test_list_public_gateways_required_params(self): status=200) # Invoke method - response = service.list_public_gateways() + response = _service.list_public_gateways() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_public_gateways_value_error(self): """ test_list_public_gateways_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways') + url = self.preprocess_url(_base_url + '/public_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -11322,14 +12529,13 @@ def test_list_public_gateways_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_public_gateways(**req_copy) + _service.list_public_gateways(**req_copy) + class TestCreatePublicGateway(): @@ -11352,7 +12558,7 @@ def test_create_public_gateway_all_params(self): create_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways') + url = self.preprocess_url(_base_url + '/public_gateways') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -11370,8 +12576,7 @@ def test_create_public_gateway_all_params(self): # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model public_gateway_floating_ip_prototype_model = {} - public_gateway_floating_ip_prototype_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -11385,12 +12590,14 @@ def test_create_public_gateway_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_public_gateway(vpc, - zone, - floating_ip=floating_ip, - name=name, - resource_group=resource_group, - headers={}) + response = _service.create_public_gateway( + vpc, + zone, + floating_ip=floating_ip, + name=name, + resource_group=resource_group, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -11399,18 +12606,18 @@ def test_create_public_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['vpc'] == vpc_identity_model assert req_body['zone'] == zone_identity_model - assert req_body[ - 'floating_ip'] == public_gateway_floating_ip_prototype_model + assert req_body['floating_ip'] == public_gateway_floating_ip_prototype_model assert req_body['name'] == 'my-public-gateway' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_public_gateway_value_error(self): """ test_create_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways') + url = self.preprocess_url(_base_url + '/public_gateways') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -11428,8 +12635,7 @@ def test_create_public_gateway_value_error(self): # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model public_gateway_floating_ip_prototype_model = {} - public_gateway_floating_ip_prototype_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -11448,12 +12654,10 @@ def test_create_public_gateway_value_error(self): "zone": zone, } 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() - } + 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_public_gateway(**req_copy) + _service.create_public_gateway(**req_copy) + class TestDeletePublicGateway(): @@ -11476,27 +12680,35 @@ def test_delete_public_gateway_all_params(self): delete_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/public_gateways/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_public_gateway(id, headers={}) + response = _service.delete_public_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_public_gateway_value_error(self): """ test_delete_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/public_gateways/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -11506,12 +12718,10 @@ def test_delete_public_gateway_value_error(self): "id": 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() - } + 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_public_gateway(**req_copy) + _service.delete_public_gateway(**req_copy) + class TestGetPublicGateway(): @@ -11534,7 +12744,7 @@ def test_get_public_gateway_all_params(self): get_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') + url = self.preprocess_url(_base_url + '/public_gateways/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -11546,19 +12756,23 @@ def test_get_public_gateway_all_params(self): id = 'testString' # Invoke method - response = service.get_public_gateway(id, headers={}) + response = _service.get_public_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_public_gateway_value_error(self): """ test_get_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') + url = self.preprocess_url(_base_url + '/public_gateways/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -11574,12 +12788,10 @@ def test_get_public_gateway_value_error(self): "id": 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() - } + 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_public_gateway(**req_copy) + _service.get_public_gateway(**req_copy) + class TestUpdatePublicGateway(): @@ -11602,7 +12814,7 @@ def test_update_public_gateway_all_params(self): update_public_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') + url = self.preprocess_url(_base_url + '/public_gateways/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -11619,9 +12831,11 @@ def test_update_public_gateway_all_params(self): public_gateway_patch = public_gateway_patch_model # Invoke method - response = service.update_public_gateway(id, - public_gateway_patch, - headers={}) + response = _service.update_public_gateway( + id, + public_gateway_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -11630,13 +12844,14 @@ def test_update_public_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == public_gateway_patch + @responses.activate def test_update_public_gateway_value_error(self): """ test_update_public_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/public_gateways/testString') + url = self.preprocess_url(_base_url + '/public_gateways/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -11658,12 +12873,10 @@ def test_update_public_gateway_value_error(self): "public_gateway_patch": public_gateway_patch, } 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() - } + 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_public_gateway(**req_copy) + _service.update_public_gateway(**req_copy) + # endregion @@ -11676,7 +12889,6 @@ def test_update_public_gateway_value_error(self): ############################################################################## # region - class TestListFloatingIps(): """ Test Class for list_floating_ips @@ -11697,7 +12909,7 @@ def test_list_floating_ips_all_params(self): list_floating_ips() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips') + url = self.preprocess_url(_base_url + '/floating_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -11711,29 +12923,31 @@ def test_list_floating_ips_all_params(self): resource_group_id = 'testString' # Invoke method - response = service.list_floating_ips( + response = _service.list_floating_ips( start=start, limit=limit, resource_group_id=resource_group_id, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string + @responses.activate def test_list_floating_ips_required_params(self): """ test_list_floating_ips_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips') + url = self.preprocess_url(_base_url + '/floating_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -11742,19 +12956,21 @@ def test_list_floating_ips_required_params(self): status=200) # Invoke method - response = service.list_floating_ips() + response = _service.list_floating_ips() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_floating_ips_value_error(self): """ test_list_floating_ips_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips') + url = self.preprocess_url(_base_url + '/floating_ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -11763,14 +12979,13 @@ def test_list_floating_ips_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_floating_ips(**req_copy) + _service.list_floating_ips(**req_copy) + class TestCreateFloatingIp(): @@ -11793,7 +13008,7 @@ def test_create_floating_ip_all_params(self): create_floating_ip() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips') + url = self.preprocess_url(_base_url + '/floating_ips') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -11812,15 +13027,17 @@ def test_create_floating_ip_all_params(self): # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model floating_ip_prototype_model = {} floating_ip_prototype_model['name'] = 'my-floating-ip' - floating_ip_prototype_model[ - 'resource_group'] = resource_group_identity_model + floating_ip_prototype_model['resource_group'] = resource_group_identity_model floating_ip_prototype_model['zone'] = zone_identity_model # Set up parameter values floating_ip_prototype = floating_ip_prototype_model # Invoke method - response = service.create_floating_ip(floating_ip_prototype, headers={}) + response = _service.create_floating_ip( + floating_ip_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -11829,13 +13046,14 @@ def test_create_floating_ip_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == floating_ip_prototype + @responses.activate def test_create_floating_ip_value_error(self): """ test_create_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips') + url = self.preprocess_url(_base_url + '/floating_ips') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, @@ -11854,8 +13072,7 @@ def test_create_floating_ip_value_error(self): # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model floating_ip_prototype_model = {} floating_ip_prototype_model['name'] = 'my-floating-ip' - floating_ip_prototype_model[ - 'resource_group'] = resource_group_identity_model + floating_ip_prototype_model['resource_group'] = resource_group_identity_model floating_ip_prototype_model['zone'] = zone_identity_model # Set up parameter values @@ -11866,12 +13083,10 @@ def test_create_floating_ip_value_error(self): "floating_ip_prototype": floating_ip_prototype, } 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() - } + 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_floating_ip(**req_copy) + _service.create_floating_ip(**req_copy) + class TestDeleteFloatingIp(): @@ -11894,27 +13109,35 @@ def test_delete_floating_ip_all_params(self): delete_floating_ip() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/floating_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_floating_ip(id, headers={}) + response = _service.delete_floating_ip( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_floating_ip_value_error(self): """ test_delete_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/floating_ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -11924,12 +13147,10 @@ def test_delete_floating_ip_value_error(self): "id": 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() - } + 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_floating_ip(**req_copy) + _service.delete_floating_ip(**req_copy) + class TestGetFloatingIp(): @@ -11952,7 +13173,7 @@ def test_get_floating_ip_all_params(self): get_floating_ip() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') + url = self.preprocess_url(_base_url + '/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -11964,19 +13185,23 @@ def test_get_floating_ip_all_params(self): id = 'testString' # Invoke method - response = service.get_floating_ip(id, headers={}) + response = _service.get_floating_ip( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_floating_ip_value_error(self): """ test_get_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') + url = self.preprocess_url(_base_url + '/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, @@ -11992,12 +13217,10 @@ def test_get_floating_ip_value_error(self): "id": 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() - } + 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_floating_ip(**req_copy) + _service.get_floating_ip(**req_copy) + class TestUpdateFloatingIp(): @@ -12020,7 +13243,7 @@ def test_update_floating_ip_all_params(self): update_floating_ip() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') + url = self.preprocess_url(_base_url + '/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -12030,21 +13253,23 @@ def test_update_floating_ip_all_params(self): # Construct a dict representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_patch_target_network_interface_identity_model = {} - floating_ip_patch_target_network_interface_identity_model[ - 'id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' + floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' # Construct a dict representation of a FloatingIPPatch model floating_ip_patch_model = {} floating_ip_patch_model['name'] = 'my-floating-ip' - floating_ip_patch_model[ - 'target'] = floating_ip_patch_target_network_interface_identity_model + floating_ip_patch_model['target'] = floating_ip_patch_target_network_interface_identity_model # Set up parameter values id = 'testString' floating_ip_patch = floating_ip_patch_model # Invoke method - response = service.update_floating_ip(id, floating_ip_patch, headers={}) + response = _service.update_floating_ip( + id, + floating_ip_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -12053,13 +13278,14 @@ def test_update_floating_ip_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == floating_ip_patch + @responses.activate def test_update_floating_ip_value_error(self): """ test_update_floating_ip_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/floating_ips/testString') + url = self.preprocess_url(_base_url + '/floating_ips/testString') mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, @@ -12069,14 +13295,12 @@ def test_update_floating_ip_value_error(self): # Construct a dict representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_patch_target_network_interface_identity_model = {} - floating_ip_patch_target_network_interface_identity_model[ - 'id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' + floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' # Construct a dict representation of a FloatingIPPatch model floating_ip_patch_model = {} floating_ip_patch_model['name'] = 'my-floating-ip' - floating_ip_patch_model[ - 'target'] = floating_ip_patch_target_network_interface_identity_model + floating_ip_patch_model['target'] = floating_ip_patch_target_network_interface_identity_model # Set up parameter values id = 'testString' @@ -12088,12 +13312,10 @@ def test_update_floating_ip_value_error(self): "floating_ip_patch": floating_ip_patch, } 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() - } + 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_floating_ip(**req_copy) + _service.update_floating_ip(**req_copy) + # endregion @@ -12106,7 +13328,6 @@ def test_update_floating_ip_value_error(self): ############################################################################## # region - class TestListNetworkAcls(): """ Test Class for list_network_acls @@ -12127,7 +13348,7 @@ def test_list_network_acls_all_params(self): list_network_acls() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -12141,29 +13362,31 @@ def test_list_network_acls_all_params(self): resource_group_id = 'testString' # Invoke method - response = service.list_network_acls( + response = _service.list_network_acls( start=start, limit=limit, resource_group_id=resource_group_id, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string + @responses.activate def test_list_network_acls_required_params(self): """ test_list_network_acls_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -12172,19 +13395,21 @@ def test_list_network_acls_required_params(self): status=200) # Invoke method - response = service.list_network_acls() + response = _service.list_network_acls() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_network_acls_value_error(self): """ test_list_network_acls_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -12193,14 +13418,13 @@ def test_list_network_acls_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_network_acls(**req_copy) + _service.list_network_acls(**req_copy) + class TestCreateNetworkAcl(): @@ -12223,7 +13447,7 @@ def test_create_network_acl_all_params(self): create_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -12242,32 +13466,27 @@ def test_create_network_acl_all_params(self): # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll model network_acl_rule_prototype_network_acl_context_model = {} network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_model[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_model[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_model[ - 'source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' network_acl_rule_prototype_network_acl_context_model['protocol'] = 'all' # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model network_acl_prototype_model = {} network_acl_prototype_model['name'] = 'my-network-acl' - network_acl_prototype_model[ - 'resource_group'] = resource_group_identity_model + network_acl_prototype_model['resource_group'] = resource_group_identity_model network_acl_prototype_model['vpc'] = vpc_identity_model - network_acl_prototype_model['rules'] = [ - network_acl_rule_prototype_network_acl_context_model - ] + network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model] # Set up parameter values network_acl_prototype = network_acl_prototype_model # Invoke method - response = service.create_network_acl( - network_acl_prototype=network_acl_prototype, headers={}) + response = _service.create_network_acl( + network_acl_prototype=network_acl_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -12276,13 +13495,14 @@ def test_create_network_acl_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_acl_prototype + @responses.activate def test_create_network_acl_required_params(self): """ test_create_network_acl_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -12291,19 +13511,21 @@ def test_create_network_acl_required_params(self): status=201) # Invoke method - response = service.create_network_acl() + response = _service.create_network_acl() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_create_network_acl_value_error(self): """ test_create_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls') + url = self.preprocess_url(_base_url + '/network_acls') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -12312,14 +13534,13 @@ def test_create_network_acl_value_error(self): status=201) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_network_acl(**req_copy) + _service.create_network_acl(**req_copy) + class TestDeleteNetworkAcl(): @@ -12342,27 +13563,35 @@ def test_delete_network_acl_all_params(self): delete_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/network_acls/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_network_acl(id, headers={}) + response = _service.delete_network_acl( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_network_acl_value_error(self): """ test_delete_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/network_acls/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -12372,12 +13601,10 @@ def test_delete_network_acl_value_error(self): "id": 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() - } + 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_network_acl(**req_copy) + _service.delete_network_acl(**req_copy) + class TestGetNetworkAcl(): @@ -12400,7 +13627,7 @@ def test_get_network_acl_all_params(self): get_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -12412,19 +13639,23 @@ def test_get_network_acl_all_params(self): id = 'testString' # Invoke method - response = service.get_network_acl(id, headers={}) + response = _service.get_network_acl( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_network_acl_value_error(self): """ test_get_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -12440,12 +13671,10 @@ def test_get_network_acl_value_error(self): "id": 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() - } + 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_network_acl(**req_copy) + _service.get_network_acl(**req_copy) + class TestUpdateNetworkAcl(): @@ -12468,7 +13697,7 @@ def test_update_network_acl_all_params(self): update_network_acl() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -12485,7 +13714,11 @@ def test_update_network_acl_all_params(self): network_acl_patch = network_acl_patch_model # Invoke method - response = service.update_network_acl(id, network_acl_patch, headers={}) + response = _service.update_network_acl( + id, + network_acl_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -12494,13 +13727,14 @@ def test_update_network_acl_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_acl_patch + @responses.activate def test_update_network_acl_value_error(self): """ test_update_network_acl_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -12522,12 +13756,10 @@ def test_update_network_acl_value_error(self): "network_acl_patch": network_acl_patch, } 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() - } + 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_network_acl(**req_copy) + _service.update_network_acl(**req_copy) + class TestListNetworkAclRules(): @@ -12550,7 +13782,7 @@ def test_list_network_acl_rules_all_params(self): list_network_acl_rules() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString/rules') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, @@ -12565,29 +13797,32 @@ def test_list_network_acl_rules_all_params(self): direction = 'inbound' # Invoke method - response = service.list_network_acl_rules(network_acl_id, - start=start, - limit=limit, - direction=direction, - headers={}) + response = _service.list_network_acl_rules( + network_acl_id, + start=start, + limit=limit, + direction=direction, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'direction={}'.format(direction) in query_string + @responses.activate def test_list_network_acl_rules_required_params(self): """ test_list_network_acl_rules_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString/rules') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, @@ -12599,19 +13834,23 @@ def test_list_network_acl_rules_required_params(self): network_acl_id = 'testString' # Invoke method - response = service.list_network_acl_rules(network_acl_id, headers={}) + response = _service.list_network_acl_rules( + network_acl_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_network_acl_rules_value_error(self): """ test_list_network_acl_rules_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString/rules') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, @@ -12627,12 +13866,10 @@ def test_list_network_acl_rules_value_error(self): "network_acl_id": network_acl_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() - } + 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_network_acl_rules(**req_copy) + _service.list_network_acl_rules(**req_copy) + class TestCreateNetworkAclRule(): @@ -12655,7 +13892,7 @@ def test_create_network_acl_rule_all_params(self): create_network_acl_rule() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString/rules') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.POST, url, @@ -12665,14 +13902,12 @@ def test_create_network_acl_rule_all_params(self): # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model network_acl_rule_before_prototype_model = {} - network_acl_rule_before_prototype_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model network_acl_rule_prototype_model = {} network_acl_rule_prototype_model['action'] = 'allow' - network_acl_rule_prototype_model[ - 'before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' network_acl_rule_prototype_model['direction'] = 'inbound' network_acl_rule_prototype_model['name'] = 'my-rule-2' @@ -12686,9 +13921,11 @@ def test_create_network_acl_rule_all_params(self): network_acl_rule_prototype = network_acl_rule_prototype_model # Invoke method - response = service.create_network_acl_rule(network_acl_id, - network_acl_rule_prototype, - headers={}) + response = _service.create_network_acl_rule( + network_acl_id, + network_acl_rule_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -12697,13 +13934,14 @@ def test_create_network_acl_rule_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_acl_rule_prototype + @responses.activate def test_create_network_acl_rule_value_error(self): """ test_create_network_acl_rule_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/network_acls/testString/rules') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.POST, url, @@ -12713,14 +13951,12 @@ def test_create_network_acl_rule_value_error(self): # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model network_acl_rule_before_prototype_model = {} - network_acl_rule_before_prototype_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model network_acl_rule_prototype_model = {} network_acl_rule_prototype_model['action'] = 'allow' - network_acl_rule_prototype_model[ - 'before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' network_acl_rule_prototype_model['direction'] = 'inbound' network_acl_rule_prototype_model['name'] = 'my-rule-2' @@ -12739,12 +13975,10 @@ def test_create_network_acl_rule_value_error(self): "network_acl_rule_prototype": network_acl_rule_prototype, } 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() - } + 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_network_acl_rule(**req_copy) + _service.create_network_acl_rule(**req_copy) + class TestDeleteNetworkAclRule(): @@ -12767,32 +14001,37 @@ def test_delete_network_acl_rule_all_params(self): delete_network_acl_rule() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values network_acl_id = 'testString' id = 'testString' # Invoke method - response = service.delete_network_acl_rule(network_acl_id, - id, - headers={}) + response = _service.delete_network_acl_rule( + network_acl_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_network_acl_rule_value_error(self): """ test_delete_network_acl_rule_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values network_acl_id = 'testString' @@ -12804,12 +14043,10 @@ def test_delete_network_acl_rule_value_error(self): "id": 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() - } + 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_network_acl_rule(**req_copy) + _service.delete_network_acl_rule(**req_copy) + class TestGetNetworkAclRule(): @@ -12832,8 +14069,7 @@ def test_get_network_acl_rule_all_params(self): get_network_acl_rule() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.GET, url, @@ -12846,20 +14082,24 @@ def test_get_network_acl_rule_all_params(self): id = 'testString' # Invoke method - response = service.get_network_acl_rule(network_acl_id, id, headers={}) + response = _service.get_network_acl_rule( + network_acl_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_network_acl_rule_value_error(self): """ test_get_network_acl_rule_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.GET, url, @@ -12877,12 +14117,10 @@ def test_get_network_acl_rule_value_error(self): "id": 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() - } + 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_network_acl_rule(**req_copy) + _service.get_network_acl_rule(**req_copy) + class TestUpdateNetworkAclRule(): @@ -12905,8 +14143,7 @@ def test_update_network_acl_rule_all_params(self): update_network_acl_rule() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.PATCH, url, @@ -12916,14 +14153,12 @@ def test_update_network_acl_rule_all_params(self): # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model network_acl_rule_before_patch_model = {} - network_acl_rule_before_patch_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a dict representation of a NetworkACLRulePatch model network_acl_rule_patch_model = {} network_acl_rule_patch_model['action'] = 'allow' - network_acl_rule_patch_model[ - 'before'] = network_acl_rule_before_patch_model + network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model network_acl_rule_patch_model['code'] = 0 network_acl_rule_patch_model['destination'] = '192.168.3.2/32' network_acl_rule_patch_model['destination_port_max'] = 22 @@ -12941,10 +14176,12 @@ def test_update_network_acl_rule_all_params(self): network_acl_rule_patch = network_acl_rule_patch_model # Invoke method - response = service.update_network_acl_rule(network_acl_id, - id, - network_acl_rule_patch, - headers={}) + response = _service.update_network_acl_rule( + network_acl_id, + id, + network_acl_rule_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -12953,14 +14190,14 @@ def test_update_network_acl_rule_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == network_acl_rule_patch + @responses.activate def test_update_network_acl_rule_value_error(self): """ test_update_network_acl_rule_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/network_acls/testString/rules/testString') + url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString') mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "protocol": "all"}' responses.add(responses.PATCH, url, @@ -12970,14 +14207,12 @@ def test_update_network_acl_rule_value_error(self): # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model network_acl_rule_before_patch_model = {} - network_acl_rule_before_patch_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a dict representation of a NetworkACLRulePatch model network_acl_rule_patch_model = {} network_acl_rule_patch_model['action'] = 'allow' - network_acl_rule_patch_model[ - 'before'] = network_acl_rule_before_patch_model + network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model network_acl_rule_patch_model['code'] = 0 network_acl_rule_patch_model['destination'] = '192.168.3.2/32' network_acl_rule_patch_model['destination_port_max'] = 22 @@ -13001,12 +14236,10 @@ def test_update_network_acl_rule_value_error(self): "network_acl_rule_patch": network_acl_rule_patch, } 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() - } + 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_network_acl_rule(**req_copy) + _service.update_network_acl_rule(**req_copy) + # endregion @@ -13019,7 +14252,6 @@ def test_update_network_acl_rule_value_error(self): ############################################################################## # region - class TestListSecurityGroups(): """ Test Class for list_security_groups @@ -13040,7 +14272,7 @@ def test_list_security_groups_all_params(self): list_security_groups() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups') + url = self.preprocess_url(_base_url + '/security_groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -13057,20 +14289,21 @@ def test_list_security_groups_all_params(self): vpc_name = 'testString' # Invoke method - response = service.list_security_groups( + response = _service.list_security_groups( start=start, limit=limit, resource_group_id=resource_group_id, vpc_id=vpc_id, vpc_crn=vpc_crn, vpc_name=vpc_name, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string @@ -13079,13 +14312,14 @@ def test_list_security_groups_all_params(self): assert 'vpc.crn={}'.format(vpc_crn) in query_string assert 'vpc.name={}'.format(vpc_name) in query_string + @responses.activate def test_list_security_groups_required_params(self): """ test_list_security_groups_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups') + url = self.preprocess_url(_base_url + '/security_groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -13094,19 +14328,21 @@ def test_list_security_groups_required_params(self): status=200) # Invoke method - response = service.list_security_groups() + response = _service.list_security_groups() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_security_groups_value_error(self): """ test_list_security_groups_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups') + url = self.preprocess_url(_base_url + '/security_groups') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, @@ -13115,14 +14351,13 @@ def test_list_security_groups_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_security_groups(**req_copy) + _service.list_security_groups(**req_copy) + class TestCreateSecurityGroup(): @@ -13145,7 +14380,7 @@ def test_create_security_group_all_params(self): create_security_group() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups') + url = self.preprocess_url(_base_url + '/security_groups') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -13169,8 +14404,7 @@ def test_create_security_group_all_params(self): security_group_rule_prototype_model = {} security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model[ - 'remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' security_group_rule_prototype_model['type'] = 8 @@ -13182,11 +14416,13 @@ def test_create_security_group_all_params(self): rules = [security_group_rule_prototype_model] # Invoke method - response = service.create_security_group(vpc, - name=name, - resource_group=resource_group, - rules=rules, - headers={}) + response = _service.create_security_group( + vpc, + name=name, + resource_group=resource_group, + rules=rules, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -13198,13 +14434,14 @@ def test_create_security_group_all_params(self): assert req_body['resource_group'] == resource_group_identity_model assert req_body['rules'] == [security_group_rule_prototype_model] + @responses.activate def test_create_security_group_value_error(self): """ test_create_security_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups') + url = self.preprocess_url(_base_url + '/security_groups') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -13228,8 +14465,7 @@ def test_create_security_group_value_error(self): security_group_rule_prototype_model = {} security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model[ - 'remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' security_group_rule_prototype_model['type'] = 8 @@ -13245,12 +14481,10 @@ def test_create_security_group_value_error(self): "vpc": vpc, } 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() - } + 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_security_group(**req_copy) + _service.create_security_group(**req_copy) + class TestDeleteSecurityGroup(): @@ -13273,27 +14507,35 @@ def test_delete_security_group_all_params(self): delete_security_group() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_security_group(id, headers={}) + response = _service.delete_security_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_security_group_value_error(self): """ test_delete_security_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -13303,12 +14545,10 @@ def test_delete_security_group_value_error(self): "id": 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() - } + 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_security_group(**req_copy) + _service.delete_security_group(**req_copy) + class TestGetSecurityGroup(): @@ -13331,7 +14571,7 @@ def test_get_security_group_all_params(self): get_security_group() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -13343,19 +14583,23 @@ def test_get_security_group_all_params(self): id = 'testString' # Invoke method - response = service.get_security_group(id, headers={}) + response = _service.get_security_group( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_security_group_value_error(self): """ test_get_security_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -13371,12 +14615,10 @@ def test_get_security_group_value_error(self): "id": 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() - } + 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_security_group(**req_copy) + _service.get_security_group(**req_copy) + class TestUpdateSecurityGroup(): @@ -13399,7 +14641,7 @@ def test_update_security_group_all_params(self): update_security_group() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -13416,9 +14658,11 @@ def test_update_security_group_all_params(self): security_group_patch = security_group_patch_model # Invoke method - response = service.update_security_group(id, - security_group_patch, - headers={}) + response = _service.update_security_group( + id, + security_group_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -13427,13 +14671,14 @@ def test_update_security_group_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == security_group_patch + @responses.activate def test_update_security_group_value_error(self): """ test_update_security_group_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/security_groups/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -13455,12 +14700,10 @@ def test_update_security_group_value_error(self): "security_group_patch": security_group_patch, } 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() - } + 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_security_group(**req_copy) + _service.update_security_group(**req_copy) + class TestListSecurityGroupNetworkInterfaces(): @@ -13483,8 +14726,7 @@ def test_list_security_group_network_interfaces_all_params(self): list_security_group_network_interfaces() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -13498,26 +14740,30 @@ def test_list_security_group_network_interfaces_all_params(self): limit = 1 # Invoke method - response = service.list_security_group_network_interfaces( - security_group_id, start=start, limit=limit, headers={}) + response = _service.list_security_group_network_interfaces( + security_group_id, + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_security_group_network_interfaces_required_params(self): """ test_list_security_group_network_interfaces_required_params() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -13529,21 +14775,23 @@ def test_list_security_group_network_interfaces_required_params(self): security_group_id = 'testString' # Invoke method - response = service.list_security_group_network_interfaces( - security_group_id, headers={}) + response = _service.list_security_group_network_interfaces( + security_group_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_security_group_network_interfaces_value_error(self): """ test_list_security_group_network_interfaces_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/network_interfaces') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -13559,12 +14807,10 @@ def test_list_security_group_network_interfaces_value_error(self): "security_group_id": security_group_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() - } + 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_security_group_network_interfaces(**req_copy) + _service.list_security_group_network_interfaces(**req_copy) + class TestRemoveSecurityGroupNetworkInterface(): @@ -13587,33 +14833,37 @@ def test_remove_security_group_network_interface_all_params(self): remove_security_group_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' id = 'testString' # Invoke method - response = service.remove_security_group_network_interface( - security_group_id, id, headers={}) + response = _service.remove_security_group_network_interface( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_remove_security_group_network_interface_value_error(self): """ test_remove_security_group_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' @@ -13625,12 +14875,10 @@ def test_remove_security_group_network_interface_value_error(self): "id": 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() - } + 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_security_group_network_interface(**req_copy) + _service.remove_security_group_network_interface(**req_copy) + class TestGetSecurityGroupNetworkInterface(): @@ -13653,9 +14901,7 @@ def test_get_security_group_network_interface_all_params(self): get_security_group_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, @@ -13668,22 +14914,24 @@ def test_get_security_group_network_interface_all_params(self): id = 'testString' # Invoke method - response = service.get_security_group_network_interface( - security_group_id, id, headers={}) + response = _service.get_security_group_network_interface( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_security_group_network_interface_value_error(self): """ test_get_security_group_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, @@ -13701,12 +14949,10 @@ def test_get_security_group_network_interface_value_error(self): "id": 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() - } + 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_security_group_network_interface(**req_copy) + _service.get_security_group_network_interface(**req_copy) + class TestAddSecurityGroupNetworkInterface(): @@ -13729,9 +14975,7 @@ def test_add_security_group_network_interface_all_params(self): add_security_group_network_interface() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PUT, url, @@ -13744,22 +14988,24 @@ def test_add_security_group_network_interface_all_params(self): id = 'testString' # Invoke method - response = service.add_security_group_network_interface( - security_group_id, id, headers={}) + response = _service.add_security_group_network_interface( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_add_security_group_network_interface_value_error(self): """ test_add_security_group_network_interface_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/security_groups/testString/network_interfaces/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString') mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PUT, url, @@ -13777,12 +15023,10 @@ def test_add_security_group_network_interface_value_error(self): "id": 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() - } + 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_security_group_network_interface(**req_copy) + _service.add_security_group_network_interface(**req_copy) + class TestListSecurityGroupRules(): @@ -13805,8 +15049,7 @@ def test_list_security_group_rules_all_params(self): list_security_group_rules() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/rules') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules') mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}]}' responses.add(responses.GET, url, @@ -13818,21 +15061,23 @@ def test_list_security_group_rules_all_params(self): security_group_id = 'testString' # Invoke method - response = service.list_security_group_rules(security_group_id, - headers={}) + response = _service.list_security_group_rules( + security_group_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_security_group_rules_value_error(self): """ test_list_security_group_rules_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/rules') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules') mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}]}' responses.add(responses.GET, url, @@ -13848,12 +15093,10 @@ def test_list_security_group_rules_value_error(self): "security_group_id": security_group_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() - } + 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_security_group_rules(**req_copy) + _service.list_security_group_rules(**req_copy) + class TestCreateSecurityGroupRule(): @@ -13876,8 +15119,7 @@ def test_create_security_group_rule_all_params(self): create_security_group_rule() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/rules') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.POST, url, @@ -13893,8 +15135,7 @@ def test_create_security_group_rule_all_params(self): security_group_rule_prototype_model = {} security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model[ - 'remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' security_group_rule_prototype_model['type'] = 8 @@ -13904,8 +15145,11 @@ def test_create_security_group_rule_all_params(self): security_group_rule_prototype = security_group_rule_prototype_model # Invoke method - response = service.create_security_group_rule( - security_group_id, security_group_rule_prototype, headers={}) + response = _service.create_security_group_rule( + security_group_id, + security_group_rule_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -13914,14 +15158,14 @@ def test_create_security_group_rule_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == security_group_rule_prototype + @responses.activate def test_create_security_group_rule_value_error(self): """ test_create_security_group_rule_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/rules') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.POST, url, @@ -13937,8 +15181,7 @@ def test_create_security_group_rule_value_error(self): security_group_rule_prototype_model = {} security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model[ - 'remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['protocol'] = 'icmp' security_group_rule_prototype_model['type'] = 8 @@ -13953,12 +15196,10 @@ def test_create_security_group_rule_value_error(self): "security_group_rule_prototype": security_group_rule_prototype, } 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() - } + 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_security_group_rule(**req_copy) + _service.create_security_group_rule(**req_copy) + class TestDeleteSecurityGroupRule(): @@ -13981,32 +15222,37 @@ def test_delete_security_group_rule_all_params(self): delete_security_group_rule() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' id = 'testString' # Invoke method - response = service.delete_security_group_rule(security_group_id, - id, - headers={}) + response = _service.delete_security_group_rule( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_security_group_rule_value_error(self): """ test_delete_security_group_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' @@ -14018,12 +15264,10 @@ def test_delete_security_group_rule_value_error(self): "id": 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() - } + 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_security_group_rule(**req_copy) + _service.delete_security_group_rule(**req_copy) + class TestGetSecurityGroupRule(): @@ -14046,8 +15290,7 @@ def test_get_security_group_rule_all_params(self): get_security_group_rule() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.GET, url, @@ -14060,22 +15303,24 @@ def test_get_security_group_rule_all_params(self): id = 'testString' # Invoke method - response = service.get_security_group_rule(security_group_id, - id, - headers={}) + response = _service.get_security_group_rule( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_security_group_rule_value_error(self): """ test_get_security_group_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.GET, url, @@ -14093,12 +15338,10 @@ def test_get_security_group_rule_value_error(self): "id": 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() - } + 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_security_group_rule(**req_copy) + _service.get_security_group_rule(**req_copy) + class TestUpdateSecurityGroupRule(): @@ -14121,8 +15364,7 @@ def test_update_security_group_rule_all_params(self): update_security_group_rule() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.PATCH, url, @@ -14141,8 +15383,7 @@ def test_update_security_group_rule_all_params(self): security_group_rule_patch_model['ip_version'] = 'ipv4' security_group_rule_patch_model['port_max'] = 22 security_group_rule_patch_model['port_min'] = 22 - security_group_rule_patch_model[ - 'remote'] = security_group_rule_remote_patch_model + security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model security_group_rule_patch_model['type'] = 8 # Set up parameter values @@ -14151,10 +15392,12 @@ def test_update_security_group_rule_all_params(self): security_group_rule_patch = security_group_rule_patch_model # Invoke method - response = service.update_security_group_rule(security_group_id, - id, - security_group_rule_patch, - headers={}) + response = _service.update_security_group_rule( + security_group_id, + id, + security_group_rule_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -14163,14 +15406,14 @@ def test_update_security_group_rule_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == security_group_rule_patch + @responses.activate def test_update_security_group_rule_value_error(self): """ test_update_security_group_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/rules/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString') mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "port_max": 22, "port_min": 22, "protocol": "udp"}' responses.add(responses.PATCH, url, @@ -14189,8 +15432,7 @@ def test_update_security_group_rule_value_error(self): security_group_rule_patch_model['ip_version'] = 'ipv4' security_group_rule_patch_model['port_max'] = 22 security_group_rule_patch_model['port_min'] = 22 - security_group_rule_patch_model[ - 'remote'] = security_group_rule_remote_patch_model + security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model security_group_rule_patch_model['type'] = 8 # Set up parameter values @@ -14205,12 +15447,10 @@ def test_update_security_group_rule_value_error(self): "security_group_rule_patch": security_group_rule_patch, } 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() - } + 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_security_group_rule(**req_copy) + _service.update_security_group_rule(**req_copy) + class TestListSecurityGroupTargets(): @@ -14233,8 +15473,7 @@ def test_list_security_group_targets_all_params(self): list_security_group_targets() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/targets') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add(responses.GET, url, @@ -14248,28 +15487,30 @@ def test_list_security_group_targets_all_params(self): limit = 1 # Invoke method - response = service.list_security_group_targets(security_group_id, - start=start, - limit=limit, - headers={}) + response = _service.list_security_group_targets( + security_group_id, + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_security_group_targets_required_params(self): """ test_list_security_group_targets_required_params() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/targets') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add(responses.GET, url, @@ -14281,21 +15522,23 @@ def test_list_security_group_targets_required_params(self): security_group_id = 'testString' # Invoke method - response = service.list_security_group_targets(security_group_id, - headers={}) + response = _service.list_security_group_targets( + security_group_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_security_group_targets_value_error(self): """ test_list_security_group_targets_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/security_groups/testString/targets') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add(responses.GET, url, @@ -14311,12 +15554,10 @@ def test_list_security_group_targets_value_error(self): "security_group_id": security_group_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() - } + 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_security_group_targets(**req_copy) + _service.list_security_group_targets(**req_copy) + class TestDeleteSecurityGroupTargetBinding(): @@ -14339,31 +15580,37 @@ def test_delete_security_group_target_binding_all_params(self): delete_security_group_target_binding() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' id = 'testString' # Invoke method - response = service.delete_security_group_target_binding( - security_group_id, id, headers={}) + response = _service.delete_security_group_target_binding( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_security_group_target_binding_value_error(self): """ test_delete_security_group_target_binding_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values security_group_id = 'testString' @@ -14375,12 +15622,10 @@ def test_delete_security_group_target_binding_value_error(self): "id": 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() - } + 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_security_group_target_binding(**req_copy) + _service.delete_security_group_target_binding(**req_copy) + class TestGetSecurityGroupTarget(): @@ -14403,8 +15648,7 @@ def test_get_security_group_target_all_params(self): get_security_group_target() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' responses.add(responses.GET, url, @@ -14417,22 +15661,24 @@ def test_get_security_group_target_all_params(self): id = 'testString' # Invoke method - response = service.get_security_group_target(security_group_id, - id, - headers={}) + response = _service.get_security_group_target( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_security_group_target_value_error(self): """ test_get_security_group_target_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' responses.add(responses.GET, url, @@ -14450,12 +15696,10 @@ def test_get_security_group_target_value_error(self): "id": 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() - } + 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_security_group_target(**req_copy) + _service.get_security_group_target(**req_copy) + class TestCreateSecurityGroupTargetBinding(): @@ -14478,8 +15722,7 @@ def test_create_security_group_target_binding_all_params(self): create_security_group_target_binding() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' responses.add(responses.PUT, url, @@ -14492,21 +15735,24 @@ def test_create_security_group_target_binding_all_params(self): id = 'testString' # Invoke method - response = service.create_security_group_target_binding( - security_group_id, id, headers={}) + response = _service.create_security_group_target_binding( + security_group_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_create_security_group_target_binding_value_error(self): """ test_create_security_group_target_binding_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/security_groups/testString/targets/testString') + url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString') mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' responses.add(responses.PUT, url, @@ -14524,12 +15770,10 @@ def test_create_security_group_target_binding_value_error(self): "id": 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() - } + 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_security_group_target_binding(**req_copy) + _service.create_security_group_target_binding(**req_copy) + # endregion @@ -14542,7 +15786,6 @@ def test_create_security_group_target_binding_value_error(self): ############################################################################## # region - class TestListIkePolicies(): """ Test Class for list_ike_policies @@ -14563,7 +15806,7 @@ def test_list_ike_policies_all_params(self): list_ike_policies() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies') + url = self.preprocess_url(_base_url + '/ike_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -14576,26 +15819,29 @@ def test_list_ike_policies_all_params(self): limit = 1 # Invoke method - response = service.list_ike_policies(start=start, - limit=limit, - headers={}) + response = _service.list_ike_policies( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_ike_policies_required_params(self): """ test_list_ike_policies_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies') + url = self.preprocess_url(_base_url + '/ike_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -14604,19 +15850,21 @@ def test_list_ike_policies_required_params(self): status=200) # Invoke method - response = service.list_ike_policies() + response = _service.list_ike_policies() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_ike_policies_value_error(self): """ test_list_ike_policies_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies') + url = self.preprocess_url(_base_url + '/ike_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -14625,14 +15873,13 @@ def test_list_ike_policies_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_ike_policies(**req_copy) + _service.list_ike_policies(**req_copy) + class TestCreateIkePolicy(): @@ -14655,7 +15902,7 @@ def test_create_ike_policy_all_params(self): create_ike_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies') + url = self.preprocess_url(_base_url + '/ike_policies') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.POST, url, @@ -14677,14 +15924,16 @@ def test_create_ike_policy_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_ike_policy(authentication_algorithm, - dh_group, - encryption_algorithm, - ike_version, - key_lifetime=key_lifetime, - name=name, - resource_group=resource_group, - headers={}) + response = _service.create_ike_policy( + authentication_algorithm, + dh_group, + encryption_algorithm, + ike_version, + key_lifetime=key_lifetime, + name=name, + resource_group=resource_group, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -14699,13 +15948,14 @@ def test_create_ike_policy_all_params(self): assert req_body['name'] == 'my-ike-policy' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_ike_policy_value_error(self): """ test_create_ike_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies') + url = self.preprocess_url(_base_url + '/ike_policies') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.POST, url, @@ -14734,12 +15984,10 @@ def test_create_ike_policy_value_error(self): "ike_version": ike_version, } 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() - } + 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_ike_policy(**req_copy) + _service.create_ike_policy(**req_copy) + class TestDeleteIkePolicy(): @@ -14762,27 +16010,35 @@ def test_delete_ike_policy_all_params(self): delete_ike_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/ike_policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_ike_policy(id, headers={}) + response = _service.delete_ike_policy( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_ike_policy_value_error(self): """ test_delete_ike_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/ike_policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -14792,12 +16048,10 @@ def test_delete_ike_policy_value_error(self): "id": 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() - } + 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_ike_policy(**req_copy) + _service.delete_ike_policy(**req_copy) + class TestGetIkePolicy(): @@ -14820,7 +16074,7 @@ def test_get_ike_policy_all_params(self): get_ike_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') + url = self.preprocess_url(_base_url + '/ike_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.GET, url, @@ -14832,19 +16086,23 @@ def test_get_ike_policy_all_params(self): id = 'testString' # Invoke method - response = service.get_ike_policy(id, headers={}) + response = _service.get_ike_policy( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_ike_policy_value_error(self): """ test_get_ike_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') + url = self.preprocess_url(_base_url + '/ike_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.GET, url, @@ -14860,12 +16118,10 @@ def test_get_ike_policy_value_error(self): "id": 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() - } + 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_ike_policy(**req_copy) + _service.get_ike_policy(**req_copy) + class TestUpdateIkePolicy(): @@ -14888,7 +16144,7 @@ def test_update_ike_policy_all_params(self): update_ike_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') + url = self.preprocess_url(_base_url + '/ike_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.PATCH, url, @@ -14910,7 +16166,11 @@ def test_update_ike_policy_all_params(self): ike_policy_patch = ike_policy_patch_model # Invoke method - response = service.update_ike_policy(id, ike_policy_patch, headers={}) + response = _service.update_ike_policy( + id, + ike_policy_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -14919,13 +16179,14 @@ def test_update_ike_policy_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == ike_policy_patch + @responses.activate def test_update_ike_policy_value_error(self): """ test_update_ike_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ike_policies/testString') + url = self.preprocess_url(_base_url + '/ike_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 2, "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add(responses.PATCH, url, @@ -14952,12 +16213,10 @@ def test_update_ike_policy_value_error(self): "ike_policy_patch": ike_policy_patch, } 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() - } + 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_ike_policy(**req_copy) + _service.update_ike_policy(**req_copy) + class TestListIkePolicyConnections(): @@ -14980,8 +16239,7 @@ def test_list_ike_policy_connections_all_params(self): list_ike_policy_connections() """ # Set up mock - url = self.preprocess_url(base_url + - '/ike_policies/testString/connections') + url = self.preprocess_url(_base_url + '/ike_policies/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -14993,20 +16251,23 @@ def test_list_ike_policy_connections_all_params(self): id = 'testString' # Invoke method - response = service.list_ike_policy_connections(id, headers={}) + response = _service.list_ike_policy_connections( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_ike_policy_connections_value_error(self): """ test_list_ike_policy_connections_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/ike_policies/testString/connections') + url = self.preprocess_url(_base_url + '/ike_policies/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -15022,12 +16283,10 @@ def test_list_ike_policy_connections_value_error(self): "id": 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() - } + 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_ike_policy_connections(**req_copy) + _service.list_ike_policy_connections(**req_copy) + class TestListIpsecPolicies(): @@ -15050,7 +16309,7 @@ def test_list_ipsec_policies_all_params(self): list_ipsec_policies() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies') + url = self.preprocess_url(_base_url + '/ipsec_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -15063,26 +16322,29 @@ def test_list_ipsec_policies_all_params(self): limit = 1 # Invoke method - response = service.list_ipsec_policies(start=start, - limit=limit, - headers={}) + response = _service.list_ipsec_policies( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_ipsec_policies_required_params(self): """ test_list_ipsec_policies_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies') + url = self.preprocess_url(_base_url + '/ipsec_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -15091,19 +16353,21 @@ def test_list_ipsec_policies_required_params(self): status=200) # Invoke method - response = service.list_ipsec_policies() + response = _service.list_ipsec_policies() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_ipsec_policies_value_error(self): """ test_list_ipsec_policies_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies') + url = self.preprocess_url(_base_url + '/ipsec_policies') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -15112,14 +16376,13 @@ def test_list_ipsec_policies_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_ipsec_policies(**req_copy) + _service.list_ipsec_policies(**req_copy) + class TestCreateIpsecPolicy(): @@ -15142,7 +16405,7 @@ def test_create_ipsec_policy_all_params(self): create_ipsec_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies') + url = self.preprocess_url(_base_url + '/ipsec_policies') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.POST, url, @@ -15163,13 +16426,15 @@ def test_create_ipsec_policy_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_ipsec_policy(authentication_algorithm, - encryption_algorithm, - pfs, - key_lifetime=key_lifetime, - name=name, - resource_group=resource_group, - headers={}) + response = _service.create_ipsec_policy( + authentication_algorithm, + encryption_algorithm, + pfs, + key_lifetime=key_lifetime, + name=name, + resource_group=resource_group, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -15183,13 +16448,14 @@ def test_create_ipsec_policy_all_params(self): assert req_body['name'] == 'my-ipsec-policy' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_ipsec_policy_value_error(self): """ test_create_ipsec_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies') + url = self.preprocess_url(_base_url + '/ipsec_policies') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.POST, url, @@ -15216,12 +16482,10 @@ def test_create_ipsec_policy_value_error(self): "pfs": pfs, } 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() - } + 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_ipsec_policy(**req_copy) + _service.create_ipsec_policy(**req_copy) + class TestDeleteIpsecPolicy(): @@ -15244,27 +16508,35 @@ def test_delete_ipsec_policy_all_params(self): delete_ipsec_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_ipsec_policy(id, headers={}) + response = _service.delete_ipsec_policy( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_ipsec_policy_value_error(self): """ test_delete_ipsec_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -15274,12 +16546,10 @@ def test_delete_ipsec_policy_value_error(self): "id": 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() - } + 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_ipsec_policy(**req_copy) + _service.delete_ipsec_policy(**req_copy) + class TestGetIpsecPolicy(): @@ -15302,7 +16572,7 @@ def test_get_ipsec_policy_all_params(self): get_ipsec_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.GET, url, @@ -15314,19 +16584,23 @@ def test_get_ipsec_policy_all_params(self): id = 'testString' # Invoke method - response = service.get_ipsec_policy(id, headers={}) + response = _service.get_ipsec_policy( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_ipsec_policy_value_error(self): """ test_get_ipsec_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.GET, url, @@ -15342,12 +16616,10 @@ def test_get_ipsec_policy_value_error(self): "id": 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() - } + 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_ipsec_policy(**req_copy) + _service.get_ipsec_policy(**req_copy) + class TestUpdateIpsecPolicy(): @@ -15370,7 +16642,7 @@ def test_update_ipsec_policy_all_params(self): update_ipsec_policy() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.PATCH, url, @@ -15391,9 +16663,11 @@ def test_update_ipsec_policy_all_params(self): i_psec_policy_patch = i_psec_policy_patch_model # Invoke method - response = service.update_ipsec_policy(id, - i_psec_policy_patch, - headers={}) + response = _service.update_ipsec_policy( + id, + i_psec_policy_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -15402,13 +16676,14 @@ def test_update_ipsec_policy_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == i_psec_policy_patch + @responses.activate def test_update_ipsec_policy_value_error(self): """ test_update_ipsec_policy_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/ipsec_policies/testString') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString') mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "triple_des", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.PATCH, url, @@ -15434,12 +16709,10 @@ def test_update_ipsec_policy_value_error(self): "i_psec_policy_patch": i_psec_policy_patch, } 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() - } + 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_ipsec_policy(**req_copy) + _service.update_ipsec_policy(**req_copy) + class TestListIpsecPolicyConnections(): @@ -15462,8 +16735,7 @@ def test_list_ipsec_policy_connections_all_params(self): list_ipsec_policy_connections() """ # Set up mock - url = self.preprocess_url(base_url + - '/ipsec_policies/testString/connections') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -15475,20 +16747,23 @@ def test_list_ipsec_policy_connections_all_params(self): id = 'testString' # Invoke method - response = service.list_ipsec_policy_connections(id, headers={}) + response = _service.list_ipsec_policy_connections( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_ipsec_policy_connections_value_error(self): """ test_list_ipsec_policy_connections_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/ipsec_policies/testString/connections') + url = self.preprocess_url(_base_url + '/ipsec_policies/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -15504,12 +16779,10 @@ def test_list_ipsec_policy_connections_value_error(self): "id": 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() - } + 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_ipsec_policy_connections(**req_copy) + _service.list_ipsec_policy_connections(**req_copy) + class TestListVpnGateways(): @@ -15532,7 +16805,7 @@ def test_list_vpn_gateways_all_params(self): list_vpn_gateways() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways') + url = self.preprocess_url(_base_url + '/vpn_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}' responses.add(responses.GET, url, @@ -15547,31 +16820,33 @@ def test_list_vpn_gateways_all_params(self): mode = 'route' # Invoke method - response = service.list_vpn_gateways( + response = _service.list_vpn_gateways( start=start, limit=limit, resource_group_id=resource_group_id, mode=mode, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'mode={}'.format(mode) in query_string + @responses.activate def test_list_vpn_gateways_required_params(self): """ test_list_vpn_gateways_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways') + url = self.preprocess_url(_base_url + '/vpn_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}' responses.add(responses.GET, url, @@ -15580,19 +16855,21 @@ def test_list_vpn_gateways_required_params(self): status=200) # Invoke method - response = service.list_vpn_gateways() + response = _service.list_vpn_gateways() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpn_gateways_value_error(self): """ test_list_vpn_gateways_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways') + url = self.preprocess_url(_base_url + '/vpn_gateways') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}' responses.add(responses.GET, url, @@ -15601,14 +16878,13 @@ def test_list_vpn_gateways_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_vpn_gateways(**req_copy) + _service.list_vpn_gateways(**req_copy) + class TestCreateVpnGateway(): @@ -15631,7 +16907,7 @@ def test_create_vpn_gateway_all_params(self): create_vpn_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways') + url = self.preprocess_url(_base_url + '/vpn_gateways') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.POST, url, @@ -15650,8 +16926,7 @@ def test_create_vpn_gateway_all_params(self): # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model vpn_gateway_prototype_model = {} vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' - vpn_gateway_prototype_model[ - 'resource_group'] = resource_group_identity_model + vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model vpn_gateway_prototype_model['subnet'] = subnet_identity_model vpn_gateway_prototype_model['mode'] = 'route' @@ -15659,7 +16934,10 @@ def test_create_vpn_gateway_all_params(self): vpn_gateway_prototype = vpn_gateway_prototype_model # Invoke method - response = service.create_vpn_gateway(vpn_gateway_prototype, headers={}) + response = _service.create_vpn_gateway( + vpn_gateway_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -15668,13 +16946,14 @@ def test_create_vpn_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == vpn_gateway_prototype + @responses.activate def test_create_vpn_gateway_value_error(self): """ test_create_vpn_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways') + url = self.preprocess_url(_base_url + '/vpn_gateways') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.POST, url, @@ -15693,8 +16972,7 @@ def test_create_vpn_gateway_value_error(self): # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model vpn_gateway_prototype_model = {} vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' - vpn_gateway_prototype_model[ - 'resource_group'] = resource_group_identity_model + vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model vpn_gateway_prototype_model['subnet'] = subnet_identity_model vpn_gateway_prototype_model['mode'] = 'route' @@ -15706,12 +16984,10 @@ def test_create_vpn_gateway_value_error(self): "vpn_gateway_prototype": vpn_gateway_prototype, } 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() - } + 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_vpn_gateway(**req_copy) + _service.create_vpn_gateway(**req_copy) + class TestDeleteVpnGateway(): @@ -15734,27 +17010,35 @@ def test_delete_vpn_gateway_all_params(self): delete_vpn_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_vpn_gateway(id, headers={}) + response = _service.delete_vpn_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 202 + @responses.activate def test_delete_vpn_gateway_value_error(self): """ test_delete_vpn_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values id = 'testString' @@ -15764,12 +17048,10 @@ def test_delete_vpn_gateway_value_error(self): "id": 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() - } + 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_vpn_gateway(**req_copy) + _service.delete_vpn_gateway(**req_copy) + class TestGetVpnGateway(): @@ -15792,7 +17074,7 @@ def test_get_vpn_gateway_all_params(self): get_vpn_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.GET, url, @@ -15804,19 +17086,23 @@ def test_get_vpn_gateway_all_params(self): id = 'testString' # Invoke method - response = service.get_vpn_gateway(id, headers={}) + response = _service.get_vpn_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpn_gateway_value_error(self): """ test_get_vpn_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.GET, url, @@ -15832,12 +17118,10 @@ def test_get_vpn_gateway_value_error(self): "id": 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() - } + 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_vpn_gateway(**req_copy) + _service.get_vpn_gateway(**req_copy) + class TestUpdateVpnGateway(): @@ -15860,7 +17144,7 @@ def test_update_vpn_gateway_all_params(self): update_vpn_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.PATCH, url, @@ -15877,7 +17161,11 @@ def test_update_vpn_gateway_all_params(self): vpn_gateway_patch = vpn_gateway_patch_model # Invoke method - response = service.update_vpn_gateway(id, vpn_gateway_patch, headers={}) + response = _service.update_vpn_gateway( + id, + vpn_gateway_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -15886,13 +17174,14 @@ def test_update_vpn_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == vpn_gateway_patch + @responses.activate def test_update_vpn_gateway_value_error(self): """ test_update_vpn_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/vpn_gateways/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString') mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}' responses.add(responses.PATCH, url, @@ -15914,12 +17203,10 @@ def test_update_vpn_gateway_value_error(self): "vpn_gateway_patch": vpn_gateway_patch, } 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() - } + 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_vpn_gateway(**req_copy) + _service.update_vpn_gateway(**req_copy) + class TestListVpnGatewayConnections(): @@ -15942,8 +17229,7 @@ def test_list_vpn_gateway_connections_all_params(self): list_vpn_gateway_connections() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpn_gateways/testString/connections') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -15956,26 +17242,28 @@ def test_list_vpn_gateway_connections_all_params(self): status = 'testString' # Invoke method - response = service.list_vpn_gateway_connections(vpn_gateway_id, - status=status, - headers={}) + response = _service.list_vpn_gateway_connections( + vpn_gateway_id, + status=status, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'status={}'.format(status) in query_string + @responses.activate def test_list_vpn_gateway_connections_required_params(self): """ test_list_vpn_gateway_connections_required_params() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpn_gateways/testString/connections') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -15987,21 +17275,23 @@ def test_list_vpn_gateway_connections_required_params(self): vpn_gateway_id = 'testString' # Invoke method - response = service.list_vpn_gateway_connections(vpn_gateway_id, - headers={}) + response = _service.list_vpn_gateway_connections( + vpn_gateway_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpn_gateway_connections_value_error(self): """ test_list_vpn_gateway_connections_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpn_gateways/testString/connections') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections') mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}]}' responses.add(responses.GET, url, @@ -16017,12 +17307,10 @@ def test_list_vpn_gateway_connections_value_error(self): "vpn_gateway_id": vpn_gateway_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() - } + 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_vpn_gateway_connections(**req_copy) + _service.list_vpn_gateway_connections(**req_copy) + class TestCreateVpnGatewayConnection(): @@ -16045,8 +17333,7 @@ def test_create_vpn_gateway_connection_all_params(self): create_vpn_gateway_connection() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpn_gateways/testString/connections') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.POST, url, @@ -16066,18 +17353,14 @@ def test_create_vpn_gateway_connection_all_params(self): # Construct a dict representation of a IPsecPolicyIdentityById model i_psec_policy_identity_model = {} - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model vpn_gateway_connection_prototype_model = {} vpn_gateway_connection_prototype_model['admin_state_up'] = True - vpn_gateway_connection_prototype_model[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_model[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_prototype_model[ - 'ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_model['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_prototype_model['ipsec_policy'] = i_psec_policy_identity_model vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5' vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' @@ -16088,8 +17371,11 @@ def test_create_vpn_gateway_connection_all_params(self): vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model # Invoke method - response = service.create_vpn_gateway_connection( - vpn_gateway_id, vpn_gateway_connection_prototype, headers={}) + response = _service.create_vpn_gateway_connection( + vpn_gateway_id, + vpn_gateway_connection_prototype, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -16098,14 +17384,14 @@ def test_create_vpn_gateway_connection_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == vpn_gateway_connection_prototype + @responses.activate def test_create_vpn_gateway_connection_value_error(self): """ test_create_vpn_gateway_connection_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/vpn_gateways/testString/connections') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.POST, url, @@ -16125,18 +17411,14 @@ def test_create_vpn_gateway_connection_value_error(self): # Construct a dict representation of a IPsecPolicyIdentityById model i_psec_policy_identity_model = {} - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model vpn_gateway_connection_prototype_model = {} vpn_gateway_connection_prototype_model['admin_state_up'] = True - vpn_gateway_connection_prototype_model[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_model[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_prototype_model[ - 'ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_model['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_prototype_model['ipsec_policy'] = i_psec_policy_identity_model vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5' vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' @@ -16148,18 +17430,14 @@ def test_create_vpn_gateway_connection_value_error(self): # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": - vpn_gateway_id, - "vpn_gateway_connection_prototype": - vpn_gateway_connection_prototype, + "vpn_gateway_id": vpn_gateway_id, + "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype, } 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() - } + 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_vpn_gateway_connection(**req_copy) + _service.create_vpn_gateway_connection(**req_copy) + class TestDeleteVpnGatewayConnection(): @@ -16182,32 +17460,37 @@ def test_delete_vpn_gateway_connection_all_params(self): delete_vpn_gateway_connection() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values vpn_gateway_id = 'testString' id = 'testString' # Invoke method - response = service.delete_vpn_gateway_connection(vpn_gateway_id, - id, - headers={}) + response = _service.delete_vpn_gateway_connection( + vpn_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 202 + @responses.activate def test_delete_vpn_gateway_connection_value_error(self): """ test_delete_vpn_gateway_connection_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') - responses.add(responses.DELETE, url, status=202) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') + responses.add(responses.DELETE, + url, + status=202) # Set up parameter values vpn_gateway_id = 'testString' @@ -16219,12 +17502,10 @@ def test_delete_vpn_gateway_connection_value_error(self): "id": 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() - } + 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_vpn_gateway_connection(**req_copy) + _service.delete_vpn_gateway_connection(**req_copy) + class TestGetVpnGatewayConnection(): @@ -16247,8 +17528,7 @@ def test_get_vpn_gateway_connection_all_params(self): get_vpn_gateway_connection() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.GET, url, @@ -16261,22 +17541,24 @@ def test_get_vpn_gateway_connection_all_params(self): id = 'testString' # Invoke method - response = service.get_vpn_gateway_connection(vpn_gateway_id, - id, - headers={}) + response = _service.get_vpn_gateway_connection( + vpn_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_vpn_gateway_connection_value_error(self): """ test_get_vpn_gateway_connection_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.GET, url, @@ -16294,12 +17576,10 @@ def test_get_vpn_gateway_connection_value_error(self): "id": 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() - } + 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_vpn_gateway_connection(**req_copy) + _service.get_vpn_gateway_connection(**req_copy) + class TestUpdateVpnGatewayConnection(): @@ -16322,8 +17602,7 @@ def test_update_vpn_gateway_connection_all_params(self): update_vpn_gateway_connection() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.PATCH, url, @@ -16343,18 +17622,14 @@ def test_update_vpn_gateway_connection_all_params(self): # Construct a dict representation of a IPsecPolicyIdentityById model i_psec_policy_identity_model = {} - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model vpn_gateway_connection_patch_model = {} vpn_gateway_connection_patch_model['admin_state_up'] = True - vpn_gateway_connection_patch_model[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_patch_model[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_patch_model[ - 'ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_patch_model['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_patch_model['ipsec_policy'] = i_psec_policy_identity_model vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5' vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' @@ -16366,8 +17641,12 @@ def test_update_vpn_gateway_connection_all_params(self): vpn_gateway_connection_patch = vpn_gateway_connection_patch_model # Invoke method - response = service.update_vpn_gateway_connection( - vpn_gateway_id, id, vpn_gateway_connection_patch, headers={}) + response = _service.update_vpn_gateway_connection( + vpn_gateway_id, + id, + vpn_gateway_connection_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -16376,14 +17655,14 @@ def test_update_vpn_gateway_connection_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == vpn_gateway_connection_patch + @responses.activate def test_update_vpn_gateway_connection_value_error(self): """ test_update_vpn_gateway_connection_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/vpn_gateways/testString/connections/testString') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString') mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "up"}]}' responses.add(responses.PATCH, url, @@ -16403,18 +17682,14 @@ def test_update_vpn_gateway_connection_value_error(self): # Construct a dict representation of a IPsecPolicyIdentityById model i_psec_policy_identity_model = {} - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model vpn_gateway_connection_patch_model = {} vpn_gateway_connection_patch_model['admin_state_up'] = True - vpn_gateway_connection_patch_model[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_patch_model[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_patch_model[ - 'ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_patch_model['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_patch_model['ipsec_policy'] = i_psec_policy_identity_model vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5' vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' @@ -16432,12 +17707,10 @@ def test_update_vpn_gateway_connection_value_error(self): "vpn_gateway_connection_patch": vpn_gateway_connection_patch, } 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() - } + 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_vpn_gateway_connection(**req_copy) + _service.update_vpn_gateway_connection(**req_copy) + class TestListVpnGatewayConnectionLocalCidrs(): @@ -16460,9 +17733,7 @@ def test_list_vpn_gateway_connection_local_cidrs_all_params(self): list_vpn_gateway_connection_local_cidrs() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs') mock_response = '{"local_cidrs": ["192.168.1.0/24"]}' responses.add(responses.GET, url, @@ -16475,22 +17746,24 @@ def test_list_vpn_gateway_connection_local_cidrs_all_params(self): id = 'testString' # Invoke method - response = service.list_vpn_gateway_connection_local_cidrs( - vpn_gateway_id, id, headers={}) + response = _service.list_vpn_gateway_connection_local_cidrs( + vpn_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpn_gateway_connection_local_cidrs_value_error(self): """ test_list_vpn_gateway_connection_local_cidrs_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs') mock_response = '{"local_cidrs": ["192.168.1.0/24"]}' responses.add(responses.GET, url, @@ -16508,12 +17781,10 @@ def test_list_vpn_gateway_connection_local_cidrs_value_error(self): "id": 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() - } + 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_vpn_gateway_connection_local_cidrs(**req_copy) + _service.list_vpn_gateway_connection_local_cidrs(**req_copy) + class TestRemoveVpnGatewayConnectionLocalCidr(): @@ -16536,11 +17807,10 @@ def test_remove_vpn_gateway_connection_local_cidr_all_params(self): remove_vpn_gateway_connection_local_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16549,24 +17819,29 @@ def test_remove_vpn_gateway_connection_local_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.remove_vpn_gateway_connection_local_cidr( - vpn_gateway_id, id, cidr_prefix, prefix_length, headers={}) + response = _service.remove_vpn_gateway_connection_local_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_remove_vpn_gateway_connection_local_cidr_value_error(self): """ test_remove_vpn_gateway_connection_local_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16582,12 +17857,10 @@ def test_remove_vpn_gateway_connection_local_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + 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_vpn_gateway_connection_local_cidr(**req_copy) + _service.remove_vpn_gateway_connection_local_cidr(**req_copy) + class TestCheckVpnGatewayConnectionLocalCidr(): @@ -16610,11 +17883,10 @@ def test_check_vpn_gateway_connection_local_cidr_all_params(self): check_vpn_gateway_connection_local_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.GET, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.GET, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16623,24 +17895,29 @@ def test_check_vpn_gateway_connection_local_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.check_vpn_gateway_connection_local_cidr( - vpn_gateway_id, id, cidr_prefix, prefix_length, headers={}) + response = _service.check_vpn_gateway_connection_local_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_check_vpn_gateway_connection_local_cidr_value_error(self): """ test_check_vpn_gateway_connection_local_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.GET, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.GET, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16656,12 +17933,10 @@ def test_check_vpn_gateway_connection_local_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.check_vpn_gateway_connection_local_cidr(**req_copy) + _service.check_vpn_gateway_connection_local_cidr(**req_copy) + class TestAddVpnGatewayConnectionLocalCidr(): @@ -16684,11 +17959,10 @@ def test_add_vpn_gateway_connection_local_cidr_all_params(self): add_vpn_gateway_connection_local_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.PUT, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.PUT, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16697,27 +17971,29 @@ def test_add_vpn_gateway_connection_local_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.add_vpn_gateway_connection_local_cidr(vpn_gateway_id, - id, - cidr_prefix, - prefix_length, - headers={}) + response = _service.add_vpn_gateway_connection_local_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_add_vpn_gateway_connection_local_cidr_value_error(self): """ test_add_vpn_gateway_connection_local_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString' - ) - responses.add(responses.PUT, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString') + responses.add(responses.PUT, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16733,12 +18009,10 @@ def test_add_vpn_gateway_connection_local_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + 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_vpn_gateway_connection_local_cidr(**req_copy) + _service.add_vpn_gateway_connection_local_cidr(**req_copy) + class TestListVpnGatewayConnectionPeerCidrs(): @@ -16761,9 +18035,7 @@ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self): list_vpn_gateway_connection_peer_cidrs() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs') mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}' responses.add(responses.GET, url, @@ -16776,22 +18048,24 @@ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self): id = 'testString' # Invoke method - response = service.list_vpn_gateway_connection_peer_cidrs( - vpn_gateway_id, id, headers={}) + response = _service.list_vpn_gateway_connection_peer_cidrs( + vpn_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_vpn_gateway_connection_peer_cidrs_value_error(self): """ test_list_vpn_gateway_connection_peer_cidrs_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs') + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs') mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}' responses.add(responses.GET, url, @@ -16809,12 +18083,10 @@ def test_list_vpn_gateway_connection_peer_cidrs_value_error(self): "id": 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() - } + 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_vpn_gateway_connection_peer_cidrs(**req_copy) + _service.list_vpn_gateway_connection_peer_cidrs(**req_copy) + class TestRemoveVpnGatewayConnectionPeerCidr(): @@ -16837,11 +18109,10 @@ def test_remove_vpn_gateway_connection_peer_cidr_all_params(self): remove_vpn_gateway_connection_peer_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16850,24 +18121,29 @@ def test_remove_vpn_gateway_connection_peer_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.remove_vpn_gateway_connection_peer_cidr( - vpn_gateway_id, id, cidr_prefix, prefix_length, headers={}) + response = _service.remove_vpn_gateway_connection_peer_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_remove_vpn_gateway_connection_peer_cidr_value_error(self): """ test_remove_vpn_gateway_connection_peer_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16883,12 +18159,10 @@ def test_remove_vpn_gateway_connection_peer_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + 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_vpn_gateway_connection_peer_cidr(**req_copy) + _service.remove_vpn_gateway_connection_peer_cidr(**req_copy) + class TestCheckVpnGatewayConnectionPeerCidr(): @@ -16911,11 +18185,10 @@ def test_check_vpn_gateway_connection_peer_cidr_all_params(self): check_vpn_gateway_connection_peer_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.GET, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.GET, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16924,24 +18197,29 @@ def test_check_vpn_gateway_connection_peer_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.check_vpn_gateway_connection_peer_cidr( - vpn_gateway_id, id, cidr_prefix, prefix_length, headers={}) + response = _service.check_vpn_gateway_connection_peer_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_check_vpn_gateway_connection_peer_cidr_value_error(self): """ test_check_vpn_gateway_connection_peer_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.GET, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.GET, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16957,12 +18235,10 @@ def test_check_vpn_gateway_connection_peer_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.check_vpn_gateway_connection_peer_cidr(**req_copy) + _service.check_vpn_gateway_connection_peer_cidr(**req_copy) + class TestAddVpnGatewayConnectionPeerCidr(): @@ -16985,11 +18261,10 @@ def test_add_vpn_gateway_connection_peer_cidr_all_params(self): add_vpn_gateway_connection_peer_cidr() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.PUT, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.PUT, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -16998,27 +18273,29 @@ def test_add_vpn_gateway_connection_peer_cidr_all_params(self): prefix_length = 'testString' # Invoke method - response = service.add_vpn_gateway_connection_peer_cidr(vpn_gateway_id, - id, - cidr_prefix, - prefix_length, - headers={}) + response = _service.add_vpn_gateway_connection_peer_cidr( + vpn_gateway_id, + id, + cidr_prefix, + prefix_length, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_add_vpn_gateway_connection_peer_cidr_value_error(self): """ test_add_vpn_gateway_connection_peer_cidr_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString' - ) - responses.add(responses.PUT, url, status=204) + url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString') + responses.add(responses.PUT, + url, + status=204) # Set up parameter values vpn_gateway_id = 'testString' @@ -17034,12 +18311,10 @@ def test_add_vpn_gateway_connection_peer_cidr_value_error(self): "prefix_length": prefix_length, } 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() - } + 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_vpn_gateway_connection_peer_cidr(**req_copy) + _service.add_vpn_gateway_connection_peer_cidr(**req_copy) + # endregion @@ -17052,7 +18327,6 @@ def test_add_vpn_gateway_connection_peer_cidr_value_error(self): ############################################################################## # region - class TestListLoadBalancerProfiles(): """ Test Class for list_load_balancer_profiles @@ -17073,7 +18347,7 @@ def test_list_load_balancer_profiles_all_params(self): list_load_balancer_profiles() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancer/profiles') + url = self.preprocess_url(_base_url + '/load_balancer/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, @@ -17086,26 +18360,29 @@ def test_list_load_balancer_profiles_all_params(self): limit = 1 # Invoke method - response = service.list_load_balancer_profiles(start=start, - limit=limit, - headers={}) + response = _service.list_load_balancer_profiles( + start=start, + limit=limit, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + @responses.activate def test_list_load_balancer_profiles_required_params(self): """ test_list_load_balancer_profiles_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancer/profiles') + url = self.preprocess_url(_base_url + '/load_balancer/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, @@ -17114,19 +18391,21 @@ def test_list_load_balancer_profiles_required_params(self): status=200) # Invoke method - response = service.list_load_balancer_profiles() + response = _service.list_load_balancer_profiles() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_profiles_value_error(self): """ test_list_load_balancer_profiles_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancer/profiles') + url = self.preprocess_url(_base_url + '/load_balancer/profiles') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, @@ -17135,14 +18414,13 @@ def test_list_load_balancer_profiles_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_load_balancer_profiles(**req_copy) + _service.list_load_balancer_profiles(**req_copy) + class TestGetLoadBalancerProfile(): @@ -17165,8 +18443,7 @@ def test_get_load_balancer_profile_all_params(self): get_load_balancer_profile() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancer/profiles/testString') + url = self.preprocess_url(_base_url + '/load_balancer/profiles/testString') mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "security_groups_supported": {"type": "fixed", "value": true}}' responses.add(responses.GET, url, @@ -17178,20 +18455,23 @@ def test_get_load_balancer_profile_all_params(self): name = 'testString' # Invoke method - response = service.get_load_balancer_profile(name, headers={}) + response = _service.get_load_balancer_profile( + name, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_profile_value_error(self): """ test_get_load_balancer_profile_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancer/profiles/testString') + url = self.preprocess_url(_base_url + '/load_balancer/profiles/testString') mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "security_groups_supported": {"type": "fixed", "value": true}}' responses.add(responses.GET, url, @@ -17207,12 +18487,10 @@ def test_get_load_balancer_profile_value_error(self): "name": name, } 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() - } + 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_load_balancer_profile(**req_copy) + _service.get_load_balancer_profile(**req_copy) + class TestListLoadBalancers(): @@ -17235,7 +18513,7 @@ def test_list_load_balancers_all_params(self): list_load_balancers() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers') + url = self.preprocess_url(_base_url + '/load_balancers') mock_response = '{"load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}]}' responses.add(responses.GET, url, @@ -17244,19 +18522,21 @@ def test_list_load_balancers_all_params(self): status=200) # Invoke method - response = service.list_load_balancers() + response = _service.list_load_balancers() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancers_value_error(self): """ test_list_load_balancers_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers') + url = self.preprocess_url(_base_url + '/load_balancers') mock_response = '{"load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}]}' responses.add(responses.GET, url, @@ -17265,14 +18545,13 @@ def test_list_load_balancers_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_load_balancers(**req_copy) + _service.list_load_balancers(**req_copy) + class TestCreateLoadBalancer(): @@ -17295,7 +18574,7 @@ def test_create_load_balancer_all_params(self): create_load_balancer() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers') + url = self.preprocess_url(_base_url + '/load_balancers') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.POST, url, @@ -17309,21 +18588,15 @@ def test_create_load_balancer_all_params(self): # Construct a dict representation of a LoadBalancerPoolIdentityByName model load_balancer_pool_identity_by_name_model = {} - load_balancer_pool_identity_by_name_model[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model = {} - load_balancer_listener_prototype_load_balancer_context_model[ - 'accept_proxy_protocol'] = True - load_balancer_listener_prototype_load_balancer_context_model[ - 'connection_limit'] = 2000 - load_balancer_listener_prototype_load_balancer_context_model[ - 'default_pool'] = load_balancer_pool_identity_by_name_model - load_balancer_listener_prototype_load_balancer_context_model[ - 'port'] = 443 - load_balancer_listener_prototype_load_balancer_context_model[ - 'protocol'] = 'http' + load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 + load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' # Construct a dict representation of a LoadBalancerLoggingDatapath model load_balancer_logging_datapath_model = {} @@ -17331,8 +18604,7 @@ def test_create_load_balancer_all_params(self): # Construct a dict representation of a LoadBalancerLogging model load_balancer_logging_model = {} - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model load_balancer_pool_health_monitor_prototype_model = {} @@ -17345,34 +18617,27 @@ def test_create_load_balancer_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model['type'] = 'source_ip' # Construct a dict representation of a LoadBalancerPoolPrototype model load_balancer_pool_prototype_model = {} load_balancer_pool_prototype_model['algorithm'] = 'least_connections' - load_balancer_pool_prototype_model[ - 'health_monitor'] = load_balancer_pool_health_monitor_prototype_model - load_balancer_pool_prototype_model['members'] = [ - load_balancer_pool_member_prototype_model - ] + load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model + load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' load_balancer_pool_prototype_model['protocol'] = 'http' load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' - load_balancer_pool_prototype_model[ - 'session_persistence'] = load_balancer_pool_session_persistence_prototype_model + load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model # Construct a dict representation of a LoadBalancerProfileIdentityByName model load_balancer_profile_identity_model = {} @@ -17384,15 +18649,12 @@ def test_create_load_balancer_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values is_public = True subnets = [subnet_identity_model] - listeners = [ - load_balancer_listener_prototype_load_balancer_context_model - ] + listeners = [load_balancer_listener_prototype_load_balancer_context_model] logging = load_balancer_logging_model name = 'my-load-balancer' pools = [load_balancer_pool_prototype_model] @@ -17401,16 +18663,18 @@ def test_create_load_balancer_all_params(self): security_groups = [security_group_identity_model] # Invoke method - response = service.create_load_balancer(is_public, - subnets, - listeners=listeners, - logging=logging, - name=name, - pools=pools, - profile=profile, - resource_group=resource_group, - security_groups=security_groups, - headers={}) + response = _service.create_load_balancer( + is_public, + subnets, + listeners=listeners, + logging=logging, + name=name, + pools=pools, + profile=profile, + resource_group=resource_group, + security_groups=security_groups, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -17419,9 +18683,7 @@ def test_create_load_balancer_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['is_public'] == True assert req_body['subnets'] == [subnet_identity_model] - assert req_body['listeners'] == [ - load_balancer_listener_prototype_load_balancer_context_model - ] + assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model] assert req_body['logging'] == load_balancer_logging_model assert req_body['name'] == 'my-load-balancer' assert req_body['pools'] == [load_balancer_pool_prototype_model] @@ -17429,13 +18691,14 @@ def test_create_load_balancer_all_params(self): assert req_body['resource_group'] == resource_group_identity_model assert req_body['security_groups'] == [security_group_identity_model] + @responses.activate def test_create_load_balancer_value_error(self): """ test_create_load_balancer_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers') + url = self.preprocess_url(_base_url + '/load_balancers') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.POST, url, @@ -17449,21 +18712,15 @@ def test_create_load_balancer_value_error(self): # Construct a dict representation of a LoadBalancerPoolIdentityByName model load_balancer_pool_identity_by_name_model = {} - load_balancer_pool_identity_by_name_model[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model = {} - load_balancer_listener_prototype_load_balancer_context_model[ - 'accept_proxy_protocol'] = True - load_balancer_listener_prototype_load_balancer_context_model[ - 'connection_limit'] = 2000 - load_balancer_listener_prototype_load_balancer_context_model[ - 'default_pool'] = load_balancer_pool_identity_by_name_model - load_balancer_listener_prototype_load_balancer_context_model[ - 'port'] = 443 - load_balancer_listener_prototype_load_balancer_context_model[ - 'protocol'] = 'http' + load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 + load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' # Construct a dict representation of a LoadBalancerLoggingDatapath model load_balancer_logging_datapath_model = {} @@ -17471,8 +18728,7 @@ def test_create_load_balancer_value_error(self): # Construct a dict representation of a LoadBalancerLogging model load_balancer_logging_model = {} - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model load_balancer_pool_health_monitor_prototype_model = {} @@ -17485,34 +18741,27 @@ def test_create_load_balancer_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model['type'] = 'source_ip' # Construct a dict representation of a LoadBalancerPoolPrototype model load_balancer_pool_prototype_model = {} load_balancer_pool_prototype_model['algorithm'] = 'least_connections' - load_balancer_pool_prototype_model[ - 'health_monitor'] = load_balancer_pool_health_monitor_prototype_model - load_balancer_pool_prototype_model['members'] = [ - load_balancer_pool_member_prototype_model - ] + load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model + load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' load_balancer_pool_prototype_model['protocol'] = 'http' load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' - load_balancer_pool_prototype_model[ - 'session_persistence'] = load_balancer_pool_session_persistence_prototype_model + load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model # Construct a dict representation of a LoadBalancerProfileIdentityByName model load_balancer_profile_identity_model = {} @@ -17524,15 +18773,12 @@ def test_create_load_balancer_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values is_public = True subnets = [subnet_identity_model] - listeners = [ - load_balancer_listener_prototype_load_balancer_context_model - ] + listeners = [load_balancer_listener_prototype_load_balancer_context_model] logging = load_balancer_logging_model name = 'my-load-balancer' pools = [load_balancer_pool_prototype_model] @@ -17546,12 +18792,10 @@ def test_create_load_balancer_value_error(self): "subnets": subnets, } 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() - } + 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_load_balancer(**req_copy) + _service.create_load_balancer(**req_copy) + class TestDeleteLoadBalancer(): @@ -17574,27 +18818,35 @@ def test_delete_load_balancer_all_params(self): delete_load_balancer() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_load_balancer(id, headers={}) + response = _service.delete_load_balancer( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_value_error(self): """ test_delete_load_balancer_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -17604,12 +18856,10 @@ def test_delete_load_balancer_value_error(self): "id": 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() - } + 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_load_balancer(**req_copy) + _service.delete_load_balancer(**req_copy) + class TestGetLoadBalancer(): @@ -17632,7 +18882,7 @@ def test_get_load_balancer_all_params(self): get_load_balancer() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -17644,19 +18894,23 @@ def test_get_load_balancer_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer(id, headers={}) + response = _service.get_load_balancer( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_value_error(self): """ test_get_load_balancer_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.GET, url, @@ -17672,12 +18926,10 @@ def test_get_load_balancer_value_error(self): "id": 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() - } + 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_load_balancer(**req_copy) + _service.get_load_balancer(**req_copy) + class TestUpdateLoadBalancer(): @@ -17700,7 +18952,7 @@ def test_update_load_balancer_all_params(self): update_load_balancer() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PATCH, url, @@ -17714,8 +18966,7 @@ def test_update_load_balancer_all_params(self): # Construct a dict representation of a LoadBalancerLogging model load_balancer_logging_model = {} - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model # Construct a dict representation of a LoadBalancerPatch model load_balancer_patch_model = {} @@ -17727,9 +18978,11 @@ def test_update_load_balancer_all_params(self): load_balancer_patch = load_balancer_patch_model # Invoke method - response = service.update_load_balancer(id, - load_balancer_patch, - headers={}) + response = _service.update_load_balancer( + id, + load_balancer_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -17738,13 +18991,14 @@ def test_update_load_balancer_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_patch + @responses.activate def test_update_load_balancer_value_error(self): """ test_update_load_balancer_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' responses.add(responses.PATCH, url, @@ -17758,8 +19012,7 @@ def test_update_load_balancer_value_error(self): # Construct a dict representation of a LoadBalancerLogging model load_balancer_logging_model = {} - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model # Construct a dict representation of a LoadBalancerPatch model load_balancer_patch_model = {} @@ -17776,12 +19029,10 @@ def test_update_load_balancer_value_error(self): "load_balancer_patch": load_balancer_patch, } 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() - } + 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_load_balancer(**req_copy) + _service.update_load_balancer(**req_copy) + class TestGetLoadBalancerStatistics(): @@ -17804,8 +19055,7 @@ def test_get_load_balancer_statistics_all_params(self): get_load_balancer_statistics() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/statistics') + url = self.preprocess_url(_base_url + '/load_balancers/testString/statistics') mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' responses.add(responses.GET, url, @@ -17817,20 +19067,23 @@ def test_get_load_balancer_statistics_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_statistics(id, headers={}) + response = _service.get_load_balancer_statistics( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_statistics_value_error(self): """ test_get_load_balancer_statistics_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/statistics') + url = self.preprocess_url(_base_url + '/load_balancers/testString/statistics') mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' responses.add(responses.GET, url, @@ -17846,12 +19099,10 @@ def test_get_load_balancer_statistics_value_error(self): "id": 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() - } + 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_load_balancer_statistics(**req_copy) + _service.get_load_balancer_statistics(**req_copy) + class TestListLoadBalancerListeners(): @@ -17874,8 +19125,7 @@ def test_list_load_balancer_listeners_all_params(self): list_load_balancer_listeners() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/listeners') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, @@ -17887,21 +19137,23 @@ def test_list_load_balancer_listeners_all_params(self): load_balancer_id = 'testString' # Invoke method - response = service.list_load_balancer_listeners(load_balancer_id, - headers={}) + response = _service.list_load_balancer_listeners( + load_balancer_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_listeners_value_error(self): """ test_list_load_balancer_listeners_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/listeners') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, @@ -17917,12 +19169,10 @@ def test_list_load_balancer_listeners_value_error(self): "load_balancer_id": load_balancer_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() - } + 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_load_balancer_listeners(**req_copy) + _service.list_load_balancer_listeners(**req_copy) + class TestCreateLoadBalancerListener(): @@ -17945,8 +19195,7 @@ def test_create_load_balancer_listener_all_params(self): create_load_balancer_listener() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/listeners') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, @@ -17956,39 +19205,30 @@ def test_create_load_balancer_listener_all_params(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_prototype_model['type'] = 'header' - load_balancer_listener_policy_rule_prototype_model[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model load_balancer_listener_policy_prototype_model = {} load_balancer_listener_policy_prototype_model['action'] = 'forward' load_balancer_listener_policy_prototype_model['name'] = 'my-policy' load_balancer_listener_policy_prototype_model['priority'] = 5 - load_balancer_listener_policy_prototype_model['rules'] = [ - load_balancer_listener_policy_rule_prototype_model - ] - load_balancer_listener_policy_prototype_model[ - 'target'] = load_balancer_listener_policy_target_prototype_model + load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] + load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model # Set up parameter values load_balancer_id = 'testString' @@ -18001,7 +19241,7 @@ def test_create_load_balancer_listener_all_params(self): policies = [load_balancer_listener_policy_prototype_model] # Invoke method - response = service.create_load_balancer_listener( + response = _service.create_load_balancer_listener( load_balancer_id, port, protocol, @@ -18010,7 +19250,8 @@ def test_create_load_balancer_listener_all_params(self): connection_limit=connection_limit, default_pool=default_pool, policies=policies, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -18020,13 +19261,11 @@ def test_create_load_balancer_listener_all_params(self): assert req_body['port'] == 443 assert req_body['protocol'] == 'http' assert req_body['accept_proxy_protocol'] == True - assert req_body[ - 'certificate_instance'] == certificate_instance_identity_model + assert req_body['certificate_instance'] == certificate_instance_identity_model assert req_body['connection_limit'] == 2000 assert req_body['default_pool'] == load_balancer_pool_identity_model - assert req_body['policies'] == [ - load_balancer_listener_policy_prototype_model - ] + assert req_body['policies'] == [load_balancer_listener_policy_prototype_model] + @responses.activate def test_create_load_balancer_listener_value_error(self): @@ -18034,8 +19273,7 @@ def test_create_load_balancer_listener_value_error(self): test_create_load_balancer_listener_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/listeners') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, @@ -18045,39 +19283,30 @@ def test_create_load_balancer_listener_value_error(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_prototype_model['type'] = 'header' - load_balancer_listener_policy_rule_prototype_model[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model load_balancer_listener_policy_prototype_model = {} load_balancer_listener_policy_prototype_model['action'] = 'forward' load_balancer_listener_policy_prototype_model['name'] = 'my-policy' load_balancer_listener_policy_prototype_model['priority'] = 5 - load_balancer_listener_policy_prototype_model['rules'] = [ - load_balancer_listener_policy_rule_prototype_model - ] - load_balancer_listener_policy_prototype_model[ - 'target'] = load_balancer_listener_policy_target_prototype_model + load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] + load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model # Set up parameter values load_balancer_id = 'testString' @@ -18096,12 +19325,10 @@ def test_create_load_balancer_listener_value_error(self): "protocol": protocol, } 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() - } + 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_load_balancer_listener(**req_copy) + _service.create_load_balancer_listener(**req_copy) + class TestDeleteLoadBalancerListener(): @@ -18124,32 +19351,37 @@ def test_delete_load_balancer_listener_all_params(self): delete_load_balancer_listener() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' id = 'testString' # Invoke method - response = service.delete_load_balancer_listener(load_balancer_id, - id, - headers={}) + response = _service.delete_load_balancer_listener( + load_balancer_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_listener_value_error(self): """ test_delete_load_balancer_listener_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -18161,12 +19393,10 @@ def test_delete_load_balancer_listener_value_error(self): "id": 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() - } + 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_load_balancer_listener(**req_copy) + _service.delete_load_balancer_listener(**req_copy) + class TestGetLoadBalancerListener(): @@ -18189,8 +19419,7 @@ def test_get_load_balancer_listener_all_params(self): get_load_balancer_listener() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, @@ -18203,22 +19432,24 @@ def test_get_load_balancer_listener_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_listener(load_balancer_id, - id, - headers={}) + response = _service.get_load_balancer_listener( + load_balancer_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_listener_value_error(self): """ test_get_load_balancer_listener_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, @@ -18236,12 +19467,10 @@ def test_get_load_balancer_listener_value_error(self): "id": 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() - } + 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_load_balancer_listener(**req_copy) + _service.get_load_balancer_listener(**req_copy) + class TestUpdateLoadBalancerListener(): @@ -18264,8 +19493,7 @@ def test_update_load_balancer_listener_all_params(self): update_load_balancer_listener() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, @@ -18275,22 +19503,18 @@ def test_update_load_balancer_listener_all_params(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model = {} load_balancer_listener_patch_model['accept_proxy_protocol'] = True - load_balancer_listener_patch_model[ - 'certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model['connection_limit'] = 2000 - load_balancer_listener_patch_model[ - 'default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model load_balancer_listener_patch_model['port'] = 443 load_balancer_listener_patch_model['protocol'] = 'http' @@ -18300,8 +19524,12 @@ def test_update_load_balancer_listener_all_params(self): load_balancer_listener_patch = load_balancer_listener_patch_model # Invoke method - response = service.update_load_balancer_listener( - load_balancer_id, id, load_balancer_listener_patch, headers={}) + response = _service.update_load_balancer_listener( + load_balancer_id, + id, + load_balancer_listener_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -18310,14 +19538,14 @@ def test_update_load_balancer_listener_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_listener_patch + @responses.activate def test_update_load_balancer_listener_value_error(self): """ test_update_load_balancer_listener_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/listeners/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString') mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, @@ -18327,22 +19555,18 @@ def test_update_load_balancer_listener_value_error(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model = {} load_balancer_listener_patch_model['accept_proxy_protocol'] = True - load_balancer_listener_patch_model[ - 'certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model['connection_limit'] = 2000 - load_balancer_listener_patch_model[ - 'default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model load_balancer_listener_patch_model['port'] = 443 load_balancer_listener_patch_model['protocol'] = 'http' @@ -18358,12 +19582,10 @@ def test_update_load_balancer_listener_value_error(self): "load_balancer_listener_patch": load_balancer_listener_patch, } 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() - } + 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_load_balancer_listener(**req_copy) + _service.update_load_balancer_listener(**req_copy) + class TestListLoadBalancerListenerPolicies(): @@ -18386,9 +19608,7 @@ def test_list_load_balancer_listener_policies_all_params(self): list_load_balancer_listener_policies() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies') mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' responses.add(responses.GET, url, @@ -18401,22 +19621,24 @@ def test_list_load_balancer_listener_policies_all_params(self): listener_id = 'testString' # Invoke method - response = service.list_load_balancer_listener_policies( - load_balancer_id, listener_id, headers={}) + response = _service.list_load_balancer_listener_policies( + load_balancer_id, + listener_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_listener_policies_value_error(self): """ test_list_load_balancer_listener_policies_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies') mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' responses.add(responses.GET, url, @@ -18434,12 +19656,10 @@ def test_list_load_balancer_listener_policies_value_error(self): "listener_id": listener_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() - } + 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_load_balancer_listener_policies(**req_copy) + _service.list_load_balancer_listener_policies(**req_copy) + class TestCreateLoadBalancerListenerPolicy(): @@ -18462,9 +19682,7 @@ def test_create_load_balancer_listener_policy_all_params(self): create_load_balancer_listener_policy() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.POST, url, @@ -18474,18 +19692,14 @@ def test_create_load_balancer_listener_policy_all_params(self): # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_prototype_model['type'] = 'header' - load_balancer_listener_policy_rule_prototype_model[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Set up parameter values load_balancer_id = 'testString' @@ -18497,7 +19711,7 @@ def test_create_load_balancer_listener_policy_all_params(self): target = load_balancer_listener_policy_target_prototype_model # Invoke method - response = service.create_load_balancer_listener_policy( + response = _service.create_load_balancer_listener_policy( load_balancer_id, listener_id, action, @@ -18505,7 +19719,8 @@ def test_create_load_balancer_listener_policy_all_params(self): name=name, rules=rules, target=target, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -18515,11 +19730,9 @@ def test_create_load_balancer_listener_policy_all_params(self): assert req_body['action'] == 'forward' assert req_body['priority'] == 5 assert req_body['name'] == 'my-policy' - assert req_body['rules'] == [ - load_balancer_listener_policy_rule_prototype_model - ] - assert req_body[ - 'target'] == load_balancer_listener_policy_target_prototype_model + assert req_body['rules'] == [load_balancer_listener_policy_rule_prototype_model] + assert req_body['target'] == load_balancer_listener_policy_target_prototype_model + @responses.activate def test_create_load_balancer_listener_policy_value_error(self): @@ -18527,9 +19740,7 @@ def test_create_load_balancer_listener_policy_value_error(self): test_create_load_balancer_listener_policy_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies') + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.POST, url, @@ -18539,18 +19750,14 @@ def test_create_load_balancer_listener_policy_value_error(self): # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_prototype_model['type'] = 'header' - load_balancer_listener_policy_rule_prototype_model[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Set up parameter values load_balancer_id = 'testString' @@ -18569,12 +19776,10 @@ def test_create_load_balancer_listener_policy_value_error(self): "priority": priority, } 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() - } + 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_load_balancer_listener_policy(**req_copy) + _service.create_load_balancer_listener_policy(**req_copy) + class TestDeleteLoadBalancerListenerPolicy(): @@ -18597,11 +19802,10 @@ def test_delete_load_balancer_listener_policy_all_params(self): delete_load_balancer_listener_policy() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -18609,24 +19813,28 @@ def test_delete_load_balancer_listener_policy_all_params(self): id = 'testString' # Invoke method - response = service.delete_load_balancer_listener_policy( - load_balancer_id, listener_id, id, headers={}) + response = _service.delete_load_balancer_listener_policy( + load_balancer_id, + listener_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_listener_policy_value_error(self): """ test_delete_load_balancer_listener_policy_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -18640,12 +19848,10 @@ def test_delete_load_balancer_listener_policy_value_error(self): "id": 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() - } + 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_load_balancer_listener_policy(**req_copy) + _service.delete_load_balancer_listener_policy(**req_copy) + class TestGetLoadBalancerListenerPolicy(): @@ -18668,10 +19874,7 @@ def test_get_load_balancer_listener_policy_all_params(self): get_load_balancer_listener_policy() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.GET, url, @@ -18685,25 +19888,25 @@ def test_get_load_balancer_listener_policy_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_listener_policy(load_balancer_id, - listener_id, - id, - headers={}) + response = _service.get_load_balancer_listener_policy( + load_balancer_id, + listener_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_listener_policy_value_error(self): """ test_get_load_balancer_listener_policy_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.GET, url, @@ -18723,12 +19926,10 @@ def test_get_load_balancer_listener_policy_value_error(self): "id": 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() - } + 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_load_balancer_listener_policy(**req_copy) + _service.get_load_balancer_listener_policy(**req_copy) + class TestUpdateLoadBalancerListenerPolicy(): @@ -18751,10 +19952,7 @@ def test_update_load_balancer_listener_policy_all_params(self): update_load_balancer_listener_policy() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.PATCH, url, @@ -18764,15 +19962,13 @@ def test_update_load_balancer_listener_policy_all_params(self): # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_patch_model = {} - load_balancer_listener_policy_target_patch_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyPatch model load_balancer_listener_policy_patch_model = {} load_balancer_listener_policy_patch_model['name'] = 'my-policy' load_balancer_listener_policy_patch_model['priority'] = 5 - load_balancer_listener_policy_patch_model[ - 'target'] = load_balancer_listener_policy_target_patch_model + load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model # Set up parameter values load_balancer_id = 'testString' @@ -18781,12 +19977,13 @@ def test_update_load_balancer_listener_policy_all_params(self): load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model # Invoke method - response = service.update_load_balancer_listener_policy( + response = _service.update_load_balancer_listener_policy( load_balancer_id, listener_id, id, load_balancer_listener_policy_patch, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -18795,16 +19992,14 @@ def test_update_load_balancer_listener_policy_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_listener_policy_patch + @responses.activate def test_update_load_balancer_listener_policy_value_error(self): """ test_update_load_balancer_listener_policy_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString') mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add(responses.PATCH, url, @@ -18814,15 +20009,13 @@ def test_update_load_balancer_listener_policy_value_error(self): # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_patch_model = {} - load_balancer_listener_policy_target_patch_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a dict representation of a LoadBalancerListenerPolicyPatch model load_balancer_listener_policy_patch_model = {} load_balancer_listener_policy_patch_model['name'] = 'my-policy' load_balancer_listener_policy_patch_model['priority'] = 5 - load_balancer_listener_policy_patch_model[ - 'target'] = load_balancer_listener_policy_target_patch_model + load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model # Set up parameter values load_balancer_id = 'testString' @@ -18832,22 +20025,16 @@ def test_update_load_balancer_listener_policy_value_error(self): # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": - load_balancer_id, - "listener_id": - listener_id, - "id": - id, - "load_balancer_listener_policy_patch": - load_balancer_listener_policy_patch, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "id": id, + "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch, } 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() - } + 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_load_balancer_listener_policy(**req_copy) + _service.update_load_balancer_listener_policy(**req_copy) + class TestListLoadBalancerListenerPolicyRules(): @@ -18870,10 +20057,7 @@ def test_list_load_balancer_listener_policy_rules_all_params(self): list_load_balancer_listener_policy_rules() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules') mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}]}' responses.add(responses.GET, url, @@ -18887,23 +20071,25 @@ def test_list_load_balancer_listener_policy_rules_all_params(self): policy_id = 'testString' # Invoke method - response = service.list_load_balancer_listener_policy_rules( - load_balancer_id, listener_id, policy_id, headers={}) + response = _service.list_load_balancer_listener_policy_rules( + load_balancer_id, + listener_id, + policy_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_listener_policy_rules_value_error(self): """ test_list_load_balancer_listener_policy_rules_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules') mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}]}' responses.add(responses.GET, url, @@ -18923,12 +20109,10 @@ def test_list_load_balancer_listener_policy_rules_value_error(self): "policy_id": policy_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() - } + 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_load_balancer_listener_policy_rules(**req_copy) + _service.list_load_balancer_listener_policy_rules(**req_copy) + class TestCreateLoadBalancerListenerPolicyRule(): @@ -18951,10 +20135,7 @@ def test_create_load_balancer_listener_policy_rule_all_params(self): create_load_balancer_listener_policy_rule() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.POST, url, @@ -18972,7 +20153,7 @@ def test_create_load_balancer_listener_policy_rule_all_params(self): field = 'MY-APP-HEADER' # Invoke method - response = service.create_load_balancer_listener_policy_rule( + response = _service.create_load_balancer_listener_policy_rule( load_balancer_id, listener_id, policy_id, @@ -18980,7 +20161,8 @@ def test_create_load_balancer_listener_policy_rule_all_params(self): type, value, field=field, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -18992,16 +20174,14 @@ def test_create_load_balancer_listener_policy_rule_all_params(self): assert req_body['value'] == 'testString' assert req_body['field'] == 'MY-APP-HEADER' + @responses.activate def test_create_load_balancer_listener_policy_rule_value_error(self): """ test_create_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.POST, url, @@ -19028,12 +20208,10 @@ def test_create_load_balancer_listener_policy_rule_value_error(self): "value": value, } 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() - } + 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_load_balancer_listener_policy_rule(**req_copy) + _service.create_load_balancer_listener_policy_rule(**req_copy) + class TestDeleteLoadBalancerListenerPolicyRule(): @@ -19056,11 +20234,10 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self): delete_load_balancer_listener_policy_rule() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -19069,24 +20246,29 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self): id = 'testString' # Invoke method - response = service.delete_load_balancer_listener_policy_rule( - load_balancer_id, listener_id, policy_id, id, headers={}) + response = _service.delete_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_listener_policy_rule_value_error(self): """ test_delete_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -19102,12 +20284,10 @@ def test_delete_load_balancer_listener_policy_rule_value_error(self): "id": 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() - } + 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_load_balancer_listener_policy_rule(**req_copy) + _service.delete_load_balancer_listener_policy_rule(**req_copy) + class TestGetLoadBalancerListenerPolicyRule(): @@ -19130,10 +20310,7 @@ def test_get_load_balancer_listener_policy_rule_all_params(self): get_load_balancer_listener_policy_rule() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.GET, url, @@ -19148,23 +20325,26 @@ def test_get_load_balancer_listener_policy_rule_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_listener_policy_rule( - load_balancer_id, listener_id, policy_id, id, headers={}) + response = _service.get_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_listener_policy_rule_value_error(self): """ test_get_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.GET, url, @@ -19186,12 +20366,10 @@ def test_get_load_balancer_listener_policy_rule_value_error(self): "id": 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() - } + 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_load_balancer_listener_policy_rule(**req_copy) + _service.get_load_balancer_listener_policy_rule(**req_copy) + class TestUpdateLoadBalancerListenerPolicyRule(): @@ -19214,10 +20392,7 @@ def test_update_load_balancer_listener_policy_rule_all_params(self): update_load_balancer_listener_policy_rule() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.PATCH, url, @@ -19228,8 +20403,7 @@ def test_update_load_balancer_listener_policy_rule_all_params(self): # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model load_balancer_listener_policy_rule_patch_model = {} load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' - load_balancer_listener_policy_rule_patch_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_patch_model['type'] = 'header' load_balancer_listener_policy_rule_patch_model['value'] = 'testString' @@ -19241,13 +20415,14 @@ def test_update_load_balancer_listener_policy_rule_all_params(self): load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model # Invoke method - response = service.update_load_balancer_listener_policy_rule( + response = _service.update_load_balancer_listener_policy_rule( load_balancer_id, listener_id, policy_id, id, load_balancer_listener_policy_rule_patch, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -19256,16 +20431,14 @@ def test_update_load_balancer_listener_policy_rule_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_listener_policy_rule_patch + @responses.activate def test_update_load_balancer_listener_policy_rule_value_error(self): """ test_update_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/listeners/testString/policies/testString/rules/testString' - ) + url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString') mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "header", "value": "value"}' responses.add(responses.PATCH, url, @@ -19276,8 +20449,7 @@ def test_update_load_balancer_listener_policy_rule_value_error(self): # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model load_balancer_listener_policy_rule_patch_model = {} load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' - load_balancer_listener_policy_rule_patch_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_patch_model['type'] = 'header' load_balancer_listener_policy_rule_patch_model['value'] = 'testString' @@ -19290,24 +20462,17 @@ def test_update_load_balancer_listener_policy_rule_value_error(self): # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": - load_balancer_id, - "listener_id": - listener_id, - "policy_id": - policy_id, - "id": - id, - "load_balancer_listener_policy_rule_patch": - load_balancer_listener_policy_rule_patch, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_id, + "id": id, + "load_balancer_listener_policy_rule_patch": load_balancer_listener_policy_rule_patch, } 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() - } + 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_load_balancer_listener_policy_rule(**req_copy) + _service.update_load_balancer_listener_policy_rule(**req_copy) + class TestListLoadBalancerPools(): @@ -19330,7 +20495,7 @@ def test_list_load_balancer_pools_all_params(self): list_load_balancer_pools() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString/pools') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools') mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}]}' responses.add(responses.GET, url, @@ -19342,20 +20507,23 @@ def test_list_load_balancer_pools_all_params(self): load_balancer_id = 'testString' # Invoke method - response = service.list_load_balancer_pools(load_balancer_id, - headers={}) + response = _service.list_load_balancer_pools( + load_balancer_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_pools_value_error(self): """ test_list_load_balancer_pools_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString/pools') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools') mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}]}' responses.add(responses.GET, url, @@ -19371,12 +20539,10 @@ def test_list_load_balancer_pools_value_error(self): "load_balancer_id": load_balancer_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() - } + 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_load_balancer_pools(**req_copy) + _service.list_load_balancer_pools(**req_copy) + class TestCreateLoadBalancerPool(): @@ -19399,7 +20565,7 @@ def test_create_load_balancer_pool_all_params(self): create_load_balancer_pool() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString/pools') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.POST, url, @@ -19418,20 +20584,17 @@ def test_create_load_balancer_pool_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model['type'] = 'source_ip' # Set up parameter values load_balancer_id = 'testString' @@ -19444,7 +20607,7 @@ def test_create_load_balancer_pool_all_params(self): session_persistence = load_balancer_pool_session_persistence_prototype_model # Invoke method - response = service.create_load_balancer_pool( + response = _service.create_load_balancer_pool( load_balancer_id, algorithm, health_monitor, @@ -19453,7 +20616,8 @@ def test_create_load_balancer_pool_all_params(self): name=name, proxy_protocol=proxy_protocol, session_persistence=session_persistence, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -19461,16 +20625,13 @@ def test_create_load_balancer_pool_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['algorithm'] == 'least_connections' - assert req_body[ - 'health_monitor'] == load_balancer_pool_health_monitor_prototype_model + assert req_body['health_monitor'] == load_balancer_pool_health_monitor_prototype_model assert req_body['protocol'] == 'http' - assert req_body['members'] == [ - load_balancer_pool_member_prototype_model - ] + assert req_body['members'] == [load_balancer_pool_member_prototype_model] assert req_body['name'] == 'my-load-balancer-pool' assert req_body['proxy_protocol'] == 'disabled' - assert req_body[ - 'session_persistence'] == load_balancer_pool_session_persistence_prototype_model + assert req_body['session_persistence'] == load_balancer_pool_session_persistence_prototype_model + @responses.activate def test_create_load_balancer_pool_value_error(self): @@ -19478,7 +20639,7 @@ def test_create_load_balancer_pool_value_error(self): test_create_load_balancer_pool_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/load_balancers/testString/pools') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.POST, url, @@ -19497,20 +20658,17 @@ def test_create_load_balancer_pool_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model['type'] = 'source_ip' # Set up parameter values load_balancer_id = 'testString' @@ -19530,12 +20688,10 @@ def test_create_load_balancer_pool_value_error(self): "protocol": protocol, } 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() - } + 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_load_balancer_pool(**req_copy) + _service.create_load_balancer_pool(**req_copy) + class TestDeleteLoadBalancerPool(): @@ -19558,32 +20714,37 @@ def test_delete_load_balancer_pool_all_params(self): delete_load_balancer_pool() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' id = 'testString' # Invoke method - response = service.delete_load_balancer_pool(load_balancer_id, - id, - headers={}) + response = _service.delete_load_balancer_pool( + load_balancer_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_pool_value_error(self): """ test_delete_load_balancer_pool_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -19595,12 +20756,10 @@ def test_delete_load_balancer_pool_value_error(self): "id": 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() - } + 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_load_balancer_pool(**req_copy) + _service.delete_load_balancer_pool(**req_copy) + class TestGetLoadBalancerPool(): @@ -19623,8 +20782,7 @@ def test_get_load_balancer_pool_all_params(self): get_load_balancer_pool() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.GET, url, @@ -19637,22 +20795,24 @@ def test_get_load_balancer_pool_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_pool(load_balancer_id, - id, - headers={}) + response = _service.get_load_balancer_pool( + load_balancer_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_pool_value_error(self): """ test_get_load_balancer_pool_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.GET, url, @@ -19670,12 +20830,10 @@ def test_get_load_balancer_pool_value_error(self): "id": 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() - } + 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_load_balancer_pool(**req_copy) + _service.get_load_balancer_pool(**req_copy) + class TestUpdateLoadBalancerPool(): @@ -19698,8 +20856,7 @@ def test_update_load_balancer_pool_all_params(self): update_load_balancer_pool() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.PATCH, url, @@ -19723,13 +20880,11 @@ def test_update_load_balancer_pool_all_params(self): # Construct a dict representation of a LoadBalancerPoolPatch model load_balancer_pool_patch_model = {} load_balancer_pool_patch_model['algorithm'] = 'least_connections' - load_balancer_pool_patch_model[ - 'health_monitor'] = load_balancer_pool_health_monitor_patch_model + load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' load_balancer_pool_patch_model['protocol'] = 'http' load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' - load_balancer_pool_patch_model[ - 'session_persistence'] = load_balancer_pool_session_persistence_patch_model + load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model # Set up parameter values load_balancer_id = 'testString' @@ -19737,10 +20892,12 @@ def test_update_load_balancer_pool_all_params(self): load_balancer_pool_patch = load_balancer_pool_patch_model # Invoke method - response = service.update_load_balancer_pool(load_balancer_id, - id, - load_balancer_pool_patch, - headers={}) + response = _service.update_load_balancer_pool( + load_balancer_id, + id, + load_balancer_pool_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -19749,14 +20906,14 @@ def test_update_load_balancer_pool_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_pool_patch + @responses.activate def test_update_load_balancer_pool_value_error(self): """ test_update_load_balancer_pool_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/load_balancers/testString/pools/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString') mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"type": "source_ip"}}' responses.add(responses.PATCH, url, @@ -19780,13 +20937,11 @@ def test_update_load_balancer_pool_value_error(self): # Construct a dict representation of a LoadBalancerPoolPatch model load_balancer_pool_patch_model = {} load_balancer_pool_patch_model['algorithm'] = 'least_connections' - load_balancer_pool_patch_model[ - 'health_monitor'] = load_balancer_pool_health_monitor_patch_model + load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' load_balancer_pool_patch_model['protocol'] = 'http' load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' - load_balancer_pool_patch_model[ - 'session_persistence'] = load_balancer_pool_session_persistence_patch_model + load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model # Set up parameter values load_balancer_id = 'testString' @@ -19800,12 +20955,10 @@ def test_update_load_balancer_pool_value_error(self): "load_balancer_pool_patch": load_balancer_pool_patch, } 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() - } + 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_load_balancer_pool(**req_copy) + _service.update_load_balancer_pool(**req_copy) + class TestListLoadBalancerPoolMembers(): @@ -19828,8 +20981,7 @@ def test_list_load_balancer_pool_members_all_params(self): list_load_balancer_pool_members() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' responses.add(responses.GET, url, @@ -19842,22 +20994,24 @@ def test_list_load_balancer_pool_members_all_params(self): pool_id = 'testString' # Invoke method - response = service.list_load_balancer_pool_members(load_balancer_id, - pool_id, - headers={}) + response = _service.list_load_balancer_pool_members( + load_balancer_id, + pool_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_load_balancer_pool_members_value_error(self): """ test_list_load_balancer_pool_members_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' responses.add(responses.GET, url, @@ -19875,12 +21029,10 @@ def test_list_load_balancer_pool_members_value_error(self): "pool_id": pool_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() - } + 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_load_balancer_pool_members(**req_copy) + _service.list_load_balancer_pool_members(**req_copy) + class TestCreateLoadBalancerPoolMember(): @@ -19903,8 +21055,7 @@ def test_create_load_balancer_pool_member_all_params(self): create_load_balancer_pool_member() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.POST, url, @@ -19914,8 +21065,7 @@ def test_create_load_balancer_pool_member_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Set up parameter values load_balancer_id = 'testString' @@ -19925,12 +21075,14 @@ def test_create_load_balancer_pool_member_all_params(self): weight = 50 # Invoke method - response = service.create_load_balancer_pool_member(load_balancer_id, - pool_id, - port, - target, - weight=weight, - headers={}) + response = _service.create_load_balancer_pool_member( + load_balancer_id, + pool_id, + port, + target, + weight=weight, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -19938,18 +21090,17 @@ def test_create_load_balancer_pool_member_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['port'] == 80 - assert req_body[ - 'target'] == load_balancer_pool_member_target_prototype_model + assert req_body['target'] == load_balancer_pool_member_target_prototype_model assert req_body['weight'] == 50 + @responses.activate def test_create_load_balancer_pool_member_value_error(self): """ test_create_load_balancer_pool_member_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.POST, url, @@ -19959,8 +21110,7 @@ def test_create_load_balancer_pool_member_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Set up parameter values load_balancer_id = 'testString' @@ -19977,12 +21127,10 @@ def test_create_load_balancer_pool_member_value_error(self): "target": target, } 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() - } + 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_load_balancer_pool_member(**req_copy) + _service.create_load_balancer_pool_member(**req_copy) + class TestReplaceLoadBalancerPoolMembers(): @@ -20005,8 +21153,7 @@ def test_replace_load_balancer_pool_members_all_params(self): replace_load_balancer_pool_members() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' responses.add(responses.PUT, url, @@ -20016,14 +21163,12 @@ def test_replace_load_balancer_pool_members_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Set up parameter values @@ -20032,19 +21177,20 @@ def test_replace_load_balancer_pool_members_all_params(self): members = [load_balancer_pool_member_prototype_model] # Invoke method - response = service.replace_load_balancer_pool_members(load_balancer_id, - pool_id, - members, - headers={}) + response = _service.replace_load_balancer_pool_members( + load_balancer_id, + pool_id, + members, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 202 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['members'] == [ - load_balancer_pool_member_prototype_model - ] + assert req_body['members'] == [load_balancer_pool_member_prototype_model] + @responses.activate def test_replace_load_balancer_pool_members_value_error(self): @@ -20052,8 +21198,7 @@ def test_replace_load_balancer_pool_members_value_error(self): test_replace_load_balancer_pool_members_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/load_balancers/testString/pools/testString/members') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members') mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' responses.add(responses.PUT, url, @@ -20063,14 +21208,12 @@ def test_replace_load_balancer_pool_members_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 # Set up parameter values @@ -20085,12 +21228,10 @@ def test_replace_load_balancer_pool_members_value_error(self): "members": members, } 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() - } + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - service.replace_load_balancer_pool_members(**req_copy) + _service.replace_load_balancer_pool_members(**req_copy) + class TestDeleteLoadBalancerPoolMember(): @@ -20113,10 +21254,10 @@ def test_delete_load_balancer_pool_member_all_params(self): delete_load_balancer_pool_member() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -20124,25 +21265,28 @@ def test_delete_load_balancer_pool_member_all_params(self): id = 'testString' # Invoke method - response = service.delete_load_balancer_pool_member(load_balancer_id, - pool_id, - id, - headers={}) + response = _service.delete_load_balancer_pool_member( + load_balancer_id, + pool_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_load_balancer_pool_member_value_error(self): """ test_delete_load_balancer_pool_member_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values load_balancer_id = 'testString' @@ -20156,12 +21300,10 @@ def test_delete_load_balancer_pool_member_value_error(self): "id": 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() - } + 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_load_balancer_pool_member(**req_copy) + _service.delete_load_balancer_pool_member(**req_copy) + class TestGetLoadBalancerPoolMember(): @@ -20184,9 +21326,7 @@ def test_get_load_balancer_pool_member_all_params(self): get_load_balancer_pool_member() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.GET, url, @@ -20200,24 +21340,25 @@ def test_get_load_balancer_pool_member_all_params(self): id = 'testString' # Invoke method - response = service.get_load_balancer_pool_member(load_balancer_id, - pool_id, - id, - headers={}) + response = _service.get_load_balancer_pool_member( + load_balancer_id, + pool_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_load_balancer_pool_member_value_error(self): """ test_get_load_balancer_pool_member_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.GET, url, @@ -20237,12 +21378,10 @@ def test_get_load_balancer_pool_member_value_error(self): "id": 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() - } + 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_load_balancer_pool_member(**req_copy) + _service.get_load_balancer_pool_member(**req_copy) + class TestUpdateLoadBalancerPoolMember(): @@ -20265,9 +21404,7 @@ def test_update_load_balancer_pool_member_all_params(self): update_load_balancer_pool_member() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.PATCH, url, @@ -20277,14 +21414,12 @@ def test_update_load_balancer_pool_member_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPatch model load_balancer_pool_member_patch_model = {} load_balancer_pool_member_patch_model['port'] = 80 - load_balancer_pool_member_patch_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_patch_model['weight'] = 50 # Set up parameter values @@ -20294,12 +21429,13 @@ def test_update_load_balancer_pool_member_all_params(self): load_balancer_pool_member_patch = load_balancer_pool_member_patch_model # Invoke method - response = service.update_load_balancer_pool_member( + response = _service.update_load_balancer_pool_member( load_balancer_id, pool_id, id, load_balancer_pool_member_patch, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -20308,15 +21444,14 @@ def test_update_load_balancer_pool_member_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == load_balancer_pool_member_patch + @responses.activate def test_update_load_balancer_pool_member_value_error(self): """ test_update_load_balancer_pool_member_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + - '/load_balancers/testString/pools/testString/members/testString') + url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' responses.add(responses.PATCH, url, @@ -20326,14 +21461,12 @@ def test_update_load_balancer_pool_member_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a LoadBalancerPoolMemberPatch model load_balancer_pool_member_patch_model = {} load_balancer_pool_member_patch_model['port'] = 80 - load_balancer_pool_member_patch_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_patch_model['weight'] = 50 # Set up parameter values @@ -20350,12 +21483,10 @@ def test_update_load_balancer_pool_member_value_error(self): "load_balancer_pool_member_patch": load_balancer_pool_member_patch, } 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() - } + 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_load_balancer_pool_member(**req_copy) + _service.update_load_balancer_pool_member(**req_copy) + # endregion @@ -20368,7 +21499,6 @@ def test_update_load_balancer_pool_member_value_error(self): ############################################################################## # region - class TestListEndpointGateways(): """ Test Class for list_endpoint_gateways @@ -20389,8 +21519,8 @@ def test_list_endpoint_gateways_all_params(self): list_endpoint_gateways() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20404,32 +21534,34 @@ def test_list_endpoint_gateways_all_params(self): resource_group_id = 'testString' # Invoke method - response = service.list_endpoint_gateways( + response = _service.list_endpoint_gateways( name=name, start=start, limit=limit, resource_group_id=resource_group_id, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'name={}'.format(name) in query_string assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string + @responses.activate def test_list_endpoint_gateways_required_params(self): """ test_list_endpoint_gateways_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20437,20 +21569,22 @@ def test_list_endpoint_gateways_required_params(self): status=200) # Invoke method - response = service.list_endpoint_gateways() + response = _service.list_endpoint_gateways() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_endpoint_gateways_value_error(self): """ test_list_endpoint_gateways_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = self.preprocess_url(_base_url + '/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20458,14 +21592,13 @@ def test_list_endpoint_gateways_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_endpoint_gateways(**req_copy) + _service.list_endpoint_gateways(**req_copy) + class TestCreateEndpointGateway(): @@ -20488,8 +21621,8 @@ def test_create_endpoint_gateway_all_params(self): create_endpoint_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20498,10 +21631,8 @@ def test_create_endpoint_gateway_all_params(self): # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model endpoint_gateway_target_prototype_model = {} - endpoint_gateway_target_prototype_model[ - 'resource_type'] = 'provider_infrastructure_service' - endpoint_gateway_target_prototype_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' + endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -20509,8 +21640,7 @@ def test_create_endpoint_gateway_all_params(self): # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model endpoint_gateway_reserved_ip_model = {} - endpoint_gateway_reserved_ip_model[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -20524,13 +21654,14 @@ def test_create_endpoint_gateway_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_endpoint_gateway( + response = _service.create_endpoint_gateway( target, vpc, ips=ips, name=name, resource_group=resource_group, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -20543,14 +21674,15 @@ def test_create_endpoint_gateway_all_params(self): assert req_body['name'] == 'testString' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_endpoint_gateway_value_error(self): """ test_create_endpoint_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20559,10 +21691,8 @@ def test_create_endpoint_gateway_value_error(self): # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model endpoint_gateway_target_prototype_model = {} - endpoint_gateway_target_prototype_model[ - 'resource_type'] = 'provider_infrastructure_service' - endpoint_gateway_target_prototype_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' + endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -20570,8 +21700,7 @@ def test_create_endpoint_gateway_value_error(self): # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model endpoint_gateway_reserved_ip_model = {} - endpoint_gateway_reserved_ip_model[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -20590,12 +21719,10 @@ def test_create_endpoint_gateway_value_error(self): "vpc": vpc, } 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() - } + 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_endpoint_gateway(**req_copy) + _service.create_endpoint_gateway(**req_copy) + class TestListEndpointGatewayIps(): @@ -20618,8 +21745,7 @@ def test_list_endpoint_gateway_ips_all_params(self): list_endpoint_gateway_ips() """ # Set up mock - url = self.preprocess_url(base_url + - '/endpoint_gateways/testString/ips') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -20634,30 +21760,32 @@ def test_list_endpoint_gateway_ips_all_params(self): sort = 'name' # Invoke method - response = service.list_endpoint_gateway_ips(endpoint_gateway_id, - start=start, - limit=limit, - sort=sort, - headers={}) + response = _service.list_endpoint_gateway_ips( + endpoint_gateway_id, + start=start, + limit=limit, + sort=sort, + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'sort={}'.format(sort) in query_string + @responses.activate def test_list_endpoint_gateway_ips_required_params(self): """ test_list_endpoint_gateway_ips_required_params() """ # Set up mock - url = self.preprocess_url(base_url + - '/endpoint_gateways/testString/ips') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -20669,21 +21797,23 @@ def test_list_endpoint_gateway_ips_required_params(self): endpoint_gateway_id = 'testString' # Invoke method - response = service.list_endpoint_gateway_ips(endpoint_gateway_id, - headers={}) + response = _service.list_endpoint_gateway_ips( + endpoint_gateway_id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_endpoint_gateway_ips_value_error(self): """ test_list_endpoint_gateway_ips_value_error() """ # Set up mock - url = self.preprocess_url(base_url + - '/endpoint_gateways/testString/ips') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -20699,12 +21829,10 @@ def test_list_endpoint_gateway_ips_value_error(self): "endpoint_gateway_id": endpoint_gateway_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() - } + 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_endpoint_gateway_ips(**req_copy) + _service.list_endpoint_gateway_ips(**req_copy) + class TestRemoveEndpointGatewayIp(): @@ -20727,32 +21855,37 @@ def test_remove_endpoint_gateway_ip_all_params(self): remove_endpoint_gateway_ip() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values endpoint_gateway_id = 'testString' id = 'testString' # Invoke method - response = service.remove_endpoint_gateway_ip(endpoint_gateway_id, - id, - headers={}) + response = _service.remove_endpoint_gateway_ip( + endpoint_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_remove_endpoint_gateway_ip_value_error(self): """ test_remove_endpoint_gateway_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values endpoint_gateway_id = 'testString' @@ -20764,12 +21897,10 @@ def test_remove_endpoint_gateway_ip_value_error(self): "id": 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() - } + 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_endpoint_gateway_ip(**req_copy) + _service.remove_endpoint_gateway_ip(**req_copy) + class TestGetEndpointGatewayIp(): @@ -20792,8 +21923,7 @@ def test_get_endpoint_gateway_ip_all_params(self): get_endpoint_gateway_ip() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, @@ -20806,22 +21936,24 @@ def test_get_endpoint_gateway_ip_all_params(self): id = 'testString' # Invoke method - response = service.get_endpoint_gateway_ip(endpoint_gateway_id, - id, - headers={}) + response = _service.get_endpoint_gateway_ip( + endpoint_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_endpoint_gateway_ip_value_error(self): """ test_get_endpoint_gateway_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, @@ -20839,12 +21971,10 @@ def test_get_endpoint_gateway_ip_value_error(self): "id": 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() - } + 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_endpoint_gateway_ip(**req_copy) + _service.get_endpoint_gateway_ip(**req_copy) + class TestAddEndpointGatewayIp(): @@ -20867,8 +21997,7 @@ def test_add_endpoint_gateway_ip_all_params(self): add_endpoint_gateway_ip() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PUT, url, @@ -20881,22 +22010,24 @@ def test_add_endpoint_gateway_ip_all_params(self): id = 'testString' # Invoke method - response = service.add_endpoint_gateway_ip(endpoint_gateway_id, - id, - headers={}) + response = _service.add_endpoint_gateway_ip( + endpoint_gateway_id, + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 + @responses.activate def test_add_endpoint_gateway_ip_value_error(self): """ test_add_endpoint_gateway_ip_value_error() """ # Set up mock - url = self.preprocess_url( - base_url + '/endpoint_gateways/testString/ips/testString') + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString') mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PUT, url, @@ -20914,12 +22045,10 @@ def test_add_endpoint_gateway_ip_value_error(self): "id": 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() - } + 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_endpoint_gateway_ip(**req_copy) + _service.add_endpoint_gateway_ip(**req_copy) + class TestDeleteEndpointGateway(): @@ -20942,27 +22071,35 @@ def test_delete_endpoint_gateway_all_params(self): delete_endpoint_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_endpoint_gateway(id, headers={}) + response = _service.delete_endpoint_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_endpoint_gateway_value_error(self): """ test_delete_endpoint_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -20972,12 +22109,10 @@ def test_delete_endpoint_gateway_value_error(self): "id": 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() - } + 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_endpoint_gateway(**req_copy) + _service.delete_endpoint_gateway(**req_copy) + class TestGetEndpointGateway(): @@ -21000,8 +22135,8 @@ def test_get_endpoint_gateway_all_params(self): get_endpoint_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -21012,20 +22147,24 @@ def test_get_endpoint_gateway_all_params(self): id = 'testString' # Invoke method - response = service.get_endpoint_gateway(id, headers={}) + response = _service.get_endpoint_gateway( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_endpoint_gateway_value_error(self): """ test_get_endpoint_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -21040,12 +22179,10 @@ def test_get_endpoint_gateway_value_error(self): "id": 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() - } + 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_endpoint_gateway(**req_copy) + _service.get_endpoint_gateway(**req_copy) + class TestUpdateEndpointGateway(): @@ -21068,8 +22205,8 @@ def test_update_endpoint_gateway_all_params(self): update_endpoint_gateway() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -21085,9 +22222,11 @@ def test_update_endpoint_gateway_all_params(self): endpoint_gateway_patch = endpoint_gateway_patch_model # Invoke method - response = service.update_endpoint_gateway(id, - endpoint_gateway_patch, - headers={}) + response = _service.update_endpoint_gateway( + id, + endpoint_gateway_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -21096,14 +22235,15 @@ def test_update_endpoint_gateway_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == endpoint_gateway_patch + @responses.activate def test_update_endpoint_gateway_value_error(self): """ test_update_endpoint_gateway_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/endpoint_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + url = self.preprocess_url(_base_url + '/endpoint_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -21124,12 +22264,10 @@ def test_update_endpoint_gateway_value_error(self): "endpoint_gateway_patch": endpoint_gateway_patch, } 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() - } + 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_endpoint_gateway(**req_copy) + _service.update_endpoint_gateway(**req_copy) + # endregion @@ -21142,7 +22280,6 @@ def test_update_endpoint_gateway_value_error(self): ############################################################################## # region - class TestListFlowLogCollectors(): """ Test Class for list_flow_log_collectors @@ -21163,7 +22300,7 @@ def test_list_flow_log_collectors_all_params(self): list_flow_log_collectors() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors') + url = self.preprocess_url(_base_url + '/flow_log_collectors') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -21183,7 +22320,7 @@ def test_list_flow_log_collectors_all_params(self): target_resource_type = 'vpc' # Invoke method - response = service.list_flow_log_collectors( + response = _service.list_flow_log_collectors( start=start, limit=limit, resource_group_id=resource_group_id, @@ -21193,13 +22330,14 @@ def test_list_flow_log_collectors_all_params(self): vpc_name=vpc_name, target_id=target_id, target_resource_type=target_resource_type, - headers={}) + 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 = responses.calls[0].request.url.split('?',1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string @@ -21209,8 +22347,8 @@ def test_list_flow_log_collectors_all_params(self): assert 'vpc.crn={}'.format(vpc_crn) in query_string assert 'vpc.name={}'.format(vpc_name) in query_string assert 'target.id={}'.format(target_id) in query_string - assert 'target.resource_type={}'.format( - target_resource_type) in query_string + assert 'target.resource_type={}'.format(target_resource_type) in query_string + @responses.activate def test_list_flow_log_collectors_required_params(self): @@ -21218,7 +22356,7 @@ def test_list_flow_log_collectors_required_params(self): test_list_flow_log_collectors_required_params() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors') + url = self.preprocess_url(_base_url + '/flow_log_collectors') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -21227,19 +22365,21 @@ def test_list_flow_log_collectors_required_params(self): status=200) # Invoke method - response = service.list_flow_log_collectors() + response = _service.list_flow_log_collectors() + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_list_flow_log_collectors_value_error(self): """ test_list_flow_log_collectors_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors') + url = self.preprocess_url(_base_url + '/flow_log_collectors') mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, @@ -21248,14 +22388,13 @@ def test_list_flow_log_collectors_value_error(self): status=200) # Pass in all but one required param and check for a ValueError - req_param_dict = {} + req_param_dict = { + } 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() - } + 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_flow_log_collectors(**req_copy) + _service.list_flow_log_collectors(**req_copy) + class TestCreateFlowLogCollector(): @@ -21278,7 +22417,7 @@ def test_create_flow_log_collector_all_params(self): create_flow_log_collector() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors') + url = self.preprocess_url(_base_url + '/flow_log_collectors') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -21288,13 +22427,11 @@ def test_create_flow_log_collector_all_params(self): # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model cloud_object_storage_bucket_identity_model = {} - cloud_object_storage_bucket_identity_model[ - 'name'] = 'bucket-27200-lwx4cfvcue' + cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_model = {} - flow_log_collector_target_prototype_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -21308,33 +22445,34 @@ def test_create_flow_log_collector_all_params(self): resource_group = resource_group_identity_model # Invoke method - response = service.create_flow_log_collector( + response = _service.create_flow_log_collector( storage_bucket, target, active=active, name=name, resource_group=resource_group, - headers={}) + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body[ - 'storage_bucket'] == cloud_object_storage_bucket_identity_model + assert req_body['storage_bucket'] == cloud_object_storage_bucket_identity_model assert req_body['target'] == flow_log_collector_target_prototype_model assert req_body['active'] == False assert req_body['name'] == 'my-flow-log-collector' assert req_body['resource_group'] == resource_group_identity_model + @responses.activate def test_create_flow_log_collector_value_error(self): """ test_create_flow_log_collector_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors') + url = self.preprocess_url(_base_url + '/flow_log_collectors') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, @@ -21344,13 +22482,11 @@ def test_create_flow_log_collector_value_error(self): # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model cloud_object_storage_bucket_identity_model = {} - cloud_object_storage_bucket_identity_model[ - 'name'] = 'bucket-27200-lwx4cfvcue' + cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_model = {} - flow_log_collector_target_prototype_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -21369,12 +22505,10 @@ def test_create_flow_log_collector_value_error(self): "target": target, } 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() - } + 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_flow_log_collector(**req_copy) + _service.create_flow_log_collector(**req_copy) + class TestDeleteFlowLogCollector(): @@ -21397,27 +22531,35 @@ def test_delete_flow_log_collector_all_params(self): delete_flow_log_collector() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' # Invoke method - response = service.delete_flow_log_collector(id, headers={}) + response = _service.delete_flow_log_collector( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 + @responses.activate def test_delete_flow_log_collector_value_error(self): """ test_delete_flow_log_collector_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') - responses.add(responses.DELETE, url, status=204) + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') + responses.add(responses.DELETE, + url, + status=204) # Set up parameter values id = 'testString' @@ -21427,12 +22569,10 @@ def test_delete_flow_log_collector_value_error(self): "id": 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() - } + 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_flow_log_collector(**req_copy) + _service.delete_flow_log_collector(**req_copy) + class TestGetFlowLogCollector(): @@ -21455,7 +22595,7 @@ def test_get_flow_log_collector_all_params(self): get_flow_log_collector() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -21467,19 +22607,23 @@ def test_get_flow_log_collector_all_params(self): id = 'testString' # Invoke method - response = service.get_flow_log_collector(id, headers={}) + response = _service.get_flow_log_collector( + id, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + @responses.activate def test_get_flow_log_collector_value_error(self): """ test_get_flow_log_collector_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, @@ -21495,12 +22639,10 @@ def test_get_flow_log_collector_value_error(self): "id": 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() - } + 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_flow_log_collector(**req_copy) + _service.get_flow_log_collector(**req_copy) + class TestUpdateFlowLogCollector(): @@ -21523,7 +22665,7 @@ def test_update_flow_log_collector_all_params(self): update_flow_log_collector() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -21541,9 +22683,11 @@ def test_update_flow_log_collector_all_params(self): flow_log_collector_patch = flow_log_collector_patch_model # Invoke method - response = service.update_flow_log_collector(id, - flow_log_collector_patch, - headers={}) + response = _service.update_flow_log_collector( + id, + flow_log_collector_patch, + headers={} + ) # Check for correct operation assert len(responses.calls) == 1 @@ -21552,13 +22696,14 @@ def test_update_flow_log_collector_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body == flow_log_collector_patch + @responses.activate def test_update_flow_log_collector_value_error(self): """ test_update_flow_log_collector_value_error() """ # Set up mock - url = self.preprocess_url(base_url + '/flow_log_collectors/testString') + url = self.preprocess_url(_base_url + '/flow_log_collectors/testString') mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, @@ -21581,12 +22726,10 @@ def test_update_flow_log_collector_value_error(self): "flow_log_collector_patch": flow_log_collector_patch, } 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() - } + 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_flow_log_collector(**req_copy) + _service.update_flow_log_collector(**req_copy) + # endregion @@ -21611,31 +22754,27 @@ def test_address_prefix_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a AddressPrefix model address_prefix_model_json = {} address_prefix_model_json['cidr'] = '192.168.3.0/24' - address_prefix_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' + address_prefix_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) address_prefix_model_json['has_subnets'] = True - address_prefix_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + address_prefix_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model_json['is_default'] = False address_prefix_model_json['name'] = 'my-address-prefix-2' address_prefix_model_json['zone'] = zone_reference_model # Construct a model instance of AddressPrefix by calling from_dict on the json representation - address_prefix_model = AddressPrefix.from_dict( - address_prefix_model_json) + address_prefix_model = AddressPrefix.from_dict(address_prefix_model_json) assert address_prefix_model != False # Construct a model instance of AddressPrefix by calling from_dict on the json representation - address_prefix_model_dict = AddressPrefix.from_dict( - address_prefix_model_json).__dict__ + address_prefix_model_dict = AddressPrefix.from_dict(address_prefix_model_json).__dict__ address_prefix_model2 = AddressPrefix(**address_prefix_model_dict) # Verify the model instances are equivalent @@ -21645,7 +22784,6 @@ def test_address_prefix_serialization(self): address_prefix_model_json2 = address_prefix_model.to_dict() assert address_prefix_model_json2 == address_prefix_model_json - class TestAddressPrefixCollection(): """ Test Class for AddressPrefixCollection @@ -21658,63 +22796,49 @@ def test_address_prefix_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - address_prefix_model = {} # AddressPrefix + address_prefix_model = {} # AddressPrefix address_prefix_model['cidr'] = '192.168.3.0/24' - address_prefix_model['created_at'] = '2020-01-28T18:40:40.123456Z' + address_prefix_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) address_prefix_model['has_subnets'] = True - address_prefix_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model['is_default'] = False address_prefix_model['name'] = 'my-address-prefix-2' address_prefix_model['zone'] = zone_reference_model - address_prefix_collection_first_model = { - } # AddressPrefixCollectionFirst - address_prefix_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' + address_prefix_collection_first_model = {} # AddressPrefixCollectionFirst + address_prefix_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' - address_prefix_collection_next_model = {} # AddressPrefixCollectionNext - address_prefix_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + address_prefix_collection_next_model = {} # AddressPrefixCollectionNext + address_prefix_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a AddressPrefixCollection model address_prefix_collection_model_json = {} - address_prefix_collection_model_json['address_prefixes'] = [ - address_prefix_model - ] - address_prefix_collection_model_json[ - 'first'] = address_prefix_collection_first_model + address_prefix_collection_model_json['address_prefixes'] = [address_prefix_model] + address_prefix_collection_model_json['first'] = address_prefix_collection_first_model address_prefix_collection_model_json['limit'] = 20 - address_prefix_collection_model_json[ - 'next'] = address_prefix_collection_next_model + address_prefix_collection_model_json['next'] = address_prefix_collection_next_model address_prefix_collection_model_json['total_count'] = 132 # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation - address_prefix_collection_model = AddressPrefixCollection.from_dict( - address_prefix_collection_model_json) + address_prefix_collection_model = AddressPrefixCollection.from_dict(address_prefix_collection_model_json) assert address_prefix_collection_model != False # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation - address_prefix_collection_model_dict = AddressPrefixCollection.from_dict( - address_prefix_collection_model_json).__dict__ - address_prefix_collection_model2 = AddressPrefixCollection( - **address_prefix_collection_model_dict) + address_prefix_collection_model_dict = AddressPrefixCollection.from_dict(address_prefix_collection_model_json).__dict__ + address_prefix_collection_model2 = AddressPrefixCollection(**address_prefix_collection_model_dict) # Verify the model instances are equivalent assert address_prefix_collection_model == address_prefix_collection_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict( - ) + address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict() assert address_prefix_collection_model_json2 == address_prefix_collection_model_json - class TestAddressPrefixCollectionFirst(): """ Test Class for AddressPrefixCollectionFirst @@ -21727,29 +22851,23 @@ def test_address_prefix_collection_first_serialization(self): # Construct a json representation of a AddressPrefixCollectionFirst model address_prefix_collection_first_model_json = {} - address_prefix_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' + address_prefix_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation - address_prefix_collection_first_model = AddressPrefixCollectionFirst.from_dict( - address_prefix_collection_first_model_json) + address_prefix_collection_first_model = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json) assert address_prefix_collection_first_model != False # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation - address_prefix_collection_first_model_dict = AddressPrefixCollectionFirst.from_dict( - address_prefix_collection_first_model_json).__dict__ - address_prefix_collection_first_model2 = AddressPrefixCollectionFirst( - **address_prefix_collection_first_model_dict) + address_prefix_collection_first_model_dict = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json).__dict__ + address_prefix_collection_first_model2 = AddressPrefixCollectionFirst(**address_prefix_collection_first_model_dict) # Verify the model instances are equivalent assert address_prefix_collection_first_model == address_prefix_collection_first_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_first_model_json2 = address_prefix_collection_first_model.to_dict( - ) + address_prefix_collection_first_model_json2 = address_prefix_collection_first_model.to_dict() assert address_prefix_collection_first_model_json2 == address_prefix_collection_first_model_json - class TestAddressPrefixCollectionNext(): """ Test Class for AddressPrefixCollectionNext @@ -21762,29 +22880,23 @@ def test_address_prefix_collection_next_serialization(self): # Construct a json representation of a AddressPrefixCollectionNext model address_prefix_collection_next_model_json = {} - address_prefix_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + address_prefix_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation - address_prefix_collection_next_model = AddressPrefixCollectionNext.from_dict( - address_prefix_collection_next_model_json) + address_prefix_collection_next_model = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json) assert address_prefix_collection_next_model != False # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation - address_prefix_collection_next_model_dict = AddressPrefixCollectionNext.from_dict( - address_prefix_collection_next_model_json).__dict__ - address_prefix_collection_next_model2 = AddressPrefixCollectionNext( - **address_prefix_collection_next_model_dict) + address_prefix_collection_next_model_dict = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json).__dict__ + address_prefix_collection_next_model2 = AddressPrefixCollectionNext(**address_prefix_collection_next_model_dict) # Verify the model instances are equivalent assert address_prefix_collection_next_model == address_prefix_collection_next_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_next_model_json2 = address_prefix_collection_next_model.to_dict( - ) + address_prefix_collection_next_model_json2 = address_prefix_collection_next_model.to_dict() assert address_prefix_collection_next_model_json2 == address_prefix_collection_next_model_json - class TestAddressPrefixPatch(): """ Test Class for AddressPrefixPatch @@ -21801,15 +22913,12 @@ def test_address_prefix_patch_serialization(self): address_prefix_patch_model_json['name'] = 'my-address-prefix-2' # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation - address_prefix_patch_model = AddressPrefixPatch.from_dict( - address_prefix_patch_model_json) + address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json) assert address_prefix_patch_model != False # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation - address_prefix_patch_model_dict = AddressPrefixPatch.from_dict( - address_prefix_patch_model_json).__dict__ - address_prefix_patch_model2 = AddressPrefixPatch( - **address_prefix_patch_model_dict) + address_prefix_patch_model_dict = AddressPrefixPatch.from_dict(address_prefix_patch_model_json).__dict__ + address_prefix_patch_model2 = AddressPrefixPatch(**address_prefix_patch_model_dict) # Verify the model instances are equivalent assert address_prefix_patch_model == address_prefix_patch_model2 @@ -21818,7 +22927,6 @@ def test_address_prefix_patch_serialization(self): address_prefix_patch_model_json2 = address_prefix_patch_model.to_dict() assert address_prefix_patch_model_json2 == address_prefix_patch_model_json - class TestCertificateInstanceReference(): """ Test Class for CertificateInstanceReference @@ -21831,29 +22939,23 @@ def test_certificate_instance_reference_serialization(self): # Construct a json representation of a CertificateInstanceReference model certificate_instance_reference_model_json = {} - certificate_instance_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation - certificate_instance_reference_model = CertificateInstanceReference.from_dict( - certificate_instance_reference_model_json) + certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json) assert certificate_instance_reference_model != False # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation - certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict( - certificate_instance_reference_model_json).__dict__ - certificate_instance_reference_model2 = CertificateInstanceReference( - **certificate_instance_reference_model_dict) + certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json).__dict__ + certificate_instance_reference_model2 = CertificateInstanceReference(**certificate_instance_reference_model_dict) # Verify the model instances are equivalent assert certificate_instance_reference_model == certificate_instance_reference_model2 # Convert model instance back to dict and verify no loss of data - certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict( - ) + certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict() assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json - class TestCloudObjectStorageBucketReference(): """ Test Class for CloudObjectStorageBucketReference @@ -21866,29 +22968,23 @@ def test_cloud_object_storage_bucket_reference_serialization(self): # Construct a json representation of a CloudObjectStorageBucketReference model cloud_object_storage_bucket_reference_model_json = {} - cloud_object_storage_bucket_reference_model_json[ - 'name'] = 'bucket-27200-lwx4cfvcue' + cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue' # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation - cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict( - cloud_object_storage_bucket_reference_model_json) + cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json) assert cloud_object_storage_bucket_reference_model != False # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation - cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict( - cloud_object_storage_bucket_reference_model_json).__dict__ - cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference( - **cloud_object_storage_bucket_reference_model_dict) + cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json).__dict__ + cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference(**cloud_object_storage_bucket_reference_model_dict) # Verify the model instances are equivalent assert cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2 # Convert model instance back to dict and verify no loss of data - cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict( - ) + cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict() assert cloud_object_storage_bucket_reference_model_json2 == cloud_object_storage_bucket_reference_model_json - class TestDedicatedHost(): """ Test Class for DedicatedHost @@ -21901,103 +22997,103 @@ def test_dedicated_host_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vcpu_model = {} # VCPU + vcpu_model = {} # VCPU vcpu_model['architecture'] = 'amd64' vcpu_model['count'] = 4 - dedicated_host_group_reference_deleted_model = { - } # DedicatedHostGroupReferenceDeleted - dedicated_host_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - dedicated_host_group_reference_model = {} # DedicatedHostGroupReference - dedicated_host_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model[ - 'deleted'] = dedicated_host_group_reference_deleted_model - dedicated_host_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted + instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_disk_reference_model = {} # InstanceDiskReference + instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['name'] = 'my-instance-disk' + instance_disk_reference_model['resource_type'] = 'instance_disk' + + dedicated_host_disk_model = {} # DedicatedHostDisk + dedicated_host_disk_model['available'] = 38 + dedicated_host_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] + dedicated_host_disk_model['interface_type'] = 'nvme' + dedicated_host_disk_model['lifecycle_state'] = 'stable' + dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' + dedicated_host_disk_model['provisionable'] = True + dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' + dedicated_host_disk_model['size'] = 38 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk'] + + dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted + dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + dedicated_host_group_reference_model = {} # DedicatedHostGroupReference + dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model + dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model['name'] = 'my-host-group' - dedicated_host_group_reference_model[ - 'resource_type'] = 'dedicated_host_group' + dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - dedicated_host_profile_reference_model = { - } # DedicatedHostProfileReference - dedicated_host_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference + dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a DedicatedHost model dedicated_host_model_json = {} dedicated_host_model_json['available_memory'] = 128 dedicated_host_model_json['available_vcpu'] = vcpu_model - dedicated_host_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - dedicated_host_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_model_json[ - 'group'] = dedicated_host_group_reference_model - dedicated_host_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_model_json['disks'] = [dedicated_host_disk_model] + dedicated_host_model_json['group'] = dedicated_host_group_reference_model + dedicated_host_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_model_json['instance_placement_enabled'] = True dedicated_host_model_json['instances'] = [instance_reference_model] dedicated_host_model_json['lifecycle_state'] = 'stable' dedicated_host_model_json['memory'] = 128 dedicated_host_model_json['name'] = 'my-host' - dedicated_host_model_json[ - 'profile'] = dedicated_host_profile_reference_model + dedicated_host_model_json['profile'] = dedicated_host_profile_reference_model dedicated_host_model_json['provisionable'] = True - dedicated_host_model_json[ - 'resource_group'] = resource_group_reference_model + dedicated_host_model_json['resource_group'] = resource_group_reference_model dedicated_host_model_json['resource_type'] = 'dedicated_host' dedicated_host_model_json['socket_count'] = 4 dedicated_host_model_json['state'] = 'available' - dedicated_host_model_json['supported_instance_profiles'] = [ - instance_profile_reference_model - ] + dedicated_host_model_json['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_model_json['vcpu'] = vcpu_model dedicated_host_model_json['zone'] = zone_reference_model # Construct a model instance of DedicatedHost by calling from_dict on the json representation - dedicated_host_model = DedicatedHost.from_dict( - dedicated_host_model_json) + dedicated_host_model = DedicatedHost.from_dict(dedicated_host_model_json) assert dedicated_host_model != False # Construct a model instance of DedicatedHost by calling from_dict on the json representation - dedicated_host_model_dict = DedicatedHost.from_dict( - dedicated_host_model_json).__dict__ + dedicated_host_model_dict = DedicatedHost.from_dict(dedicated_host_model_json).__dict__ dedicated_host_model2 = DedicatedHost(**dedicated_host_model_dict) # Verify the model instances are equivalent @@ -22007,7 +23103,6 @@ def test_dedicated_host_serialization(self): dedicated_host_model_json2 = dedicated_host_model.to_dict() assert dedicated_host_model_json2 == dedicated_host_model_json - class TestDedicatedHostCollection(): """ Test Class for DedicatedHostCollection @@ -22020,73 +23115,80 @@ def test_dedicated_host_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vcpu_model = {} # VCPU + vcpu_model = {} # VCPU vcpu_model['architecture'] = 'amd64' vcpu_model['count'] = 4 - dedicated_host_group_reference_deleted_model = { - } # DedicatedHostGroupReferenceDeleted - dedicated_host_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - dedicated_host_group_reference_model = {} # DedicatedHostGroupReference - dedicated_host_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model[ - 'deleted'] = dedicated_host_group_reference_deleted_model - dedicated_host_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted + instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_disk_reference_model = {} # InstanceDiskReference + instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['name'] = 'my-instance-disk' + instance_disk_reference_model['resource_type'] = 'instance_disk' + + dedicated_host_disk_model = {} # DedicatedHostDisk + dedicated_host_disk_model['available'] = 38 + dedicated_host_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] + dedicated_host_disk_model['interface_type'] = 'nvme' + dedicated_host_disk_model['lifecycle_state'] = 'stable' + dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' + dedicated_host_disk_model['provisionable'] = True + dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' + dedicated_host_disk_model['size'] = 38 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk'] + + dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted + dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + dedicated_host_group_reference_model = {} # DedicatedHostGroupReference + dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model + dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model['name'] = 'my-host-group' - dedicated_host_group_reference_model[ - 'resource_type'] = 'dedicated_host_group' + dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - dedicated_host_profile_reference_model = { - } # DedicatedHostProfileReference - dedicated_host_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference + dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - dedicated_host_model = {} # DedicatedHost + dedicated_host_model = {} # DedicatedHost dedicated_host_model['available_memory'] = 128 dedicated_host_model['available_vcpu'] = vcpu_model - dedicated_host_model['created_at'] = '2020-01-28T18:40:40.123456Z' - dedicated_host_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_model['disks'] = [dedicated_host_disk_model] dedicated_host_model['group'] = dedicated_host_group_reference_model - dedicated_host_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_model['instance_placement_enabled'] = True dedicated_host_model['instances'] = [instance_reference_model] @@ -22099,53 +23201,39 @@ def test_dedicated_host_collection_serialization(self): dedicated_host_model['resource_type'] = 'dedicated_host' dedicated_host_model['socket_count'] = 4 dedicated_host_model['state'] = 'available' - dedicated_host_model['supported_instance_profiles'] = [ - instance_profile_reference_model - ] + dedicated_host_model['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_model['vcpu'] = vcpu_model dedicated_host_model['zone'] = zone_reference_model - dedicated_host_collection_first_model = { - } # DedicatedHostCollectionFirst - dedicated_host_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' + dedicated_host_collection_first_model = {} # DedicatedHostCollectionFirst + dedicated_host_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' - dedicated_host_collection_next_model = {} # DedicatedHostCollectionNext - dedicated_host_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + dedicated_host_collection_next_model = {} # DedicatedHostCollectionNext + dedicated_host_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a DedicatedHostCollection model dedicated_host_collection_model_json = {} - dedicated_host_collection_model_json['dedicated_hosts'] = [ - dedicated_host_model - ] - dedicated_host_collection_model_json[ - 'first'] = dedicated_host_collection_first_model + dedicated_host_collection_model_json['dedicated_hosts'] = [dedicated_host_model] + dedicated_host_collection_model_json['first'] = dedicated_host_collection_first_model dedicated_host_collection_model_json['limit'] = 20 - dedicated_host_collection_model_json[ - 'next'] = dedicated_host_collection_next_model + dedicated_host_collection_model_json['next'] = dedicated_host_collection_next_model dedicated_host_collection_model_json['total_count'] = 132 # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation - dedicated_host_collection_model = DedicatedHostCollection.from_dict( - dedicated_host_collection_model_json) + dedicated_host_collection_model = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json) assert dedicated_host_collection_model != False # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation - dedicated_host_collection_model_dict = DedicatedHostCollection.from_dict( - dedicated_host_collection_model_json).__dict__ - dedicated_host_collection_model2 = DedicatedHostCollection( - **dedicated_host_collection_model_dict) + dedicated_host_collection_model_dict = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json).__dict__ + dedicated_host_collection_model2 = DedicatedHostCollection(**dedicated_host_collection_model_dict) # Verify the model instances are equivalent assert dedicated_host_collection_model == dedicated_host_collection_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_collection_model_json2 = dedicated_host_collection_model.to_dict( - ) + dedicated_host_collection_model_json2 = dedicated_host_collection_model.to_dict() assert dedicated_host_collection_model_json2 == dedicated_host_collection_model_json - class TestDedicatedHostCollectionFirst(): """ Test Class for DedicatedHostCollectionFirst @@ -22158,29 +23246,23 @@ def test_dedicated_host_collection_first_serialization(self): # Construct a json representation of a DedicatedHostCollectionFirst model dedicated_host_collection_first_model_json = {} - dedicated_host_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' + dedicated_host_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation - dedicated_host_collection_first_model = DedicatedHostCollectionFirst.from_dict( - dedicated_host_collection_first_model_json) + dedicated_host_collection_first_model = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json) assert dedicated_host_collection_first_model != False # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation - dedicated_host_collection_first_model_dict = DedicatedHostCollectionFirst.from_dict( - dedicated_host_collection_first_model_json).__dict__ - dedicated_host_collection_first_model2 = DedicatedHostCollectionFirst( - **dedicated_host_collection_first_model_dict) + dedicated_host_collection_first_model_dict = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json).__dict__ + dedicated_host_collection_first_model2 = DedicatedHostCollectionFirst(**dedicated_host_collection_first_model_dict) # Verify the model instances are equivalent assert dedicated_host_collection_first_model == dedicated_host_collection_first_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_collection_first_model_json2 = dedicated_host_collection_first_model.to_dict( - ) + dedicated_host_collection_first_model_json2 = dedicated_host_collection_first_model.to_dict() assert dedicated_host_collection_first_model_json2 == dedicated_host_collection_first_model_json - class TestDedicatedHostCollectionNext(): """ Test Class for DedicatedHostCollectionNext @@ -22193,28 +23275,158 @@ def test_dedicated_host_collection_next_serialization(self): # Construct a json representation of a DedicatedHostCollectionNext model dedicated_host_collection_next_model_json = {} - dedicated_host_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + dedicated_host_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation - dedicated_host_collection_next_model = DedicatedHostCollectionNext.from_dict( - dedicated_host_collection_next_model_json) + dedicated_host_collection_next_model = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json) assert dedicated_host_collection_next_model != False # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation - dedicated_host_collection_next_model_dict = DedicatedHostCollectionNext.from_dict( - dedicated_host_collection_next_model_json).__dict__ - dedicated_host_collection_next_model2 = DedicatedHostCollectionNext( - **dedicated_host_collection_next_model_dict) + dedicated_host_collection_next_model_dict = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json).__dict__ + dedicated_host_collection_next_model2 = DedicatedHostCollectionNext(**dedicated_host_collection_next_model_dict) # Verify the model instances are equivalent assert dedicated_host_collection_next_model == dedicated_host_collection_next_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_collection_next_model_json2 = dedicated_host_collection_next_model.to_dict( - ) + dedicated_host_collection_next_model_json2 = dedicated_host_collection_next_model.to_dict() assert dedicated_host_collection_next_model_json2 == dedicated_host_collection_next_model_json +class TestDedicatedHostDisk(): + """ + Test Class for DedicatedHostDisk + """ + + def test_dedicated_host_disk_serialization(self): + """ + Test serialization/deserialization for DedicatedHostDisk + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted + instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_disk_reference_model = {} # InstanceDiskReference + instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['name'] = 'my-instance-disk' + instance_disk_reference_model['resource_type'] = 'instance_disk' + + # Construct a json representation of a DedicatedHostDisk model + dedicated_host_disk_model_json = {} + dedicated_host_disk_model_json['available'] = 38 + dedicated_host_disk_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model_json['instance_disks'] = [instance_disk_reference_model] + dedicated_host_disk_model_json['interface_type'] = 'nvme' + dedicated_host_disk_model_json['lifecycle_state'] = 'stable' + dedicated_host_disk_model_json['name'] = 'my-dedicated-host-disk' + dedicated_host_disk_model_json['provisionable'] = True + dedicated_host_disk_model_json['resource_type'] = 'dedicated_host_disk' + dedicated_host_disk_model_json['size'] = 38 + dedicated_host_disk_model_json['supported_instance_interface_types'] = ['virtio_blk'] + + # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation + dedicated_host_disk_model = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json) + assert dedicated_host_disk_model != False + + # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation + dedicated_host_disk_model_dict = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json).__dict__ + dedicated_host_disk_model2 = DedicatedHostDisk(**dedicated_host_disk_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_disk_model == dedicated_host_disk_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_disk_model_json2 = dedicated_host_disk_model.to_dict() + assert dedicated_host_disk_model_json2 == dedicated_host_disk_model_json + +class TestDedicatedHostDiskCollection(): + """ + Test Class for DedicatedHostDiskCollection + """ + + def test_dedicated_host_disk_collection_serialization(self): + """ + Test serialization/deserialization for DedicatedHostDiskCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted + instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_disk_reference_model = {} # InstanceDiskReference + instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['name'] = 'my-instance-disk' + instance_disk_reference_model['resource_type'] = 'instance_disk' + + dedicated_host_disk_model = {} # DedicatedHostDisk + dedicated_host_disk_model['available'] = 38 + dedicated_host_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] + dedicated_host_disk_model['interface_type'] = 'nvme' + dedicated_host_disk_model['lifecycle_state'] = 'stable' + dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' + dedicated_host_disk_model['provisionable'] = True + dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' + dedicated_host_disk_model['size'] = 38 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk'] + + # Construct a json representation of a DedicatedHostDiskCollection model + dedicated_host_disk_collection_model_json = {} + dedicated_host_disk_collection_model_json['disks'] = [dedicated_host_disk_model] + + # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation + dedicated_host_disk_collection_model = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json) + assert dedicated_host_disk_collection_model != False + + # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation + dedicated_host_disk_collection_model_dict = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json).__dict__ + dedicated_host_disk_collection_model2 = DedicatedHostDiskCollection(**dedicated_host_disk_collection_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_disk_collection_model == dedicated_host_disk_collection_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_disk_collection_model_json2 = dedicated_host_disk_collection_model.to_dict() + assert dedicated_host_disk_collection_model_json2 == dedicated_host_disk_collection_model_json + +class TestDedicatedHostDiskPatch(): + """ + Test Class for DedicatedHostDiskPatch + """ + + def test_dedicated_host_disk_patch_serialization(self): + """ + Test serialization/deserialization for DedicatedHostDiskPatch + """ + + # Construct a json representation of a DedicatedHostDiskPatch model + dedicated_host_disk_patch_model_json = {} + dedicated_host_disk_patch_model_json['name'] = 'my-disk-updated' + + # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation + dedicated_host_disk_patch_model = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json) + assert dedicated_host_disk_patch_model != False + + # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation + dedicated_host_disk_patch_model_dict = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json).__dict__ + dedicated_host_disk_patch_model2 = DedicatedHostDiskPatch(**dedicated_host_disk_patch_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_disk_patch_model == dedicated_host_disk_patch_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_disk_patch_model_json2 = dedicated_host_disk_patch_model.to_dict() + assert dedicated_host_disk_patch_model_json2 == dedicated_host_disk_patch_model_json class TestDedicatedHostGroup(): """ @@ -22228,75 +23440,52 @@ def test_dedicated_host_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_reference_deleted_model = { - } # DedicatedHostReferenceDeleted - dedicated_host_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - dedicated_host_reference_model = {} # DedicatedHostReference - dedicated_host_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model[ - 'deleted'] = dedicated_host_reference_deleted_model - dedicated_host_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted + dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + dedicated_host_reference_model = {} # DedicatedHostReference + dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model + dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['name'] = 'my-host' dedicated_host_reference_model['resource_type'] = 'dedicated_host' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a DedicatedHostGroup model dedicated_host_group_model_json = {} dedicated_host_group_model_json['class'] = 'mx2' - dedicated_host_group_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - dedicated_host_group_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model_json['dedicated_hosts'] = [ - dedicated_host_reference_model - ] + dedicated_host_group_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['dedicated_hosts'] = [dedicated_host_reference_model] dedicated_host_group_model_json['family'] = 'balanced' - dedicated_host_group_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model_json[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_model_json['name'] = 'my-host-group' - dedicated_host_group_model_json[ - 'resource_group'] = resource_group_reference_model - dedicated_host_group_model_json[ - 'resource_type'] = 'dedicated_host_group' - dedicated_host_group_model_json['supported_instance_profiles'] = [ - instance_profile_reference_model - ] + dedicated_host_group_model_json['resource_group'] = resource_group_reference_model + dedicated_host_group_model_json['resource_type'] = 'dedicated_host_group' + dedicated_host_group_model_json['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_group_model_json['zone'] = zone_reference_model # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation - dedicated_host_group_model = DedicatedHostGroup.from_dict( - dedicated_host_group_model_json) + dedicated_host_group_model = DedicatedHostGroup.from_dict(dedicated_host_group_model_json) assert dedicated_host_group_model != False # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation - dedicated_host_group_model_dict = DedicatedHostGroup.from_dict( - dedicated_host_group_model_json).__dict__ - dedicated_host_group_model2 = DedicatedHostGroup( - **dedicated_host_group_model_dict) + dedicated_host_group_model_dict = DedicatedHostGroup.from_dict(dedicated_host_group_model_json).__dict__ + dedicated_host_group_model2 = DedicatedHostGroup(**dedicated_host_group_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_model == dedicated_host_group_model2 @@ -22305,7 +23494,6 @@ def test_dedicated_host_group_serialization(self): dedicated_host_group_model_json2 = dedicated_host_group_model.to_dict() assert dedicated_host_group_model_json2 == dedicated_host_group_model_json - class TestDedicatedHostGroupCollection(): """ Test Class for DedicatedHostGroupCollection @@ -22318,104 +23506,73 @@ def test_dedicated_host_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_group_collection_first_model = { - } # DedicatedHostGroupCollectionFirst - dedicated_host_group_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' - - dedicated_host_reference_deleted_model = { - } # DedicatedHostReferenceDeleted - dedicated_host_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - dedicated_host_reference_model = {} # DedicatedHostReference - dedicated_host_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model[ - 'deleted'] = dedicated_host_reference_deleted_model - dedicated_host_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_group_collection_first_model = {} # DedicatedHostGroupCollectionFirst + dedicated_host_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' + + dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted + dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + dedicated_host_reference_model = {} # DedicatedHostReference + dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model + dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['name'] = 'my-host' dedicated_host_reference_model['resource_type'] = 'dedicated_host' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - dedicated_host_group_model = {} # DedicatedHostGroup + dedicated_host_group_model = {} # DedicatedHostGroup dedicated_host_group_model['class'] = 'mx2' - dedicated_host_group_model['created_at'] = '2020-01-28T18:40:40.123456Z' - dedicated_host_group_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model['dedicated_hosts'] = [ - dedicated_host_reference_model - ] + dedicated_host_group_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + dedicated_host_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['dedicated_hosts'] = [dedicated_host_reference_model] dedicated_host_group_model['family'] = 'balanced' - dedicated_host_group_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_model['name'] = 'my-host-group' - dedicated_host_group_model[ - 'resource_group'] = resource_group_reference_model + dedicated_host_group_model['resource_group'] = resource_group_reference_model dedicated_host_group_model['resource_type'] = 'dedicated_host_group' - dedicated_host_group_model['supported_instance_profiles'] = [ - instance_profile_reference_model - ] + dedicated_host_group_model['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_group_model['zone'] = zone_reference_model - dedicated_host_group_collection_next_model = { - } # DedicatedHostGroupCollectionNext - dedicated_host_group_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + dedicated_host_group_collection_next_model = {} # DedicatedHostGroupCollectionNext + dedicated_host_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a DedicatedHostGroupCollection model dedicated_host_group_collection_model_json = {} - dedicated_host_group_collection_model_json[ - 'first'] = dedicated_host_group_collection_first_model - dedicated_host_group_collection_model_json['groups'] = [ - dedicated_host_group_model - ] + dedicated_host_group_collection_model_json['first'] = dedicated_host_group_collection_first_model + dedicated_host_group_collection_model_json['groups'] = [dedicated_host_group_model] dedicated_host_group_collection_model_json['limit'] = 20 - dedicated_host_group_collection_model_json[ - 'next'] = dedicated_host_group_collection_next_model + dedicated_host_group_collection_model_json['next'] = dedicated_host_group_collection_next_model dedicated_host_group_collection_model_json['total_count'] = 132 # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation - dedicated_host_group_collection_model = DedicatedHostGroupCollection.from_dict( - dedicated_host_group_collection_model_json) + dedicated_host_group_collection_model = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json) assert dedicated_host_group_collection_model != False # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation - dedicated_host_group_collection_model_dict = DedicatedHostGroupCollection.from_dict( - dedicated_host_group_collection_model_json).__dict__ - dedicated_host_group_collection_model2 = DedicatedHostGroupCollection( - **dedicated_host_group_collection_model_dict) + dedicated_host_group_collection_model_dict = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json).__dict__ + dedicated_host_group_collection_model2 = DedicatedHostGroupCollection(**dedicated_host_group_collection_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_collection_model == dedicated_host_group_collection_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_collection_model_json2 = dedicated_host_group_collection_model.to_dict( - ) + dedicated_host_group_collection_model_json2 = dedicated_host_group_collection_model.to_dict() assert dedicated_host_group_collection_model_json2 == dedicated_host_group_collection_model_json - class TestDedicatedHostGroupCollectionFirst(): """ Test Class for DedicatedHostGroupCollectionFirst @@ -22428,29 +23585,23 @@ def test_dedicated_host_group_collection_first_serialization(self): # Construct a json representation of a DedicatedHostGroupCollectionFirst model dedicated_host_group_collection_first_model_json = {} - dedicated_host_group_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' + dedicated_host_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation - dedicated_host_group_collection_first_model = DedicatedHostGroupCollectionFirst.from_dict( - dedicated_host_group_collection_first_model_json) + dedicated_host_group_collection_first_model = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json) assert dedicated_host_group_collection_first_model != False # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation - dedicated_host_group_collection_first_model_dict = DedicatedHostGroupCollectionFirst.from_dict( - dedicated_host_group_collection_first_model_json).__dict__ - dedicated_host_group_collection_first_model2 = DedicatedHostGroupCollectionFirst( - **dedicated_host_group_collection_first_model_dict) + dedicated_host_group_collection_first_model_dict = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json).__dict__ + dedicated_host_group_collection_first_model2 = DedicatedHostGroupCollectionFirst(**dedicated_host_group_collection_first_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_collection_first_model_json2 = dedicated_host_group_collection_first_model.to_dict( - ) + dedicated_host_group_collection_first_model_json2 = dedicated_host_group_collection_first_model.to_dict() assert dedicated_host_group_collection_first_model_json2 == dedicated_host_group_collection_first_model_json - class TestDedicatedHostGroupCollectionNext(): """ Test Class for DedicatedHostGroupCollectionNext @@ -22463,29 +23614,23 @@ def test_dedicated_host_group_collection_next_serialization(self): # Construct a json representation of a DedicatedHostGroupCollectionNext model dedicated_host_group_collection_next_model_json = {} - dedicated_host_group_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + dedicated_host_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation - dedicated_host_group_collection_next_model = DedicatedHostGroupCollectionNext.from_dict( - dedicated_host_group_collection_next_model_json) + dedicated_host_group_collection_next_model = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json) assert dedicated_host_group_collection_next_model != False # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation - dedicated_host_group_collection_next_model_dict = DedicatedHostGroupCollectionNext.from_dict( - dedicated_host_group_collection_next_model_json).__dict__ - dedicated_host_group_collection_next_model2 = DedicatedHostGroupCollectionNext( - **dedicated_host_group_collection_next_model_dict) + dedicated_host_group_collection_next_model_dict = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json).__dict__ + dedicated_host_group_collection_next_model2 = DedicatedHostGroupCollectionNext(**dedicated_host_group_collection_next_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_collection_next_model_json2 = dedicated_host_group_collection_next_model.to_dict( - ) + dedicated_host_group_collection_next_model_json2 = dedicated_host_group_collection_next_model.to_dict() assert dedicated_host_group_collection_next_model_json2 == dedicated_host_group_collection_next_model_json - class TestDedicatedHostGroupPatch(): """ Test Class for DedicatedHostGroupPatch @@ -22501,72 +23646,55 @@ def test_dedicated_host_group_patch_serialization(self): dedicated_host_group_patch_model_json['name'] = 'my-host-group' # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation - dedicated_host_group_patch_model = DedicatedHostGroupPatch.from_dict( - dedicated_host_group_patch_model_json) + dedicated_host_group_patch_model = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json) assert dedicated_host_group_patch_model != False # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation - dedicated_host_group_patch_model_dict = DedicatedHostGroupPatch.from_dict( - dedicated_host_group_patch_model_json).__dict__ - dedicated_host_group_patch_model2 = DedicatedHostGroupPatch( - **dedicated_host_group_patch_model_dict) + dedicated_host_group_patch_model_dict = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json).__dict__ + dedicated_host_group_patch_model2 = DedicatedHostGroupPatch(**dedicated_host_group_patch_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_patch_model == dedicated_host_group_patch_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_patch_model_json2 = dedicated_host_group_patch_model.to_dict( - ) + dedicated_host_group_patch_model_json2 = dedicated_host_group_patch_model.to_dict() assert dedicated_host_group_patch_model_json2 == dedicated_host_group_patch_model_json - class TestDedicatedHostGroupPrototypeDedicatedHostByZoneContext(): """ Test Class for DedicatedHostGroupPrototypeDedicatedHostByZoneContext """ - def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization( - self): + def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization(self): """ Test serialization/deserialization for DedicatedHostGroupPrototypeDedicatedHostByZoneContext """ # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Construct a json representation of a DedicatedHostGroupPrototypeDedicatedHostByZoneContext model dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json = {} - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json[ - 'name'] = 'my-host-group' - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json[ - 'resource_group'] = resource_group_identity_model + dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['name'] = 'my-host-group' + dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['resource_group'] = resource_group_identity_model # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation - dedicated_host_group_prototype_dedicated_host_by_zone_context_model = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict( - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json - ) + dedicated_host_group_prototype_dedicated_host_by_zone_context_model = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json) assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model != False # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict( - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json - ).__dict__ - dedicated_host_group_prototype_dedicated_host_by_zone_context_model2 = DedicatedHostGroupPrototypeDedicatedHostByZoneContext( - ** - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict - ) + dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json).__dict__ + dedicated_host_group_prototype_dedicated_host_by_zone_context_model2 = DedicatedHostGroupPrototypeDedicatedHostByZoneContext(**dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model == dedicated_host_group_prototype_dedicated_host_by_zone_context_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 = dedicated_host_group_prototype_dedicated_host_by_zone_context_model.to_dict( - ) + dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 = dedicated_host_group_prototype_dedicated_host_by_zone_context_model.to_dict() assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 == dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json - class TestDedicatedHostGroupReference(): """ Test Class for DedicatedHostGroupReference @@ -22579,45 +23707,33 @@ def test_dedicated_host_group_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_group_reference_deleted_model = { - } # DedicatedHostGroupReferenceDeleted - dedicated_host_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted + dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a DedicatedHostGroupReference model dedicated_host_group_reference_model_json = {} - dedicated_host_group_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model_json[ - 'deleted'] = dedicated_host_group_reference_deleted_model - dedicated_host_group_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model_json[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['deleted'] = dedicated_host_group_reference_deleted_model + dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model_json['name'] = 'my-host-group' - dedicated_host_group_reference_model_json[ - 'resource_type'] = 'dedicated_host_group' + dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group' # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation - dedicated_host_group_reference_model = DedicatedHostGroupReference.from_dict( - dedicated_host_group_reference_model_json) + dedicated_host_group_reference_model = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json) assert dedicated_host_group_reference_model != False # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation - dedicated_host_group_reference_model_dict = DedicatedHostGroupReference.from_dict( - dedicated_host_group_reference_model_json).__dict__ - dedicated_host_group_reference_model2 = DedicatedHostGroupReference( - **dedicated_host_group_reference_model_dict) + dedicated_host_group_reference_model_dict = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json).__dict__ + dedicated_host_group_reference_model2 = DedicatedHostGroupReference(**dedicated_host_group_reference_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_reference_model == dedicated_host_group_reference_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_reference_model_json2 = dedicated_host_group_reference_model.to_dict( - ) + dedicated_host_group_reference_model_json2 = dedicated_host_group_reference_model.to_dict() assert dedicated_host_group_reference_model_json2 == dedicated_host_group_reference_model_json - class TestDedicatedHostGroupReferenceDeleted(): """ Test Class for DedicatedHostGroupReferenceDeleted @@ -22630,29 +23746,23 @@ def test_dedicated_host_group_reference_deleted_serialization(self): # Construct a json representation of a DedicatedHostGroupReferenceDeleted model dedicated_host_group_reference_deleted_model_json = {} - dedicated_host_group_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + dedicated_host_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation - dedicated_host_group_reference_deleted_model = DedicatedHostGroupReferenceDeleted.from_dict( - dedicated_host_group_reference_deleted_model_json) + dedicated_host_group_reference_deleted_model = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json) assert dedicated_host_group_reference_deleted_model != False # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation - dedicated_host_group_reference_deleted_model_dict = DedicatedHostGroupReferenceDeleted.from_dict( - dedicated_host_group_reference_deleted_model_json).__dict__ - dedicated_host_group_reference_deleted_model2 = DedicatedHostGroupReferenceDeleted( - **dedicated_host_group_reference_deleted_model_dict) + dedicated_host_group_reference_deleted_model_dict = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json).__dict__ + dedicated_host_group_reference_deleted_model2 = DedicatedHostGroupReferenceDeleted(**dedicated_host_group_reference_deleted_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_reference_deleted_model == dedicated_host_group_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_reference_deleted_model_json2 = dedicated_host_group_reference_deleted_model.to_dict( - ) + dedicated_host_group_reference_deleted_model_json2 = dedicated_host_group_reference_deleted_model.to_dict() assert dedicated_host_group_reference_deleted_model_json2 == dedicated_host_group_reference_deleted_model_json - class TestDedicatedHostPatch(): """ Test Class for DedicatedHostPatch @@ -22669,15 +23779,12 @@ def test_dedicated_host_patch_serialization(self): dedicated_host_patch_model_json['name'] = 'my-host' # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation - dedicated_host_patch_model = DedicatedHostPatch.from_dict( - dedicated_host_patch_model_json) + dedicated_host_patch_model = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json) assert dedicated_host_patch_model != False # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation - dedicated_host_patch_model_dict = DedicatedHostPatch.from_dict( - dedicated_host_patch_model_json).__dict__ - dedicated_host_patch_model2 = DedicatedHostPatch( - **dedicated_host_patch_model_dict) + dedicated_host_patch_model_dict = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json).__dict__ + dedicated_host_patch_model2 = DedicatedHostPatch(**dedicated_host_patch_model_dict) # Verify the model instances are equivalent assert dedicated_host_patch_model == dedicated_host_patch_model2 @@ -22686,7 +23793,6 @@ def test_dedicated_host_patch_serialization(self): dedicated_host_patch_model_json2 = dedicated_host_patch_model.to_dict() assert dedicated_host_patch_model_json2 == dedicated_host_patch_model_json - class TestDedicatedHostProfile(): """ Test Class for DedicatedHostProfile @@ -22699,69 +23805,76 @@ def test_dedicated_host_profile_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_profile_memory_model = { - } # DedicatedHostProfileMemoryFixed + dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface + dedicated_host_profile_disk_interface_model['type'] = 'fixed' + dedicated_host_profile_disk_interface_model['value'] = 'nvme' + + dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity + dedicated_host_profile_disk_quantity_model['type'] = 'fixed' + dedicated_host_profile_disk_quantity_model['value'] = 4 + + dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize + dedicated_host_profile_disk_size_model['type'] = 'fixed' + dedicated_host_profile_disk_size_model['value'] = 3200 + + dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces + dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed' + dedicated_host_profile_disk_supported_interfaces_model['value'] = ['virtio_blk'] + + dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk + dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model + dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model + dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model + dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model + + dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed dedicated_host_profile_memory_model['type'] = 'fixed' dedicated_host_profile_memory_model['value'] = 16 - dedicated_host_profile_socket_model = { - } # DedicatedHostProfileSocketFixed + dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed dedicated_host_profile_socket_model['type'] = 'fixed' dedicated_host_profile_socket_model['value'] = 2 - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - dedicated_host_profile_vcpu_architecture_model = { - } # DedicatedHostProfileVCPUArchitecture + dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed' dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64' - dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed + dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed dedicated_host_profile_vcpu_model['type'] = 'fixed' dedicated_host_profile_vcpu_model['value'] = 16 # Construct a json representation of a DedicatedHostProfile model dedicated_host_profile_model_json = {} dedicated_host_profile_model_json['class'] = 'mx2' + dedicated_host_profile_model_json['disks'] = [dedicated_host_profile_disk_model] dedicated_host_profile_model_json['family'] = 'balanced' - dedicated_host_profile_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_profile_model_json[ - 'memory'] = dedicated_host_profile_memory_model + dedicated_host_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_model_json['memory'] = dedicated_host_profile_memory_model dedicated_host_profile_model_json['name'] = 'mx2-host-152x1216' - dedicated_host_profile_model_json[ - 'socket_count'] = dedicated_host_profile_socket_model - dedicated_host_profile_model_json['supported_instance_profiles'] = [ - instance_profile_reference_model - ] - dedicated_host_profile_model_json[ - 'vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model - dedicated_host_profile_model_json[ - 'vcpu_count'] = dedicated_host_profile_vcpu_model + dedicated_host_profile_model_json['socket_count'] = dedicated_host_profile_socket_model + dedicated_host_profile_model_json['supported_instance_profiles'] = [instance_profile_reference_model] + dedicated_host_profile_model_json['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model + dedicated_host_profile_model_json['vcpu_count'] = dedicated_host_profile_vcpu_model # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation - dedicated_host_profile_model = DedicatedHostProfile.from_dict( - dedicated_host_profile_model_json) + dedicated_host_profile_model = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json) assert dedicated_host_profile_model != False # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation - dedicated_host_profile_model_dict = DedicatedHostProfile.from_dict( - dedicated_host_profile_model_json).__dict__ - dedicated_host_profile_model2 = DedicatedHostProfile( - **dedicated_host_profile_model_dict) + dedicated_host_profile_model_dict = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json).__dict__ + dedicated_host_profile_model2 = DedicatedHostProfile(**dedicated_host_profile_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_model == dedicated_host_profile_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_model_json2 = dedicated_host_profile_model.to_dict( - ) + dedicated_host_profile_model_json2 = dedicated_host_profile_model.to_dict() assert dedicated_host_profile_model_json2 == dedicated_host_profile_model_json - class TestDedicatedHostProfileCollection(): """ Test Class for DedicatedHostProfileCollection @@ -22774,90 +23887,89 @@ def test_dedicated_host_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_profile_collection_first_model = { - } # DedicatedHostProfileCollectionFirst - dedicated_host_profile_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' + dedicated_host_profile_collection_first_model = {} # DedicatedHostProfileCollectionFirst + dedicated_host_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' + + dedicated_host_profile_collection_next_model = {} # DedicatedHostProfileCollectionNext + dedicated_host_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' - dedicated_host_profile_collection_next_model = { - } # DedicatedHostProfileCollectionNext - dedicated_host_profile_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' + dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface + dedicated_host_profile_disk_interface_model['type'] = 'fixed' + dedicated_host_profile_disk_interface_model['value'] = 'nvme' - dedicated_host_profile_memory_model = { - } # DedicatedHostProfileMemoryFixed + dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity + dedicated_host_profile_disk_quantity_model['type'] = 'fixed' + dedicated_host_profile_disk_quantity_model['value'] = 4 + + dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize + dedicated_host_profile_disk_size_model['type'] = 'fixed' + dedicated_host_profile_disk_size_model['value'] = 3200 + + dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces + dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed' + dedicated_host_profile_disk_supported_interfaces_model['value'] = ['virtio_blk'] + + dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk + dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model + dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model + dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model + dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model + + dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed dedicated_host_profile_memory_model['type'] = 'fixed' dedicated_host_profile_memory_model['value'] = 16 - dedicated_host_profile_socket_model = { - } # DedicatedHostProfileSocketFixed + dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed dedicated_host_profile_socket_model['type'] = 'fixed' dedicated_host_profile_socket_model['value'] = 2 - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - dedicated_host_profile_vcpu_architecture_model = { - } # DedicatedHostProfileVCPUArchitecture + dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed' dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64' - dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed + dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed dedicated_host_profile_vcpu_model['type'] = 'fixed' dedicated_host_profile_vcpu_model['value'] = 16 - dedicated_host_profile_model = {} # DedicatedHostProfile + dedicated_host_profile_model = {} # DedicatedHostProfile dedicated_host_profile_model['class'] = 'mx2' + dedicated_host_profile_model['disks'] = [dedicated_host_profile_disk_model] dedicated_host_profile_model['family'] = 'balanced' - dedicated_host_profile_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_profile_model[ - 'memory'] = dedicated_host_profile_memory_model + dedicated_host_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_model['memory'] = dedicated_host_profile_memory_model dedicated_host_profile_model['name'] = 'mx2-host-152x1216' - dedicated_host_profile_model[ - 'socket_count'] = dedicated_host_profile_socket_model - dedicated_host_profile_model['supported_instance_profiles'] = [ - instance_profile_reference_model - ] - dedicated_host_profile_model[ - 'vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model - dedicated_host_profile_model[ - 'vcpu_count'] = dedicated_host_profile_vcpu_model + dedicated_host_profile_model['socket_count'] = dedicated_host_profile_socket_model + dedicated_host_profile_model['supported_instance_profiles'] = [instance_profile_reference_model] + dedicated_host_profile_model['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model + dedicated_host_profile_model['vcpu_count'] = dedicated_host_profile_vcpu_model # Construct a json representation of a DedicatedHostProfileCollection model dedicated_host_profile_collection_model_json = {} - dedicated_host_profile_collection_model_json[ - 'first'] = dedicated_host_profile_collection_first_model + dedicated_host_profile_collection_model_json['first'] = dedicated_host_profile_collection_first_model dedicated_host_profile_collection_model_json['limit'] = 20 - dedicated_host_profile_collection_model_json[ - 'next'] = dedicated_host_profile_collection_next_model - dedicated_host_profile_collection_model_json['profiles'] = [ - dedicated_host_profile_model - ] + dedicated_host_profile_collection_model_json['next'] = dedicated_host_profile_collection_next_model + dedicated_host_profile_collection_model_json['profiles'] = [dedicated_host_profile_model] dedicated_host_profile_collection_model_json['total_count'] = 132 # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation - dedicated_host_profile_collection_model = DedicatedHostProfileCollection.from_dict( - dedicated_host_profile_collection_model_json) + dedicated_host_profile_collection_model = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json) assert dedicated_host_profile_collection_model != False # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation - dedicated_host_profile_collection_model_dict = DedicatedHostProfileCollection.from_dict( - dedicated_host_profile_collection_model_json).__dict__ - dedicated_host_profile_collection_model2 = DedicatedHostProfileCollection( - **dedicated_host_profile_collection_model_dict) + dedicated_host_profile_collection_model_dict = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json).__dict__ + dedicated_host_profile_collection_model2 = DedicatedHostProfileCollection(**dedicated_host_profile_collection_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_collection_model == dedicated_host_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_collection_model_json2 = dedicated_host_profile_collection_model.to_dict( - ) + dedicated_host_profile_collection_model_json2 = dedicated_host_profile_collection_model.to_dict() assert dedicated_host_profile_collection_model_json2 == dedicated_host_profile_collection_model_json - class TestDedicatedHostProfileCollectionFirst(): """ Test Class for DedicatedHostProfileCollectionFirst @@ -22870,29 +23982,23 @@ def test_dedicated_host_profile_collection_first_serialization(self): # Construct a json representation of a DedicatedHostProfileCollectionFirst model dedicated_host_profile_collection_first_model_json = {} - dedicated_host_profile_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' + dedicated_host_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation - dedicated_host_profile_collection_first_model = DedicatedHostProfileCollectionFirst.from_dict( - dedicated_host_profile_collection_first_model_json) + dedicated_host_profile_collection_first_model = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json) assert dedicated_host_profile_collection_first_model != False # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation - dedicated_host_profile_collection_first_model_dict = DedicatedHostProfileCollectionFirst.from_dict( - dedicated_host_profile_collection_first_model_json).__dict__ - dedicated_host_profile_collection_first_model2 = DedicatedHostProfileCollectionFirst( - **dedicated_host_profile_collection_first_model_dict) + dedicated_host_profile_collection_first_model_dict = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json).__dict__ + dedicated_host_profile_collection_first_model2 = DedicatedHostProfileCollectionFirst(**dedicated_host_profile_collection_first_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_collection_first_model == dedicated_host_profile_collection_first_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_collection_first_model_json2 = dedicated_host_profile_collection_first_model.to_dict( - ) + dedicated_host_profile_collection_first_model_json2 = dedicated_host_profile_collection_first_model.to_dict() assert dedicated_host_profile_collection_first_model_json2 == dedicated_host_profile_collection_first_model_json - class TestDedicatedHostProfileCollectionNext(): """ Test Class for DedicatedHostProfileCollectionNext @@ -22905,28 +24011,192 @@ def test_dedicated_host_profile_collection_next_serialization(self): # Construct a json representation of a DedicatedHostProfileCollectionNext model dedicated_host_profile_collection_next_model_json = {} - dedicated_host_profile_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' + dedicated_host_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation - dedicated_host_profile_collection_next_model = DedicatedHostProfileCollectionNext.from_dict( - dedicated_host_profile_collection_next_model_json) + dedicated_host_profile_collection_next_model = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json) assert dedicated_host_profile_collection_next_model != False # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation - dedicated_host_profile_collection_next_model_dict = DedicatedHostProfileCollectionNext.from_dict( - dedicated_host_profile_collection_next_model_json).__dict__ - dedicated_host_profile_collection_next_model2 = DedicatedHostProfileCollectionNext( - **dedicated_host_profile_collection_next_model_dict) + dedicated_host_profile_collection_next_model_dict = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json).__dict__ + dedicated_host_profile_collection_next_model2 = DedicatedHostProfileCollectionNext(**dedicated_host_profile_collection_next_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_collection_next_model == dedicated_host_profile_collection_next_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_collection_next_model_json2 = dedicated_host_profile_collection_next_model.to_dict( - ) + dedicated_host_profile_collection_next_model_json2 = dedicated_host_profile_collection_next_model.to_dict() assert dedicated_host_profile_collection_next_model_json2 == dedicated_host_profile_collection_next_model_json +class TestDedicatedHostProfileDisk(): + """ + Test Class for DedicatedHostProfileDisk + """ + + def test_dedicated_host_profile_disk_serialization(self): + """ + Test serialization/deserialization for DedicatedHostProfileDisk + """ + + # Construct dict forms of any model objects needed in order to build this model. + + dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface + dedicated_host_profile_disk_interface_model['type'] = 'fixed' + dedicated_host_profile_disk_interface_model['value'] = 'nvme' + + dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity + dedicated_host_profile_disk_quantity_model['type'] = 'fixed' + dedicated_host_profile_disk_quantity_model['value'] = 4 + + dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize + dedicated_host_profile_disk_size_model['type'] = 'fixed' + dedicated_host_profile_disk_size_model['value'] = 3200 + + dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces + dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed' + dedicated_host_profile_disk_supported_interfaces_model['value'] = ['virtio_blk'] + + # Construct a json representation of a DedicatedHostProfileDisk model + dedicated_host_profile_disk_model_json = {} + dedicated_host_profile_disk_model_json['interface_type'] = dedicated_host_profile_disk_interface_model + dedicated_host_profile_disk_model_json['quantity'] = dedicated_host_profile_disk_quantity_model + dedicated_host_profile_disk_model_json['size'] = dedicated_host_profile_disk_size_model + dedicated_host_profile_disk_model_json['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model + + # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation + dedicated_host_profile_disk_model = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json) + assert dedicated_host_profile_disk_model != False + + # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation + dedicated_host_profile_disk_model_dict = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json).__dict__ + dedicated_host_profile_disk_model2 = DedicatedHostProfileDisk(**dedicated_host_profile_disk_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_profile_disk_model == dedicated_host_profile_disk_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_profile_disk_model_json2 = dedicated_host_profile_disk_model.to_dict() + assert dedicated_host_profile_disk_model_json2 == dedicated_host_profile_disk_model_json + +class TestDedicatedHostProfileDiskInterface(): + """ + Test Class for DedicatedHostProfileDiskInterface + """ + + def test_dedicated_host_profile_disk_interface_serialization(self): + """ + Test serialization/deserialization for DedicatedHostProfileDiskInterface + """ + + # Construct a json representation of a DedicatedHostProfileDiskInterface model + dedicated_host_profile_disk_interface_model_json = {} + dedicated_host_profile_disk_interface_model_json['type'] = 'fixed' + dedicated_host_profile_disk_interface_model_json['value'] = 'nvme' + + # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation + dedicated_host_profile_disk_interface_model = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json) + assert dedicated_host_profile_disk_interface_model != False + + # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation + dedicated_host_profile_disk_interface_model_dict = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json).__dict__ + dedicated_host_profile_disk_interface_model2 = DedicatedHostProfileDiskInterface(**dedicated_host_profile_disk_interface_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_profile_disk_interface_model == dedicated_host_profile_disk_interface_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_profile_disk_interface_model_json2 = dedicated_host_profile_disk_interface_model.to_dict() + assert dedicated_host_profile_disk_interface_model_json2 == dedicated_host_profile_disk_interface_model_json + +class TestDedicatedHostProfileDiskQuantity(): + """ + Test Class for DedicatedHostProfileDiskQuantity + """ + + def test_dedicated_host_profile_disk_quantity_serialization(self): + """ + Test serialization/deserialization for DedicatedHostProfileDiskQuantity + """ + + # Construct a json representation of a DedicatedHostProfileDiskQuantity model + dedicated_host_profile_disk_quantity_model_json = {} + dedicated_host_profile_disk_quantity_model_json['type'] = 'fixed' + dedicated_host_profile_disk_quantity_model_json['value'] = 4 + + # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation + dedicated_host_profile_disk_quantity_model = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json) + assert dedicated_host_profile_disk_quantity_model != False + + # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation + dedicated_host_profile_disk_quantity_model_dict = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json).__dict__ + dedicated_host_profile_disk_quantity_model2 = DedicatedHostProfileDiskQuantity(**dedicated_host_profile_disk_quantity_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_profile_disk_quantity_model == dedicated_host_profile_disk_quantity_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_profile_disk_quantity_model_json2 = dedicated_host_profile_disk_quantity_model.to_dict() + assert dedicated_host_profile_disk_quantity_model_json2 == dedicated_host_profile_disk_quantity_model_json + +class TestDedicatedHostProfileDiskSize(): + """ + Test Class for DedicatedHostProfileDiskSize + """ + + def test_dedicated_host_profile_disk_size_serialization(self): + """ + Test serialization/deserialization for DedicatedHostProfileDiskSize + """ + + # Construct a json representation of a DedicatedHostProfileDiskSize model + dedicated_host_profile_disk_size_model_json = {} + dedicated_host_profile_disk_size_model_json['type'] = 'fixed' + dedicated_host_profile_disk_size_model_json['value'] = 3200 + + # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation + dedicated_host_profile_disk_size_model = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json) + assert dedicated_host_profile_disk_size_model != False + + # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation + dedicated_host_profile_disk_size_model_dict = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json).__dict__ + dedicated_host_profile_disk_size_model2 = DedicatedHostProfileDiskSize(**dedicated_host_profile_disk_size_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_profile_disk_size_model == dedicated_host_profile_disk_size_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_profile_disk_size_model_json2 = dedicated_host_profile_disk_size_model.to_dict() + assert dedicated_host_profile_disk_size_model_json2 == dedicated_host_profile_disk_size_model_json + +class TestDedicatedHostProfileDiskSupportedInterfaces(): + """ + Test Class for DedicatedHostProfileDiskSupportedInterfaces + """ + + def test_dedicated_host_profile_disk_supported_interfaces_serialization(self): + """ + Test serialization/deserialization for DedicatedHostProfileDiskSupportedInterfaces + """ + + # Construct a json representation of a DedicatedHostProfileDiskSupportedInterfaces model + dedicated_host_profile_disk_supported_interfaces_model_json = {} + dedicated_host_profile_disk_supported_interfaces_model_json['type'] = 'fixed' + dedicated_host_profile_disk_supported_interfaces_model_json['value'] = ['virtio_blk'] + + # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation + dedicated_host_profile_disk_supported_interfaces_model = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json) + assert dedicated_host_profile_disk_supported_interfaces_model != False + + # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation + dedicated_host_profile_disk_supported_interfaces_model_dict = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json).__dict__ + dedicated_host_profile_disk_supported_interfaces_model2 = DedicatedHostProfileDiskSupportedInterfaces(**dedicated_host_profile_disk_supported_interfaces_model_dict) + + # Verify the model instances are equivalent + assert dedicated_host_profile_disk_supported_interfaces_model == dedicated_host_profile_disk_supported_interfaces_model2 + + # Convert model instance back to dict and verify no loss of data + dedicated_host_profile_disk_supported_interfaces_model_json2 = dedicated_host_profile_disk_supported_interfaces_model.to_dict() + assert dedicated_host_profile_disk_supported_interfaces_model_json2 == dedicated_host_profile_disk_supported_interfaces_model_json class TestDedicatedHostProfileReference(): """ @@ -22940,31 +24210,24 @@ def test_dedicated_host_profile_reference_serialization(self): # Construct a json representation of a DedicatedHostProfileReference model dedicated_host_profile_reference_model_json = {} - dedicated_host_profile_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_profile_reference_model_json[ - 'name'] = 'mx2-host-152x1216' + dedicated_host_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_reference_model_json['name'] = 'mx2-host-152x1216' # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation - dedicated_host_profile_reference_model = DedicatedHostProfileReference.from_dict( - dedicated_host_profile_reference_model_json) + dedicated_host_profile_reference_model = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json) assert dedicated_host_profile_reference_model != False # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation - dedicated_host_profile_reference_model_dict = DedicatedHostProfileReference.from_dict( - dedicated_host_profile_reference_model_json).__dict__ - dedicated_host_profile_reference_model2 = DedicatedHostProfileReference( - **dedicated_host_profile_reference_model_dict) + dedicated_host_profile_reference_model_dict = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json).__dict__ + dedicated_host_profile_reference_model2 = DedicatedHostProfileReference(**dedicated_host_profile_reference_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_reference_model == dedicated_host_profile_reference_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_reference_model_json2 = dedicated_host_profile_reference_model.to_dict( - ) + dedicated_host_profile_reference_model_json2 = dedicated_host_profile_reference_model.to_dict() assert dedicated_host_profile_reference_model_json2 == dedicated_host_profile_reference_model_json - class TestDedicatedHostProfileVCPUArchitecture(): """ Test Class for DedicatedHostProfileVCPUArchitecture @@ -22981,25 +24244,20 @@ def test_dedicated_host_profile_vcpu_architecture_serialization(self): dedicated_host_profile_vcpu_architecture_model_json['value'] = 'amd64' # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation - dedicated_host_profile_vcpu_architecture_model = DedicatedHostProfileVCPUArchitecture.from_dict( - dedicated_host_profile_vcpu_architecture_model_json) + dedicated_host_profile_vcpu_architecture_model = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json) assert dedicated_host_profile_vcpu_architecture_model != False # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation - dedicated_host_profile_vcpu_architecture_model_dict = DedicatedHostProfileVCPUArchitecture.from_dict( - dedicated_host_profile_vcpu_architecture_model_json).__dict__ - dedicated_host_profile_vcpu_architecture_model2 = DedicatedHostProfileVCPUArchitecture( - **dedicated_host_profile_vcpu_architecture_model_dict) + dedicated_host_profile_vcpu_architecture_model_dict = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json).__dict__ + dedicated_host_profile_vcpu_architecture_model2 = DedicatedHostProfileVCPUArchitecture(**dedicated_host_profile_vcpu_architecture_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_vcpu_architecture_model == dedicated_host_profile_vcpu_architecture_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_vcpu_architecture_model_json2 = dedicated_host_profile_vcpu_architecture_model.to_dict( - ) + dedicated_host_profile_vcpu_architecture_model_json2 = dedicated_host_profile_vcpu_architecture_model.to_dict() assert dedicated_host_profile_vcpu_architecture_model_json2 == dedicated_host_profile_vcpu_architecture_model_json - class TestDedicatedHostReference(): """ Test Class for DedicatedHostReference @@ -23012,44 +24270,33 @@ def test_dedicated_host_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_reference_deleted_model = { - } # DedicatedHostReferenceDeleted - dedicated_host_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted + dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a DedicatedHostReference model dedicated_host_reference_model_json = {} - dedicated_host_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model_json[ - 'deleted'] = dedicated_host_reference_deleted_model - dedicated_host_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model_json['deleted'] = dedicated_host_reference_deleted_model + dedicated_host_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model_json['name'] = 'my-host' dedicated_host_reference_model_json['resource_type'] = 'dedicated_host' # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation - dedicated_host_reference_model = DedicatedHostReference.from_dict( - dedicated_host_reference_model_json) + dedicated_host_reference_model = DedicatedHostReference.from_dict(dedicated_host_reference_model_json) assert dedicated_host_reference_model != False # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation - dedicated_host_reference_model_dict = DedicatedHostReference.from_dict( - dedicated_host_reference_model_json).__dict__ - dedicated_host_reference_model2 = DedicatedHostReference( - **dedicated_host_reference_model_dict) + dedicated_host_reference_model_dict = DedicatedHostReference.from_dict(dedicated_host_reference_model_json).__dict__ + dedicated_host_reference_model2 = DedicatedHostReference(**dedicated_host_reference_model_dict) # Verify the model instances are equivalent assert dedicated_host_reference_model == dedicated_host_reference_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_reference_model_json2 = dedicated_host_reference_model.to_dict( - ) + dedicated_host_reference_model_json2 = dedicated_host_reference_model.to_dict() assert dedicated_host_reference_model_json2 == dedicated_host_reference_model_json - class TestDedicatedHostReferenceDeleted(): """ Test Class for DedicatedHostReferenceDeleted @@ -23062,29 +24309,23 @@ def test_dedicated_host_reference_deleted_serialization(self): # Construct a json representation of a DedicatedHostReferenceDeleted model dedicated_host_reference_deleted_model_json = {} - dedicated_host_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + dedicated_host_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation - dedicated_host_reference_deleted_model = DedicatedHostReferenceDeleted.from_dict( - dedicated_host_reference_deleted_model_json) + dedicated_host_reference_deleted_model = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json) assert dedicated_host_reference_deleted_model != False # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation - dedicated_host_reference_deleted_model_dict = DedicatedHostReferenceDeleted.from_dict( - dedicated_host_reference_deleted_model_json).__dict__ - dedicated_host_reference_deleted_model2 = DedicatedHostReferenceDeleted( - **dedicated_host_reference_deleted_model_dict) + dedicated_host_reference_deleted_model_dict = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json).__dict__ + dedicated_host_reference_deleted_model2 = DedicatedHostReferenceDeleted(**dedicated_host_reference_deleted_model_dict) # Verify the model instances are equivalent assert dedicated_host_reference_deleted_model == dedicated_host_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_reference_deleted_model_json2 = dedicated_host_reference_deleted_model.to_dict( - ) + dedicated_host_reference_deleted_model_json2 = dedicated_host_reference_deleted_model.to_dict() assert dedicated_host_reference_deleted_model_json2 == dedicated_host_reference_deleted_model_json - class TestDefaultNetworkACL(): """ Test Class for DefaultNetworkACL @@ -23097,39 +24338,28 @@ def test_default_network_acl_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = { - } # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model - network_acl_rule_item_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + network_acl_rule_item_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_acl_rule_item_model['destination'] = '192.168.3.0/24' network_acl_rule_item_model['direction'] = 'inbound' - network_acl_rule_item_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' network_acl_rule_item_model['name'] = 'my-rule-2' network_acl_rule_item_model['source'] = '192.168.3.0/24' @@ -23139,60 +24369,45 @@ def test_default_network_acl_serialization(self): network_acl_rule_item_model['source_port_max'] = 65535 network_acl_rule_item_model['source_port_min'] = 49152 - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a DefaultNetworkACL model default_network_acl_model_json = {} - default_network_acl_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - default_network_acl_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - default_network_acl_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - default_network_acl_model_json[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' - default_network_acl_model_json[ - 'name'] = 'mnemonic-ersatz-eatery-malaise' - default_network_acl_model_json[ - 'resource_group'] = resource_group_reference_model + default_network_acl_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + default_network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + default_network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + default_network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + default_network_acl_model_json['name'] = 'mnemonic-ersatz-eatery-malaise' + default_network_acl_model_json['resource_group'] = resource_group_reference_model default_network_acl_model_json['rules'] = [network_acl_rule_item_model] default_network_acl_model_json['subnets'] = [subnet_reference_model] default_network_acl_model_json['vpc'] = vpc_reference_model # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation - default_network_acl_model = DefaultNetworkACL.from_dict( - default_network_acl_model_json) + default_network_acl_model = DefaultNetworkACL.from_dict(default_network_acl_model_json) assert default_network_acl_model != False # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation - default_network_acl_model_dict = DefaultNetworkACL.from_dict( - default_network_acl_model_json).__dict__ - default_network_acl_model2 = DefaultNetworkACL( - **default_network_acl_model_dict) + default_network_acl_model_dict = DefaultNetworkACL.from_dict(default_network_acl_model_json).__dict__ + default_network_acl_model2 = DefaultNetworkACL(**default_network_acl_model_dict) # Verify the model instances are equivalent assert default_network_acl_model == default_network_acl_model2 @@ -23201,7 +24416,6 @@ def test_default_network_acl_serialization(self): default_network_acl_model_json2 = default_network_acl_model.to_dict() assert default_network_acl_model_json2 == default_network_acl_model_json - class TestDefaultRoutingTable(): """ Test Class for DefaultRoutingTable @@ -23214,38 +24428,30 @@ def test_default_routing_table_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_reference_deleted_model = {} # RouteReferenceDeleted - route_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + route_reference_deleted_model = {} # RouteReferenceDeleted + route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - route_reference_model = {} # RouteReference + route_reference_model = {} # RouteReference route_reference_model['deleted'] = route_reference_deleted_model - route_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['name'] = 'my-route-1' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a DefaultRoutingTable model default_routing_table_model_json = {} - default_routing_table_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - default_routing_table_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - default_routing_table_model_json[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + default_routing_table_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + default_routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + default_routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' default_routing_table_model_json['is_default'] = True default_routing_table_model_json['lifecycle_state'] = 'stable' default_routing_table_model_json['name'] = 'milled-easy-equine-machines' @@ -23257,25 +24463,20 @@ def test_default_routing_table_serialization(self): default_routing_table_model_json['subnets'] = [subnet_reference_model] # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation - default_routing_table_model = DefaultRoutingTable.from_dict( - default_routing_table_model_json) + default_routing_table_model = DefaultRoutingTable.from_dict(default_routing_table_model_json) assert default_routing_table_model != False # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation - default_routing_table_model_dict = DefaultRoutingTable.from_dict( - default_routing_table_model_json).__dict__ - default_routing_table_model2 = DefaultRoutingTable( - **default_routing_table_model_dict) + default_routing_table_model_dict = DefaultRoutingTable.from_dict(default_routing_table_model_json).__dict__ + default_routing_table_model2 = DefaultRoutingTable(**default_routing_table_model_dict) # Verify the model instances are equivalent assert default_routing_table_model == default_routing_table_model2 # Convert model instance back to dict and verify no loss of data - default_routing_table_model_json2 = default_routing_table_model.to_dict( - ) + default_routing_table_model_json2 = default_routing_table_model.to_dict() assert default_routing_table_model_json2 == default_routing_table_model_json - class TestDefaultSecurityGroup(): """ Test Class for DefaultSecurityGroup @@ -23288,21 +24489,17 @@ def test_default_security_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' - security_group_rule_model = { - } # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['remote'] = security_group_rule_remote_model @@ -23310,56 +24507,42 @@ def test_default_security_group_serialization(self): security_group_rule_model['port_min'] = 22 security_group_rule_model['protocol'] = 'udp' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a DefaultSecurityGroup model default_security_group_model_json = {} - default_security_group_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - default_security_group_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - default_security_group_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - default_security_group_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - default_security_group_model_json[ - 'name'] = 'observant-chip-emphatic-engraver' - default_security_group_model_json[ - 'resource_group'] = resource_group_reference_model + default_security_group_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + default_security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + default_security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + default_security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + default_security_group_model_json['name'] = 'observant-chip-emphatic-engraver' + default_security_group_model_json['resource_group'] = resource_group_reference_model default_security_group_model_json['rules'] = [security_group_rule_model] default_security_group_model_json['vpc'] = vpc_reference_model # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation - default_security_group_model = DefaultSecurityGroup.from_dict( - default_security_group_model_json) + default_security_group_model = DefaultSecurityGroup.from_dict(default_security_group_model_json) assert default_security_group_model != False # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation - default_security_group_model_dict = DefaultSecurityGroup.from_dict( - default_security_group_model_json).__dict__ - default_security_group_model2 = DefaultSecurityGroup( - **default_security_group_model_dict) + default_security_group_model_dict = DefaultSecurityGroup.from_dict(default_security_group_model_json).__dict__ + default_security_group_model2 = DefaultSecurityGroup(**default_security_group_model_dict) # Verify the model instances are equivalent assert default_security_group_model == default_security_group_model2 # Convert model instance back to dict and verify no loss of data - default_security_group_model_json2 = default_security_group_model.to_dict( - ) + default_security_group_model_json2 = default_security_group_model.to_dict() assert default_security_group_model_json2 == default_security_group_model_json - class TestEncryptionKeyReference(): """ Test Class for EncryptionKeyReference @@ -23372,29 +24555,23 @@ def test_encryption_key_reference_serialization(self): # Construct a json representation of a EncryptionKeyReference model encryption_key_reference_model_json = {} - encryption_key_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_reference_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation - encryption_key_reference_model = EncryptionKeyReference.from_dict( - encryption_key_reference_model_json) + encryption_key_reference_model = EncryptionKeyReference.from_dict(encryption_key_reference_model_json) assert encryption_key_reference_model != False # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation - encryption_key_reference_model_dict = EncryptionKeyReference.from_dict( - encryption_key_reference_model_json).__dict__ - encryption_key_reference_model2 = EncryptionKeyReference( - **encryption_key_reference_model_dict) + encryption_key_reference_model_dict = EncryptionKeyReference.from_dict(encryption_key_reference_model_json).__dict__ + encryption_key_reference_model2 = EncryptionKeyReference(**encryption_key_reference_model_dict) # Verify the model instances are equivalent assert encryption_key_reference_model == encryption_key_reference_model2 # Convert model instance back to dict and verify no loss of data - encryption_key_reference_model_json2 = encryption_key_reference_model.to_dict( - ) + encryption_key_reference_model_json2 = encryption_key_reference_model.to_dict() assert encryption_key_reference_model_json2 == encryption_key_reference_model_json - class TestEndpointGateway(): """ Test Class for EndpointGateway @@ -23407,80 +24584,59 @@ def test_endpoint_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted - reserved_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model[ - 'deleted'] = reserved_ip_reference_deleted_model - reserved_ip_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - endpoint_gateway_target_model = { - } # EndpointGatewayTargetProviderCloudServiceReference - endpoint_gateway_target_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' - endpoint_gateway_target_model[ - 'resource_type'] = 'provider_cloud_service' + endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference + endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a EndpointGateway model endpoint_gateway_model_json = {} - endpoint_gateway_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - endpoint_gateway_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + endpoint_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' endpoint_gateway_model_json['health_state'] = 'ok' - endpoint_gateway_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' - endpoint_gateway_model_json[ - 'id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' endpoint_gateway_model_json['ips'] = [reserved_ip_reference_model] endpoint_gateway_model_json['lifecycle_state'] = 'stable' endpoint_gateway_model_json['name'] = 'my-endpoint-gateway' - endpoint_gateway_model_json[ - 'resource_group'] = resource_group_reference_model + endpoint_gateway_model_json['resource_group'] = resource_group_reference_model endpoint_gateway_model_json['resource_type'] = 'endpoint_gateway' - endpoint_gateway_model_json[ - 'service_endpoint'] = 'my-cloudant-instance.appdomain.cloud' - endpoint_gateway_model_json['service_endpoints'] = [ - 'my-cloudant-instance.appdomain.cloud' - ] + endpoint_gateway_model_json['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud' + endpoint_gateway_model_json['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud'] endpoint_gateway_model_json['target'] = endpoint_gateway_target_model endpoint_gateway_model_json['vpc'] = vpc_reference_model # Construct a model instance of EndpointGateway by calling from_dict on the json representation - endpoint_gateway_model = EndpointGateway.from_dict( - endpoint_gateway_model_json) + endpoint_gateway_model = EndpointGateway.from_dict(endpoint_gateway_model_json) assert endpoint_gateway_model != False # Construct a model instance of EndpointGateway by calling from_dict on the json representation - endpoint_gateway_model_dict = EndpointGateway.from_dict( - endpoint_gateway_model_json).__dict__ + endpoint_gateway_model_dict = EndpointGateway.from_dict(endpoint_gateway_model_json).__dict__ endpoint_gateway_model2 = EndpointGateway(**endpoint_gateway_model_dict) # Verify the model instances are equivalent @@ -23490,7 +24646,6 @@ def test_endpoint_gateway_serialization(self): endpoint_gateway_model_json2 = endpoint_gateway_model.to_dict() assert endpoint_gateway_model_json2 == endpoint_gateway_model_json - class TestEndpointGatewayCollection(): """ Test Class for EndpointGatewayCollection @@ -23503,111 +24658,81 @@ def test_endpoint_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted - reserved_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model[ - 'deleted'] = reserved_ip_reference_deleted_model - reserved_ip_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - endpoint_gateway_target_model = { - } # EndpointGatewayTargetProviderCloudServiceReference - endpoint_gateway_target_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' - endpoint_gateway_target_model[ - 'resource_type'] = 'provider_cloud_service' + endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference + endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - endpoint_gateway_model = {} # EndpointGateway - endpoint_gateway_model['created_at'] = '2020-01-28T18:40:40.123456Z' - endpoint_gateway_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_model = {} # EndpointGateway + endpoint_gateway_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + endpoint_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' endpoint_gateway_model['health_state'] = 'ok' - endpoint_gateway_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' endpoint_gateway_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' endpoint_gateway_model['ips'] = [reserved_ip_reference_model] endpoint_gateway_model['lifecycle_state'] = 'stable' endpoint_gateway_model['name'] = 'my-endpoint-gateway' - endpoint_gateway_model[ - 'resource_group'] = resource_group_reference_model + endpoint_gateway_model['resource_group'] = resource_group_reference_model endpoint_gateway_model['resource_type'] = 'endpoint_gateway' - endpoint_gateway_model[ - 'service_endpoint'] = 'my-cloudant-instance.appdomain.cloud' - endpoint_gateway_model['service_endpoints'] = [ - 'my-cloudant-instance.appdomain.cloud' - ] + endpoint_gateway_model['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud' + endpoint_gateway_model['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud'] endpoint_gateway_model['target'] = endpoint_gateway_target_model endpoint_gateway_model['vpc'] = vpc_reference_model - endpoint_gateway_collection_first_model = { - } # EndpointGatewayCollectionFirst - endpoint_gateway_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' + endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst + endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' - endpoint_gateway_collection_next_model = { - } # EndpointGatewayCollectionNext - endpoint_gateway_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' + endpoint_gateway_collection_next_model = {} # EndpointGatewayCollectionNext + endpoint_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' # Construct a json representation of a EndpointGatewayCollection model endpoint_gateway_collection_model_json = {} - endpoint_gateway_collection_model_json['endpoint_gateways'] = [ - endpoint_gateway_model - ] - endpoint_gateway_collection_model_json[ - 'first'] = endpoint_gateway_collection_first_model + endpoint_gateway_collection_model_json['endpoint_gateways'] = [endpoint_gateway_model] + endpoint_gateway_collection_model_json['first'] = endpoint_gateway_collection_first_model endpoint_gateway_collection_model_json['limit'] = 20 - endpoint_gateway_collection_model_json[ - 'next'] = endpoint_gateway_collection_next_model + endpoint_gateway_collection_model_json['next'] = endpoint_gateway_collection_next_model endpoint_gateway_collection_model_json['total_count'] = 132 # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation - endpoint_gateway_collection_model = EndpointGatewayCollection.from_dict( - endpoint_gateway_collection_model_json) + endpoint_gateway_collection_model = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json) assert endpoint_gateway_collection_model != False # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation - endpoint_gateway_collection_model_dict = EndpointGatewayCollection.from_dict( - endpoint_gateway_collection_model_json).__dict__ - endpoint_gateway_collection_model2 = EndpointGatewayCollection( - **endpoint_gateway_collection_model_dict) + endpoint_gateway_collection_model_dict = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json).__dict__ + endpoint_gateway_collection_model2 = EndpointGatewayCollection(**endpoint_gateway_collection_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_collection_model == endpoint_gateway_collection_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_collection_model_json2 = endpoint_gateway_collection_model.to_dict( - ) + endpoint_gateway_collection_model_json2 = endpoint_gateway_collection_model.to_dict() assert endpoint_gateway_collection_model_json2 == endpoint_gateway_collection_model_json - class TestEndpointGatewayCollectionFirst(): """ Test Class for EndpointGatewayCollectionFirst @@ -23620,29 +24745,23 @@ def test_endpoint_gateway_collection_first_serialization(self): # Construct a json representation of a EndpointGatewayCollectionFirst model endpoint_gateway_collection_first_model_json = {} - endpoint_gateway_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' + endpoint_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation - endpoint_gateway_collection_first_model = EndpointGatewayCollectionFirst.from_dict( - endpoint_gateway_collection_first_model_json) + endpoint_gateway_collection_first_model = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json) assert endpoint_gateway_collection_first_model != False # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation - endpoint_gateway_collection_first_model_dict = EndpointGatewayCollectionFirst.from_dict( - endpoint_gateway_collection_first_model_json).__dict__ - endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst( - **endpoint_gateway_collection_first_model_dict) + endpoint_gateway_collection_first_model_dict = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json).__dict__ + endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst(**endpoint_gateway_collection_first_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_collection_first_model_json2 = endpoint_gateway_collection_first_model.to_dict( - ) + endpoint_gateway_collection_first_model_json2 = endpoint_gateway_collection_first_model.to_dict() assert endpoint_gateway_collection_first_model_json2 == endpoint_gateway_collection_first_model_json - class TestEndpointGatewayCollectionNext(): """ Test Class for EndpointGatewayCollectionNext @@ -23655,29 +24774,23 @@ def test_endpoint_gateway_collection_next_serialization(self): # Construct a json representation of a EndpointGatewayCollectionNext model endpoint_gateway_collection_next_model_json = {} - endpoint_gateway_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' + endpoint_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation - endpoint_gateway_collection_next_model = EndpointGatewayCollectionNext.from_dict( - endpoint_gateway_collection_next_model_json) + endpoint_gateway_collection_next_model = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json) assert endpoint_gateway_collection_next_model != False # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation - endpoint_gateway_collection_next_model_dict = EndpointGatewayCollectionNext.from_dict( - endpoint_gateway_collection_next_model_json).__dict__ - endpoint_gateway_collection_next_model2 = EndpointGatewayCollectionNext( - **endpoint_gateway_collection_next_model_dict) + endpoint_gateway_collection_next_model_dict = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json).__dict__ + endpoint_gateway_collection_next_model2 = EndpointGatewayCollectionNext(**endpoint_gateway_collection_next_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_collection_next_model_json2 = endpoint_gateway_collection_next_model.to_dict( - ) + endpoint_gateway_collection_next_model_json2 = endpoint_gateway_collection_next_model.to_dict() assert endpoint_gateway_collection_next_model_json2 == endpoint_gateway_collection_next_model_json - class TestEndpointGatewayPatch(): """ Test Class for EndpointGatewayPatch @@ -23693,25 +24806,20 @@ def test_endpoint_gateway_patch_serialization(self): endpoint_gateway_patch_model_json['name'] = 'my-endpoint-gateway' # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation - endpoint_gateway_patch_model = EndpointGatewayPatch.from_dict( - endpoint_gateway_patch_model_json) + endpoint_gateway_patch_model = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json) assert endpoint_gateway_patch_model != False # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation - endpoint_gateway_patch_model_dict = EndpointGatewayPatch.from_dict( - endpoint_gateway_patch_model_json).__dict__ - endpoint_gateway_patch_model2 = EndpointGatewayPatch( - **endpoint_gateway_patch_model_dict) + endpoint_gateway_patch_model_dict = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json).__dict__ + endpoint_gateway_patch_model2 = EndpointGatewayPatch(**endpoint_gateway_patch_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_patch_model == endpoint_gateway_patch_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_patch_model_json2 = endpoint_gateway_patch_model.to_dict( - ) + endpoint_gateway_patch_model_json2 = endpoint_gateway_patch_model.to_dict() assert endpoint_gateway_patch_model_json2 == endpoint_gateway_patch_model_json - class TestEndpointGatewayReferenceDeleted(): """ Test Class for EndpointGatewayReferenceDeleted @@ -23724,29 +24832,23 @@ def test_endpoint_gateway_reference_deleted_serialization(self): # Construct a json representation of a EndpointGatewayReferenceDeleted model endpoint_gateway_reference_deleted_model_json = {} - endpoint_gateway_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + endpoint_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation - endpoint_gateway_reference_deleted_model = EndpointGatewayReferenceDeleted.from_dict( - endpoint_gateway_reference_deleted_model_json) + endpoint_gateway_reference_deleted_model = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json) assert endpoint_gateway_reference_deleted_model != False # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation - endpoint_gateway_reference_deleted_model_dict = EndpointGatewayReferenceDeleted.from_dict( - endpoint_gateway_reference_deleted_model_json).__dict__ - endpoint_gateway_reference_deleted_model2 = EndpointGatewayReferenceDeleted( - **endpoint_gateway_reference_deleted_model_dict) + endpoint_gateway_reference_deleted_model_dict = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json).__dict__ + endpoint_gateway_reference_deleted_model2 = EndpointGatewayReferenceDeleted(**endpoint_gateway_reference_deleted_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_reference_deleted_model == endpoint_gateway_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reference_deleted_model_json2 = endpoint_gateway_reference_deleted_model.to_dict( - ) + endpoint_gateway_reference_deleted_model_json2 = endpoint_gateway_reference_deleted_model.to_dict() assert endpoint_gateway_reference_deleted_model_json2 == endpoint_gateway_reference_deleted_model_json - class TestFloatingIP(): """ Test Class for FloatingIP @@ -23759,46 +24861,35 @@ def test_floating_ip_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - floating_ip_target_model = { - } # FloatingIPTargetNetworkInterfaceReference - floating_ip_target_model[ - 'deleted'] = network_interface_reference_deleted_model - floating_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + floating_ip_target_model['deleted'] = network_interface_reference_deleted_model + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' floating_ip_target_model['resource_type'] = 'network_interface' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a FloatingIP model floating_ip_model_json = {} floating_ip_model_json['address'] = '203.0.113.1' - floating_ip_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - floating_ip_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model_json['name'] = 'my-floating-ip' - floating_ip_model_json[ - 'resource_group'] = resource_group_reference_model + floating_ip_model_json['resource_group'] = resource_group_reference_model floating_ip_model_json['status'] = 'available' floating_ip_model_json['target'] = floating_ip_target_model floating_ip_model_json['zone'] = zone_reference_model @@ -23808,8 +24899,7 @@ def test_floating_ip_serialization(self): assert floating_ip_model != False # Construct a model instance of FloatingIP by calling from_dict on the json representation - floating_ip_model_dict = FloatingIP.from_dict( - floating_ip_model_json).__dict__ + floating_ip_model_dict = FloatingIP.from_dict(floating_ip_model_json).__dict__ floating_ip_model2 = FloatingIP(**floating_ip_model_dict) # Verify the model instances are equivalent @@ -23819,7 +24909,6 @@ def test_floating_ip_serialization(self): floating_ip_model_json2 = floating_ip_model.to_dict() assert floating_ip_model_json2 == floating_ip_model_json - class TestFloatingIPCollection(): """ Test Class for FloatingIPCollection @@ -23832,45 +24921,34 @@ def test_floating_ip_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_collection_first_model = {} # FloatingIPCollectionFirst - floating_ip_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' + floating_ip_collection_first_model = {} # FloatingIPCollectionFirst + floating_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - floating_ip_target_model = { - } # FloatingIPTargetNetworkInterfaceReference - floating_ip_target_model[ - 'deleted'] = network_interface_reference_deleted_model - floating_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + floating_ip_target_model['deleted'] = network_interface_reference_deleted_model + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' floating_ip_target_model['resource_type'] = 'network_interface' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - floating_ip_model = {} # FloatingIP + floating_ip_model = {} # FloatingIP floating_ip_model['address'] = '203.0.113.1' - floating_ip_model['created_at'] = '2020-01-28T18:40:40.123456Z' - floating_ip_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model['name'] = 'my-floating-ip' floating_ip_model['resource_group'] = resource_group_reference_model @@ -23878,40 +24956,32 @@ def test_floating_ip_collection_serialization(self): floating_ip_model['target'] = floating_ip_target_model floating_ip_model['zone'] = zone_reference_model - floating_ip_collection_next_model = {} # FloatingIPCollectionNext - floating_ip_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + floating_ip_collection_next_model = {} # FloatingIPCollectionNext + floating_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a FloatingIPCollection model floating_ip_collection_model_json = {} - floating_ip_collection_model_json[ - 'first'] = floating_ip_collection_first_model + floating_ip_collection_model_json['first'] = floating_ip_collection_first_model floating_ip_collection_model_json['floating_ips'] = [floating_ip_model] floating_ip_collection_model_json['limit'] = 20 - floating_ip_collection_model_json[ - 'next'] = floating_ip_collection_next_model + floating_ip_collection_model_json['next'] = floating_ip_collection_next_model floating_ip_collection_model_json['total_count'] = 132 # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation - floating_ip_collection_model = FloatingIPCollection.from_dict( - floating_ip_collection_model_json) + floating_ip_collection_model = FloatingIPCollection.from_dict(floating_ip_collection_model_json) assert floating_ip_collection_model != False # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation - floating_ip_collection_model_dict = FloatingIPCollection.from_dict( - floating_ip_collection_model_json).__dict__ - floating_ip_collection_model2 = FloatingIPCollection( - **floating_ip_collection_model_dict) + floating_ip_collection_model_dict = FloatingIPCollection.from_dict(floating_ip_collection_model_json).__dict__ + floating_ip_collection_model2 = FloatingIPCollection(**floating_ip_collection_model_dict) # Verify the model instances are equivalent assert floating_ip_collection_model == floating_ip_collection_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_collection_model_json2 = floating_ip_collection_model.to_dict( - ) + floating_ip_collection_model_json2 = floating_ip_collection_model.to_dict() assert floating_ip_collection_model_json2 == floating_ip_collection_model_json - class TestFloatingIPCollectionFirst(): """ Test Class for FloatingIPCollectionFirst @@ -23924,29 +24994,23 @@ def test_floating_ip_collection_first_serialization(self): # Construct a json representation of a FloatingIPCollectionFirst model floating_ip_collection_first_model_json = {} - floating_ip_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' + floating_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation - floating_ip_collection_first_model = FloatingIPCollectionFirst.from_dict( - floating_ip_collection_first_model_json) + floating_ip_collection_first_model = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json) assert floating_ip_collection_first_model != False # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation - floating_ip_collection_first_model_dict = FloatingIPCollectionFirst.from_dict( - floating_ip_collection_first_model_json).__dict__ - floating_ip_collection_first_model2 = FloatingIPCollectionFirst( - **floating_ip_collection_first_model_dict) + floating_ip_collection_first_model_dict = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json).__dict__ + floating_ip_collection_first_model2 = FloatingIPCollectionFirst(**floating_ip_collection_first_model_dict) # Verify the model instances are equivalent assert floating_ip_collection_first_model == floating_ip_collection_first_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_collection_first_model_json2 = floating_ip_collection_first_model.to_dict( - ) + floating_ip_collection_first_model_json2 = floating_ip_collection_first_model.to_dict() assert floating_ip_collection_first_model_json2 == floating_ip_collection_first_model_json - class TestFloatingIPCollectionNext(): """ Test Class for FloatingIPCollectionNext @@ -23959,29 +25023,23 @@ def test_floating_ip_collection_next_serialization(self): # Construct a json representation of a FloatingIPCollectionNext model floating_ip_collection_next_model_json = {} - floating_ip_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + floating_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation - floating_ip_collection_next_model = FloatingIPCollectionNext.from_dict( - floating_ip_collection_next_model_json) + floating_ip_collection_next_model = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json) assert floating_ip_collection_next_model != False # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation - floating_ip_collection_next_model_dict = FloatingIPCollectionNext.from_dict( - floating_ip_collection_next_model_json).__dict__ - floating_ip_collection_next_model2 = FloatingIPCollectionNext( - **floating_ip_collection_next_model_dict) + floating_ip_collection_next_model_dict = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json).__dict__ + floating_ip_collection_next_model2 = FloatingIPCollectionNext(**floating_ip_collection_next_model_dict) # Verify the model instances are equivalent assert floating_ip_collection_next_model == floating_ip_collection_next_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_collection_next_model_json2 = floating_ip_collection_next_model.to_dict( - ) + floating_ip_collection_next_model_json2 = floating_ip_collection_next_model.to_dict() assert floating_ip_collection_next_model_json2 == floating_ip_collection_next_model_json - class TestFloatingIPPatch(): """ Test Class for FloatingIPPatch @@ -23994,27 +25052,21 @@ def test_floating_ip_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_patch_target_network_interface_identity_model = { - } # FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById - floating_ip_patch_target_network_interface_identity_model[ - 'id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' + floating_ip_patch_target_network_interface_identity_model = {} # FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById + floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' # Construct a json representation of a FloatingIPPatch model floating_ip_patch_model_json = {} floating_ip_patch_model_json['name'] = 'my-floating-ip' - floating_ip_patch_model_json[ - 'target'] = floating_ip_patch_target_network_interface_identity_model + floating_ip_patch_model_json['target'] = floating_ip_patch_target_network_interface_identity_model # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation - floating_ip_patch_model = FloatingIPPatch.from_dict( - floating_ip_patch_model_json) + floating_ip_patch_model = FloatingIPPatch.from_dict(floating_ip_patch_model_json) assert floating_ip_patch_model != False # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation - floating_ip_patch_model_dict = FloatingIPPatch.from_dict( - floating_ip_patch_model_json).__dict__ - floating_ip_patch_model2 = FloatingIPPatch( - **floating_ip_patch_model_dict) + floating_ip_patch_model_dict = FloatingIPPatch.from_dict(floating_ip_patch_model_json).__dict__ + floating_ip_patch_model2 = FloatingIPPatch(**floating_ip_patch_model_dict) # Verify the model instances are equivalent assert floating_ip_patch_model == floating_ip_patch_model2 @@ -24023,7 +25075,6 @@ def test_floating_ip_patch_serialization(self): floating_ip_patch_model_json2 = floating_ip_patch_model.to_dict() assert floating_ip_patch_model_json2 == floating_ip_patch_model_json - class TestFloatingIPReference(): """ Test Class for FloatingIPReference @@ -24036,43 +25087,33 @@ def test_floating_ip_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FloatingIPReference model floating_ip_reference_model_json = {} floating_ip_reference_model_json['address'] = '203.0.113.1' - floating_ip_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model_json[ - 'deleted'] = floating_ip_reference_deleted_model - floating_ip_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model_json[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model_json['deleted'] = floating_ip_reference_deleted_model + floating_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model_json['name'] = 'my-floating-ip' # Construct a model instance of FloatingIPReference by calling from_dict on the json representation - floating_ip_reference_model = FloatingIPReference.from_dict( - floating_ip_reference_model_json) + floating_ip_reference_model = FloatingIPReference.from_dict(floating_ip_reference_model_json) assert floating_ip_reference_model != False # Construct a model instance of FloatingIPReference by calling from_dict on the json representation - floating_ip_reference_model_dict = FloatingIPReference.from_dict( - floating_ip_reference_model_json).__dict__ - floating_ip_reference_model2 = FloatingIPReference( - **floating_ip_reference_model_dict) + floating_ip_reference_model_dict = FloatingIPReference.from_dict(floating_ip_reference_model_json).__dict__ + floating_ip_reference_model2 = FloatingIPReference(**floating_ip_reference_model_dict) # Verify the model instances are equivalent assert floating_ip_reference_model == floating_ip_reference_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_reference_model_json2 = floating_ip_reference_model.to_dict( - ) + floating_ip_reference_model_json2 = floating_ip_reference_model.to_dict() assert floating_ip_reference_model_json2 == floating_ip_reference_model_json - class TestFloatingIPReferenceDeleted(): """ Test Class for FloatingIPReferenceDeleted @@ -24085,29 +25126,23 @@ def test_floating_ip_reference_deleted_serialization(self): # Construct a json representation of a FloatingIPReferenceDeleted model floating_ip_reference_deleted_model_json = {} - floating_ip_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation - floating_ip_reference_deleted_model = FloatingIPReferenceDeleted.from_dict( - floating_ip_reference_deleted_model_json) + floating_ip_reference_deleted_model = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json) assert floating_ip_reference_deleted_model != False # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation - floating_ip_reference_deleted_model_dict = FloatingIPReferenceDeleted.from_dict( - floating_ip_reference_deleted_model_json).__dict__ - floating_ip_reference_deleted_model2 = FloatingIPReferenceDeleted( - **floating_ip_reference_deleted_model_dict) + floating_ip_reference_deleted_model_dict = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json).__dict__ + floating_ip_reference_deleted_model2 = FloatingIPReferenceDeleted(**floating_ip_reference_deleted_model_dict) # Verify the model instances are equivalent assert floating_ip_reference_deleted_model == floating_ip_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_reference_deleted_model_json2 = floating_ip_reference_deleted_model.to_dict( - ) + floating_ip_reference_deleted_model_json2 = floating_ip_reference_deleted_model.to_dict() assert floating_ip_reference_deleted_model_json2 == floating_ip_reference_deleted_model_json - class TestFloatingIPUnpaginatedCollection(): """ Test Class for FloatingIPUnpaginatedCollection @@ -24120,41 +25155,31 @@ def test_floating_ip_unpaginated_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - floating_ip_target_model = { - } # FloatingIPTargetNetworkInterfaceReference - floating_ip_target_model[ - 'deleted'] = network_interface_reference_deleted_model - floating_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + floating_ip_target_model['deleted'] = network_interface_reference_deleted_model + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' floating_ip_target_model['resource_type'] = 'network_interface' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - floating_ip_model = {} # FloatingIP + floating_ip_model = {} # FloatingIP floating_ip_model['address'] = '203.0.113.1' - floating_ip_model['created_at'] = '2020-01-28T18:40:40.123456Z' - floating_ip_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_model['name'] = 'my-floating-ip' floating_ip_model['resource_group'] = resource_group_reference_model @@ -24164,30 +25189,23 @@ def test_floating_ip_unpaginated_collection_serialization(self): # Construct a json representation of a FloatingIPUnpaginatedCollection model floating_ip_unpaginated_collection_model_json = {} - floating_ip_unpaginated_collection_model_json['floating_ips'] = [ - floating_ip_model - ] + floating_ip_unpaginated_collection_model_json['floating_ips'] = [floating_ip_model] # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation - floating_ip_unpaginated_collection_model = FloatingIPUnpaginatedCollection.from_dict( - floating_ip_unpaginated_collection_model_json) + floating_ip_unpaginated_collection_model = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json) assert floating_ip_unpaginated_collection_model != False # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation - floating_ip_unpaginated_collection_model_dict = FloatingIPUnpaginatedCollection.from_dict( - floating_ip_unpaginated_collection_model_json).__dict__ - floating_ip_unpaginated_collection_model2 = FloatingIPUnpaginatedCollection( - **floating_ip_unpaginated_collection_model_dict) + floating_ip_unpaginated_collection_model_dict = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json).__dict__ + floating_ip_unpaginated_collection_model2 = FloatingIPUnpaginatedCollection(**floating_ip_unpaginated_collection_model_dict) # Verify the model instances are equivalent assert floating_ip_unpaginated_collection_model == floating_ip_unpaginated_collection_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_unpaginated_collection_model_json2 = floating_ip_unpaginated_collection_model.to_dict( - ) + floating_ip_unpaginated_collection_model_json2 = floating_ip_unpaginated_collection_model.to_dict() assert floating_ip_unpaginated_collection_model_json2 == floating_ip_unpaginated_collection_model_json - class TestFlowLogCollector(): """ Test Class for FlowLogCollector @@ -24200,44 +25218,31 @@ def test_flow_log_collector_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - cloud_object_storage_bucket_reference_model = { - } # CloudObjectStorageBucketReference - cloud_object_storage_bucket_reference_model[ - 'name'] = 'bucket-27200-lwx4cfvcue' - - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - flow_log_collector_target_model = { - } # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext - flow_log_collector_target_model[ - 'deleted'] = network_interface_reference_target_context_deleted_model - flow_log_collector_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference + cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' + + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext + flow_log_collector_target_model['deleted'] = network_interface_reference_target_context_deleted_model + flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' flow_log_collector_target_model['name'] = 'my-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' @@ -24245,34 +25250,24 @@ def test_flow_log_collector_serialization(self): flow_log_collector_model_json = {} flow_log_collector_model_json['active'] = True flow_log_collector_model_json['auto_delete'] = True - flow_log_collector_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - flow_log_collector_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689' - flow_log_collector_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689' - flow_log_collector_model_json[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + flow_log_collector_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + flow_log_collector_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689' + flow_log_collector_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689' + flow_log_collector_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' flow_log_collector_model_json['lifecycle_state'] = 'stable' flow_log_collector_model_json['name'] = 'my-flow-log-collector' - flow_log_collector_model_json[ - 'resource_group'] = resource_group_reference_model - flow_log_collector_model_json[ - 'storage_bucket'] = cloud_object_storage_bucket_reference_model - flow_log_collector_model_json[ - 'target'] = flow_log_collector_target_model + flow_log_collector_model_json['resource_group'] = resource_group_reference_model + flow_log_collector_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model + flow_log_collector_model_json['target'] = flow_log_collector_target_model flow_log_collector_model_json['vpc'] = vpc_reference_model # Construct a model instance of FlowLogCollector by calling from_dict on the json representation - flow_log_collector_model = FlowLogCollector.from_dict( - flow_log_collector_model_json) + flow_log_collector_model = FlowLogCollector.from_dict(flow_log_collector_model_json) assert flow_log_collector_model != False # Construct a model instance of FlowLogCollector by calling from_dict on the json representation - flow_log_collector_model_dict = FlowLogCollector.from_dict( - flow_log_collector_model_json).__dict__ - flow_log_collector_model2 = FlowLogCollector( - **flow_log_collector_model_dict) + flow_log_collector_model_dict = FlowLogCollector.from_dict(flow_log_collector_model_json).__dict__ + flow_log_collector_model2 = FlowLogCollector(**flow_log_collector_model_dict) # Verify the model instances are equivalent assert flow_log_collector_model == flow_log_collector_model2 @@ -24281,7 +25276,6 @@ def test_flow_log_collector_serialization(self): flow_log_collector_model_json2 = flow_log_collector_model.to_dict() assert flow_log_collector_model_json2 == flow_log_collector_model_json - class TestFlowLogCollectorCollection(): """ Test Class for FlowLogCollectorCollection @@ -24294,107 +25288,77 @@ def test_flow_log_collector_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - flow_log_collector_collection_first_model = { - } # FlowLogCollectorCollectionFirst - flow_log_collector_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' + flow_log_collector_collection_first_model = {} # FlowLogCollectorCollectionFirst + flow_log_collector_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - cloud_object_storage_bucket_reference_model = { - } # CloudObjectStorageBucketReference - cloud_object_storage_bucket_reference_model[ - 'name'] = 'bucket-27200-lwx4cfvcue' - - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - flow_log_collector_target_model = { - } # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext - flow_log_collector_target_model[ - 'deleted'] = network_interface_reference_target_context_deleted_model - flow_log_collector_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference + cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' + + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext + flow_log_collector_target_model['deleted'] = network_interface_reference_target_context_deleted_model + flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' flow_log_collector_target_model['name'] = 'my-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - flow_log_collector_model = {} # FlowLogCollector + flow_log_collector_model = {} # FlowLogCollector flow_log_collector_model['active'] = True flow_log_collector_model['auto_delete'] = True - flow_log_collector_model['created_at'] = '2020-01-28T18:40:40.123456Z' - flow_log_collector_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689' - flow_log_collector_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689' + flow_log_collector_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + flow_log_collector_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689' + flow_log_collector_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689' flow_log_collector_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' flow_log_collector_model['lifecycle_state'] = 'stable' flow_log_collector_model['name'] = 'my-flow-log-collector' - flow_log_collector_model[ - 'resource_group'] = resource_group_reference_model - flow_log_collector_model[ - 'storage_bucket'] = cloud_object_storage_bucket_reference_model + flow_log_collector_model['resource_group'] = resource_group_reference_model + flow_log_collector_model['storage_bucket'] = cloud_object_storage_bucket_reference_model flow_log_collector_model['target'] = flow_log_collector_target_model flow_log_collector_model['vpc'] = vpc_reference_model - flow_log_collector_collection_next_model = { - } # FlowLogCollectorCollectionNext - flow_log_collector_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + flow_log_collector_collection_next_model = {} # FlowLogCollectorCollectionNext + flow_log_collector_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a FlowLogCollectorCollection model flow_log_collector_collection_model_json = {} - flow_log_collector_collection_model_json[ - 'first'] = flow_log_collector_collection_first_model - flow_log_collector_collection_model_json['flow_log_collectors'] = [ - flow_log_collector_model - ] + flow_log_collector_collection_model_json['first'] = flow_log_collector_collection_first_model + flow_log_collector_collection_model_json['flow_log_collectors'] = [flow_log_collector_model] flow_log_collector_collection_model_json['limit'] = 20 - flow_log_collector_collection_model_json[ - 'next'] = flow_log_collector_collection_next_model + flow_log_collector_collection_model_json['next'] = flow_log_collector_collection_next_model flow_log_collector_collection_model_json['total_count'] = 132 # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation - flow_log_collector_collection_model = FlowLogCollectorCollection.from_dict( - flow_log_collector_collection_model_json) + flow_log_collector_collection_model = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json) assert flow_log_collector_collection_model != False # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation - flow_log_collector_collection_model_dict = FlowLogCollectorCollection.from_dict( - flow_log_collector_collection_model_json).__dict__ - flow_log_collector_collection_model2 = FlowLogCollectorCollection( - **flow_log_collector_collection_model_dict) + flow_log_collector_collection_model_dict = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json).__dict__ + flow_log_collector_collection_model2 = FlowLogCollectorCollection(**flow_log_collector_collection_model_dict) # Verify the model instances are equivalent assert flow_log_collector_collection_model == flow_log_collector_collection_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_collection_model_json2 = flow_log_collector_collection_model.to_dict( - ) + flow_log_collector_collection_model_json2 = flow_log_collector_collection_model.to_dict() assert flow_log_collector_collection_model_json2 == flow_log_collector_collection_model_json - class TestFlowLogCollectorCollectionFirst(): """ Test Class for FlowLogCollectorCollectionFirst @@ -24407,29 +25371,23 @@ def test_flow_log_collector_collection_first_serialization(self): # Construct a json representation of a FlowLogCollectorCollectionFirst model flow_log_collector_collection_first_model_json = {} - flow_log_collector_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' + flow_log_collector_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation - flow_log_collector_collection_first_model = FlowLogCollectorCollectionFirst.from_dict( - flow_log_collector_collection_first_model_json) + flow_log_collector_collection_first_model = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json) assert flow_log_collector_collection_first_model != False # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation - flow_log_collector_collection_first_model_dict = FlowLogCollectorCollectionFirst.from_dict( - flow_log_collector_collection_first_model_json).__dict__ - flow_log_collector_collection_first_model2 = FlowLogCollectorCollectionFirst( - **flow_log_collector_collection_first_model_dict) + flow_log_collector_collection_first_model_dict = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json).__dict__ + flow_log_collector_collection_first_model2 = FlowLogCollectorCollectionFirst(**flow_log_collector_collection_first_model_dict) # Verify the model instances are equivalent assert flow_log_collector_collection_first_model == flow_log_collector_collection_first_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_collection_first_model_json2 = flow_log_collector_collection_first_model.to_dict( - ) + flow_log_collector_collection_first_model_json2 = flow_log_collector_collection_first_model.to_dict() assert flow_log_collector_collection_first_model_json2 == flow_log_collector_collection_first_model_json - class TestFlowLogCollectorCollectionNext(): """ Test Class for FlowLogCollectorCollectionNext @@ -24442,29 +25400,23 @@ def test_flow_log_collector_collection_next_serialization(self): # Construct a json representation of a FlowLogCollectorCollectionNext model flow_log_collector_collection_next_model_json = {} - flow_log_collector_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + flow_log_collector_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation - flow_log_collector_collection_next_model = FlowLogCollectorCollectionNext.from_dict( - flow_log_collector_collection_next_model_json) + flow_log_collector_collection_next_model = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json) assert flow_log_collector_collection_next_model != False # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation - flow_log_collector_collection_next_model_dict = FlowLogCollectorCollectionNext.from_dict( - flow_log_collector_collection_next_model_json).__dict__ - flow_log_collector_collection_next_model2 = FlowLogCollectorCollectionNext( - **flow_log_collector_collection_next_model_dict) + flow_log_collector_collection_next_model_dict = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json).__dict__ + flow_log_collector_collection_next_model2 = FlowLogCollectorCollectionNext(**flow_log_collector_collection_next_model_dict) # Verify the model instances are equivalent assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_collection_next_model_json2 = flow_log_collector_collection_next_model.to_dict( - ) + flow_log_collector_collection_next_model_json2 = flow_log_collector_collection_next_model.to_dict() assert flow_log_collector_collection_next_model_json2 == flow_log_collector_collection_next_model_json - class TestFlowLogCollectorPatch(): """ Test Class for FlowLogCollectorPatch @@ -24481,25 +25433,20 @@ def test_flow_log_collector_patch_serialization(self): flow_log_collector_patch_model_json['name'] = 'my-flow-log-collector' # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation - flow_log_collector_patch_model = FlowLogCollectorPatch.from_dict( - flow_log_collector_patch_model_json) + flow_log_collector_patch_model = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json) assert flow_log_collector_patch_model != False # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation - flow_log_collector_patch_model_dict = FlowLogCollectorPatch.from_dict( - flow_log_collector_patch_model_json).__dict__ - flow_log_collector_patch_model2 = FlowLogCollectorPatch( - **flow_log_collector_patch_model_dict) + flow_log_collector_patch_model_dict = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json).__dict__ + flow_log_collector_patch_model2 = FlowLogCollectorPatch(**flow_log_collector_patch_model_dict) # Verify the model instances are equivalent assert flow_log_collector_patch_model == flow_log_collector_patch_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_patch_model_json2 = flow_log_collector_patch_model.to_dict( - ) + flow_log_collector_patch_model_json2 = flow_log_collector_patch_model.to_dict() assert flow_log_collector_patch_model_json2 == flow_log_collector_patch_model_json - class TestIKEPolicy(): """ Test Class for IKEPolicy @@ -24512,41 +25459,29 @@ def test_ike_policy_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' # Construct a json representation of a IKEPolicy model ike_policy_model_json = {} ike_policy_model_json['authentication_algorithm'] = 'md5' - ike_policy_model_json['connections'] = [ - vpn_gateway_connection_reference_model - ] - ike_policy_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' + ike_policy_model_json['connections'] = [vpn_gateway_connection_reference_model] + ike_policy_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) ike_policy_model_json['dh_group'] = 2 ike_policy_model_json['encryption_algorithm'] = 'triple_des' - ike_policy_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_model_json['ike_version'] = 1 ike_policy_model_json['key_lifetime'] = 28800 @@ -24560,8 +25495,7 @@ def test_ike_policy_serialization(self): assert ike_policy_model != False # Construct a model instance of IKEPolicy by calling from_dict on the json representation - ike_policy_model_dict = IKEPolicy.from_dict( - ike_policy_model_json).__dict__ + ike_policy_model_dict = IKEPolicy.from_dict(ike_policy_model_json).__dict__ ike_policy_model2 = IKEPolicy(**ike_policy_model_dict) # Verify the model instances are equivalent @@ -24571,7 +25505,6 @@ def test_ike_policy_serialization(self): ike_policy_model_json2 = ike_policy_model.to_dict() assert ike_policy_model_json2 == ike_policy_model_json - class TestIKEPolicyCollection(): """ Test Class for IKEPolicyCollection @@ -24584,44 +25517,31 @@ def test_ike_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst - ike_policy_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' - - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst + ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' + + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - ike_policy_model = {} # IKEPolicy + ike_policy_model = {} # IKEPolicy ike_policy_model['authentication_algorithm'] = 'md5' - ike_policy_model['connections'] = [ - vpn_gateway_connection_reference_model - ] - ike_policy_model['created_at'] = '2020-01-28T18:40:40.123456Z' + ike_policy_model['connections'] = [vpn_gateway_connection_reference_model] + ike_policy_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) ike_policy_model['dh_group'] = 2 ike_policy_model['encryption_algorithm'] = 'triple_des' - ike_policy_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_model['ike_version'] = 1 ike_policy_model['key_lifetime'] = 28800 @@ -24630,40 +25550,32 @@ def test_ike_policy_collection_serialization(self): ike_policy_model['resource_group'] = resource_group_reference_model ike_policy_model['resource_type'] = 'ike_policy' - ike_policy_collection_next_model = {} # IKEPolicyCollectionNext - ike_policy_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + ike_policy_collection_next_model = {} # IKEPolicyCollectionNext + ike_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' # Construct a json representation of a IKEPolicyCollection model ike_policy_collection_model_json = {} - ike_policy_collection_model_json[ - 'first'] = ike_policy_collection_first_model + ike_policy_collection_model_json['first'] = ike_policy_collection_first_model ike_policy_collection_model_json['ike_policies'] = [ike_policy_model] ike_policy_collection_model_json['limit'] = 20 - ike_policy_collection_model_json[ - 'next'] = ike_policy_collection_next_model + ike_policy_collection_model_json['next'] = ike_policy_collection_next_model ike_policy_collection_model_json['total_count'] = 132 # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation - ike_policy_collection_model = IKEPolicyCollection.from_dict( - ike_policy_collection_model_json) + ike_policy_collection_model = IKEPolicyCollection.from_dict(ike_policy_collection_model_json) assert ike_policy_collection_model != False # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation - ike_policy_collection_model_dict = IKEPolicyCollection.from_dict( - ike_policy_collection_model_json).__dict__ - ike_policy_collection_model2 = IKEPolicyCollection( - **ike_policy_collection_model_dict) + ike_policy_collection_model_dict = IKEPolicyCollection.from_dict(ike_policy_collection_model_json).__dict__ + ike_policy_collection_model2 = IKEPolicyCollection(**ike_policy_collection_model_dict) # Verify the model instances are equivalent assert ike_policy_collection_model == ike_policy_collection_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_collection_model_json2 = ike_policy_collection_model.to_dict( - ) + ike_policy_collection_model_json2 = ike_policy_collection_model.to_dict() assert ike_policy_collection_model_json2 == ike_policy_collection_model_json - class TestIKEPolicyCollectionFirst(): """ Test Class for IKEPolicyCollectionFirst @@ -24676,29 +25588,23 @@ def test_ike_policy_collection_first_serialization(self): # Construct a json representation of a IKEPolicyCollectionFirst model ike_policy_collection_first_model_json = {} - ike_policy_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' + ike_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation - ike_policy_collection_first_model = IKEPolicyCollectionFirst.from_dict( - ike_policy_collection_first_model_json) + ike_policy_collection_first_model = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json) assert ike_policy_collection_first_model != False # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation - ike_policy_collection_first_model_dict = IKEPolicyCollectionFirst.from_dict( - ike_policy_collection_first_model_json).__dict__ - ike_policy_collection_first_model2 = IKEPolicyCollectionFirst( - **ike_policy_collection_first_model_dict) + ike_policy_collection_first_model_dict = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json).__dict__ + ike_policy_collection_first_model2 = IKEPolicyCollectionFirst(**ike_policy_collection_first_model_dict) # Verify the model instances are equivalent assert ike_policy_collection_first_model == ike_policy_collection_first_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_collection_first_model_json2 = ike_policy_collection_first_model.to_dict( - ) + ike_policy_collection_first_model_json2 = ike_policy_collection_first_model.to_dict() assert ike_policy_collection_first_model_json2 == ike_policy_collection_first_model_json - class TestIKEPolicyCollectionNext(): """ Test Class for IKEPolicyCollectionNext @@ -24711,29 +25617,23 @@ def test_ike_policy_collection_next_serialization(self): # Construct a json representation of a IKEPolicyCollectionNext model ike_policy_collection_next_model_json = {} - ike_policy_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + ike_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation - ike_policy_collection_next_model = IKEPolicyCollectionNext.from_dict( - ike_policy_collection_next_model_json) + ike_policy_collection_next_model = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json) assert ike_policy_collection_next_model != False # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation - ike_policy_collection_next_model_dict = IKEPolicyCollectionNext.from_dict( - ike_policy_collection_next_model_json).__dict__ - ike_policy_collection_next_model2 = IKEPolicyCollectionNext( - **ike_policy_collection_next_model_dict) + ike_policy_collection_next_model_dict = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json).__dict__ + ike_policy_collection_next_model2 = IKEPolicyCollectionNext(**ike_policy_collection_next_model_dict) # Verify the model instances are equivalent assert ike_policy_collection_next_model == ike_policy_collection_next_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_collection_next_model_json2 = ike_policy_collection_next_model.to_dict( - ) + ike_policy_collection_next_model_json2 = ike_policy_collection_next_model.to_dict() assert ike_policy_collection_next_model_json2 == ike_policy_collection_next_model_json - class TestIKEPolicyPatch(): """ Test Class for IKEPolicyPatch @@ -24754,13 +25654,11 @@ def test_ike_policy_patch_serialization(self): ike_policy_patch_model_json['name'] = 'my-ike-policy' # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation - ike_policy_patch_model = IKEPolicyPatch.from_dict( - ike_policy_patch_model_json) + ike_policy_patch_model = IKEPolicyPatch.from_dict(ike_policy_patch_model_json) assert ike_policy_patch_model != False # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation - ike_policy_patch_model_dict = IKEPolicyPatch.from_dict( - ike_policy_patch_model_json).__dict__ + ike_policy_patch_model_dict = IKEPolicyPatch.from_dict(ike_policy_patch_model_json).__dict__ ike_policy_patch_model2 = IKEPolicyPatch(**ike_policy_patch_model_dict) # Verify the model instances are equivalent @@ -24770,7 +25668,6 @@ def test_ike_policy_patch_serialization(self): ike_policy_patch_model_json2 = ike_policy_patch_model.to_dict() assert ike_policy_patch_model_json2 == ike_policy_patch_model_json - class TestIKEPolicyReference(): """ Test Class for IKEPolicyReference @@ -24783,31 +25680,24 @@ def test_ike_policy_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted - ike_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted + ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a IKEPolicyReference model ike_policy_reference_model_json = {} - ike_policy_reference_model_json[ - 'deleted'] = ike_policy_reference_deleted_model - ike_policy_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - ike_policy_reference_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_model_json['deleted'] = ike_policy_reference_deleted_model + ike_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_reference_model_json['name'] = 'my-ike-policy' ike_policy_reference_model_json['resource_type'] = 'ike_policy' # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation - ike_policy_reference_model = IKEPolicyReference.from_dict( - ike_policy_reference_model_json) + ike_policy_reference_model = IKEPolicyReference.from_dict(ike_policy_reference_model_json) assert ike_policy_reference_model != False # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation - ike_policy_reference_model_dict = IKEPolicyReference.from_dict( - ike_policy_reference_model_json).__dict__ - ike_policy_reference_model2 = IKEPolicyReference( - **ike_policy_reference_model_dict) + ike_policy_reference_model_dict = IKEPolicyReference.from_dict(ike_policy_reference_model_json).__dict__ + ike_policy_reference_model2 = IKEPolicyReference(**ike_policy_reference_model_dict) # Verify the model instances are equivalent assert ike_policy_reference_model == ike_policy_reference_model2 @@ -24816,7 +25706,6 @@ def test_ike_policy_reference_serialization(self): ike_policy_reference_model_json2 = ike_policy_reference_model.to_dict() assert ike_policy_reference_model_json2 == ike_policy_reference_model_json - class TestIKEPolicyReferenceDeleted(): """ Test Class for IKEPolicyReferenceDeleted @@ -24829,29 +25718,23 @@ def test_ike_policy_reference_deleted_serialization(self): # Construct a json representation of a IKEPolicyReferenceDeleted model ike_policy_reference_deleted_model_json = {} - ike_policy_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + ike_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation - ike_policy_reference_deleted_model = IKEPolicyReferenceDeleted.from_dict( - ike_policy_reference_deleted_model_json) + ike_policy_reference_deleted_model = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json) assert ike_policy_reference_deleted_model != False # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation - ike_policy_reference_deleted_model_dict = IKEPolicyReferenceDeleted.from_dict( - ike_policy_reference_deleted_model_json).__dict__ - ike_policy_reference_deleted_model2 = IKEPolicyReferenceDeleted( - **ike_policy_reference_deleted_model_dict) + ike_policy_reference_deleted_model_dict = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json).__dict__ + ike_policy_reference_deleted_model2 = IKEPolicyReferenceDeleted(**ike_policy_reference_deleted_model_dict) # Verify the model instances are equivalent assert ike_policy_reference_deleted_model == ike_policy_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_reference_deleted_model_json2 = ike_policy_reference_deleted_model.to_dict( - ) + ike_policy_reference_deleted_model_json2 = ike_policy_reference_deleted_model.to_dict() assert ike_policy_reference_deleted_model_json2 == ike_policy_reference_deleted_model_json - class TestIP(): """ Test Class for IP @@ -24881,7 +25764,6 @@ def test_ip_serialization(self): ip_model_json2 = ip_model.to_dict() assert ip_model_json2 == ip_model_json - class TestIPsecPolicy(): """ Test Class for IPsecPolicy @@ -24894,47 +25776,34 @@ def test_i_psec_policy_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' # Construct a json representation of a IPsecPolicy model i_psec_policy_model_json = {} i_psec_policy_model_json['authentication_algorithm'] = 'md5' - i_psec_policy_model_json['connections'] = [ - vpn_gateway_connection_reference_model - ] - i_psec_policy_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' + i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model] + i_psec_policy_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) i_psec_policy_model_json['encapsulation_mode'] = 'tunnel' i_psec_policy_model_json['encryption_algorithm'] = 'triple_des' - i_psec_policy_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_model_json['key_lifetime'] = 3600 i_psec_policy_model_json['name'] = 'my-ipsec-policy' i_psec_policy_model_json['pfs'] = 'disabled' - i_psec_policy_model_json[ - 'resource_group'] = resource_group_reference_model + i_psec_policy_model_json['resource_group'] = resource_group_reference_model i_psec_policy_model_json['resource_type'] = 'ipsec_policy' i_psec_policy_model_json['transform_protocol'] = 'esp' @@ -24943,8 +25812,7 @@ def test_i_psec_policy_serialization(self): assert i_psec_policy_model != False # Construct a model instance of IPsecPolicy by calling from_dict on the json representation - i_psec_policy_model_dict = IPsecPolicy.from_dict( - i_psec_policy_model_json).__dict__ + i_psec_policy_model_dict = IPsecPolicy.from_dict(i_psec_policy_model_json).__dict__ i_psec_policy_model2 = IPsecPolicy(**i_psec_policy_model_dict) # Verify the model instances are equivalent @@ -24954,7 +25822,6 @@ def test_i_psec_policy_serialization(self): i_psec_policy_model_json2 = i_psec_policy_model.to_dict() assert i_psec_policy_model_json2 == i_psec_policy_model_json - class TestIPsecPolicyCollection(): """ Test Class for IPsecPolicyCollection @@ -24967,44 +25834,31 @@ def test_i_psec_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - i_psec_policy_collection_first_model = {} # IPsecPolicyCollectionFirst - i_psec_policy_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' - - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + i_psec_policy_collection_first_model = {} # IPsecPolicyCollectionFirst + i_psec_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' + + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - i_psec_policy_model = {} # IPsecPolicy + i_psec_policy_model = {} # IPsecPolicy i_psec_policy_model['authentication_algorithm'] = 'md5' - i_psec_policy_model['connections'] = [ - vpn_gateway_connection_reference_model - ] - i_psec_policy_model['created_at'] = '2020-01-28T18:40:40.123456Z' + i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model] + i_psec_policy_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) i_psec_policy_model['encapsulation_mode'] = 'tunnel' i_psec_policy_model['encryption_algorithm'] = 'triple_des' - i_psec_policy_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_model['key_lifetime'] = 3600 i_psec_policy_model['name'] = 'my-ipsec-policy' @@ -25013,42 +25867,32 @@ def test_i_psec_policy_collection_serialization(self): i_psec_policy_model['resource_type'] = 'ipsec_policy' i_psec_policy_model['transform_protocol'] = 'esp' - i_psec_policy_collection_next_model = {} # IPsecPolicyCollectionNext - i_psec_policy_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + i_psec_policy_collection_next_model = {} # IPsecPolicyCollectionNext + i_psec_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' # Construct a json representation of a IPsecPolicyCollection model i_psec_policy_collection_model_json = {} - i_psec_policy_collection_model_json[ - 'first'] = i_psec_policy_collection_first_model - i_psec_policy_collection_model_json['ipsec_policies'] = [ - i_psec_policy_model - ] + i_psec_policy_collection_model_json['first'] = i_psec_policy_collection_first_model + i_psec_policy_collection_model_json['ipsec_policies'] = [i_psec_policy_model] i_psec_policy_collection_model_json['limit'] = 20 - i_psec_policy_collection_model_json[ - 'next'] = i_psec_policy_collection_next_model + i_psec_policy_collection_model_json['next'] = i_psec_policy_collection_next_model i_psec_policy_collection_model_json['total_count'] = 132 # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation - i_psec_policy_collection_model = IPsecPolicyCollection.from_dict( - i_psec_policy_collection_model_json) + i_psec_policy_collection_model = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json) assert i_psec_policy_collection_model != False # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation - i_psec_policy_collection_model_dict = IPsecPolicyCollection.from_dict( - i_psec_policy_collection_model_json).__dict__ - i_psec_policy_collection_model2 = IPsecPolicyCollection( - **i_psec_policy_collection_model_dict) + i_psec_policy_collection_model_dict = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json).__dict__ + i_psec_policy_collection_model2 = IPsecPolicyCollection(**i_psec_policy_collection_model_dict) # Verify the model instances are equivalent assert i_psec_policy_collection_model == i_psec_policy_collection_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_collection_model_json2 = i_psec_policy_collection_model.to_dict( - ) + i_psec_policy_collection_model_json2 = i_psec_policy_collection_model.to_dict() assert i_psec_policy_collection_model_json2 == i_psec_policy_collection_model_json - class TestIPsecPolicyCollectionFirst(): """ Test Class for IPsecPolicyCollectionFirst @@ -25061,29 +25905,23 @@ def test_i_psec_policy_collection_first_serialization(self): # Construct a json representation of a IPsecPolicyCollectionFirst model i_psec_policy_collection_first_model_json = {} - i_psec_policy_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' + i_psec_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation - i_psec_policy_collection_first_model = IPsecPolicyCollectionFirst.from_dict( - i_psec_policy_collection_first_model_json) + i_psec_policy_collection_first_model = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json) assert i_psec_policy_collection_first_model != False # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation - i_psec_policy_collection_first_model_dict = IPsecPolicyCollectionFirst.from_dict( - i_psec_policy_collection_first_model_json).__dict__ - i_psec_policy_collection_first_model2 = IPsecPolicyCollectionFirst( - **i_psec_policy_collection_first_model_dict) + i_psec_policy_collection_first_model_dict = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json).__dict__ + i_psec_policy_collection_first_model2 = IPsecPolicyCollectionFirst(**i_psec_policy_collection_first_model_dict) # Verify the model instances are equivalent assert i_psec_policy_collection_first_model == i_psec_policy_collection_first_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_collection_first_model_json2 = i_psec_policy_collection_first_model.to_dict( - ) + i_psec_policy_collection_first_model_json2 = i_psec_policy_collection_first_model.to_dict() assert i_psec_policy_collection_first_model_json2 == i_psec_policy_collection_first_model_json - class TestIPsecPolicyCollectionNext(): """ Test Class for IPsecPolicyCollectionNext @@ -25096,29 +25934,23 @@ def test_i_psec_policy_collection_next_serialization(self): # Construct a json representation of a IPsecPolicyCollectionNext model i_psec_policy_collection_next_model_json = {} - i_psec_policy_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + i_psec_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation - i_psec_policy_collection_next_model = IPsecPolicyCollectionNext.from_dict( - i_psec_policy_collection_next_model_json) + i_psec_policy_collection_next_model = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json) assert i_psec_policy_collection_next_model != False # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation - i_psec_policy_collection_next_model_dict = IPsecPolicyCollectionNext.from_dict( - i_psec_policy_collection_next_model_json).__dict__ - i_psec_policy_collection_next_model2 = IPsecPolicyCollectionNext( - **i_psec_policy_collection_next_model_dict) + i_psec_policy_collection_next_model_dict = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json).__dict__ + i_psec_policy_collection_next_model2 = IPsecPolicyCollectionNext(**i_psec_policy_collection_next_model_dict) # Verify the model instances are equivalent assert i_psec_policy_collection_next_model == i_psec_policy_collection_next_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_collection_next_model_json2 = i_psec_policy_collection_next_model.to_dict( - ) + i_psec_policy_collection_next_model_json2 = i_psec_policy_collection_next_model.to_dict() assert i_psec_policy_collection_next_model_json2 == i_psec_policy_collection_next_model_json - class TestIPsecPolicyPatch(): """ Test Class for IPsecPolicyPatch @@ -25138,15 +25970,12 @@ def test_i_psec_policy_patch_serialization(self): i_psec_policy_patch_model_json['pfs'] = 'disabled' # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation - i_psec_policy_patch_model = IPsecPolicyPatch.from_dict( - i_psec_policy_patch_model_json) + i_psec_policy_patch_model = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json) assert i_psec_policy_patch_model != False # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation - i_psec_policy_patch_model_dict = IPsecPolicyPatch.from_dict( - i_psec_policy_patch_model_json).__dict__ - i_psec_policy_patch_model2 = IPsecPolicyPatch( - **i_psec_policy_patch_model_dict) + i_psec_policy_patch_model_dict = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json).__dict__ + i_psec_policy_patch_model2 = IPsecPolicyPatch(**i_psec_policy_patch_model_dict) # Verify the model instances are equivalent assert i_psec_policy_patch_model == i_psec_policy_patch_model2 @@ -25155,7 +25984,6 @@ def test_i_psec_policy_patch_serialization(self): i_psec_policy_patch_model_json2 = i_psec_policy_patch_model.to_dict() assert i_psec_policy_patch_model_json2 == i_psec_policy_patch_model_json - class TestIPsecPolicyReference(): """ Test Class for IPsecPolicyReference @@ -25168,42 +25996,32 @@ def test_i_psec_policy_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - i_psec_policy_reference_deleted_model = { - } # IPsecPolicyReferenceDeleted - i_psec_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted + i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a IPsecPolicyReference model i_psec_policy_reference_model_json = {} - i_psec_policy_reference_model_json[ - 'deleted'] = i_psec_policy_reference_deleted_model - i_psec_policy_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_reference_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_model_json['deleted'] = i_psec_policy_reference_deleted_model + i_psec_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_reference_model_json['name'] = 'my-ipsec-policy' i_psec_policy_reference_model_json['resource_type'] = 'ipsec_policy' # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation - i_psec_policy_reference_model = IPsecPolicyReference.from_dict( - i_psec_policy_reference_model_json) + i_psec_policy_reference_model = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json) assert i_psec_policy_reference_model != False # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation - i_psec_policy_reference_model_dict = IPsecPolicyReference.from_dict( - i_psec_policy_reference_model_json).__dict__ - i_psec_policy_reference_model2 = IPsecPolicyReference( - **i_psec_policy_reference_model_dict) + i_psec_policy_reference_model_dict = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json).__dict__ + i_psec_policy_reference_model2 = IPsecPolicyReference(**i_psec_policy_reference_model_dict) # Verify the model instances are equivalent assert i_psec_policy_reference_model == i_psec_policy_reference_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_reference_model_json2 = i_psec_policy_reference_model.to_dict( - ) + i_psec_policy_reference_model_json2 = i_psec_policy_reference_model.to_dict() assert i_psec_policy_reference_model_json2 == i_psec_policy_reference_model_json - class TestIPsecPolicyReferenceDeleted(): """ Test Class for IPsecPolicyReferenceDeleted @@ -25216,29 +26034,23 @@ def test_i_psec_policy_reference_deleted_serialization(self): # Construct a json representation of a IPsecPolicyReferenceDeleted model i_psec_policy_reference_deleted_model_json = {} - i_psec_policy_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + i_psec_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation - i_psec_policy_reference_deleted_model = IPsecPolicyReferenceDeleted.from_dict( - i_psec_policy_reference_deleted_model_json) + i_psec_policy_reference_deleted_model = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json) assert i_psec_policy_reference_deleted_model != False # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation - i_psec_policy_reference_deleted_model_dict = IPsecPolicyReferenceDeleted.from_dict( - i_psec_policy_reference_deleted_model_json).__dict__ - i_psec_policy_reference_deleted_model2 = IPsecPolicyReferenceDeleted( - **i_psec_policy_reference_deleted_model_dict) + i_psec_policy_reference_deleted_model_dict = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json).__dict__ + i_psec_policy_reference_deleted_model2 = IPsecPolicyReferenceDeleted(**i_psec_policy_reference_deleted_model_dict) # Verify the model instances are equivalent assert i_psec_policy_reference_deleted_model == i_psec_policy_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_reference_deleted_model_json2 = i_psec_policy_reference_deleted_model.to_dict( - ) + i_psec_policy_reference_deleted_model_json2 = i_psec_policy_reference_deleted_model.to_dict() assert i_psec_policy_reference_deleted_model_json2 == i_psec_policy_reference_deleted_model_json - class TestImage(): """ Test Class for Image @@ -25251,51 +26063,44 @@ def test_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - image_file_checksums_model = {} # ImageFileChecksums - image_file_checksums_model[ - 'sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' + image_file_checksums_model = {} # ImageFileChecksums + image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' - image_file_model = {} # ImageFile + image_file_model = {} # ImageFile image_file_model['checksums'] = image_file_checksums_model image_file_model['size'] = 1 - operating_system_model = {} # OperatingSystem + operating_system_model = {} # OperatingSystem operating_system_model['architecture'] = 'amd64' + operating_system_model['dedicated_host_only'] = False operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64' operating_system_model['family'] = 'Ubuntu Server' - operating_system_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' + operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_model['name'] = 'ubuntu-16-amd64' operating_system_model['vendor'] = 'Canonical' operating_system_model['version'] = '16.04 LTS' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - image_status_reason_model = {} # ImageStatusReason + image_status_reason_model = {} # ImageStatusReason image_status_reason_model['code'] = 'encryption_key_deleted' image_status_reason_model['message'] = 'testString' - image_status_reason_model[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' # Construct a json representation of a Image model image_model_json = {} - image_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - image_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model_json['encryption'] = 'user_managed' image_model_json['encryption_key'] = encryption_key_reference_model image_model_json['file'] = image_file_model - image_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model_json['minimum_provisioned_size'] = 38 image_model_json['name'] = 'my-image' @@ -25320,7 +26125,6 @@ def test_image_serialization(self): image_model_json2 = image_model.to_dict() assert image_model_json2 == image_model_json - class TestImageCollection(): """ Test Class for ImageCollection @@ -25333,54 +26137,46 @@ def test_image_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - image_collection_first_model = {} # ImageCollectionFirst - image_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' + image_collection_first_model = {} # ImageCollectionFirst + image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - image_file_checksums_model = {} # ImageFileChecksums - image_file_checksums_model[ - 'sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' + image_file_checksums_model = {} # ImageFileChecksums + image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' - image_file_model = {} # ImageFile + image_file_model = {} # ImageFile image_file_model['checksums'] = image_file_checksums_model image_file_model['size'] = 1 - operating_system_model = {} # OperatingSystem + operating_system_model = {} # OperatingSystem operating_system_model['architecture'] = 'amd64' + operating_system_model['dedicated_host_only'] = False operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64' operating_system_model['family'] = 'Ubuntu Server' - operating_system_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' + operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_model['name'] = 'ubuntu-16-amd64' operating_system_model['vendor'] = 'Canonical' operating_system_model['version'] = '16.04 LTS' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - image_status_reason_model = {} # ImageStatusReason + image_status_reason_model = {} # ImageStatusReason image_status_reason_model['code'] = 'encryption_key_deleted' image_status_reason_model['message'] = 'testString' - image_status_reason_model[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' - image_model = {} # Image - image_model['created_at'] = '2020-01-28T18:40:40.123456Z' - image_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model = {} # Image + image_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model['encryption'] = 'user_managed' image_model['encryption_key'] = encryption_key_reference_model image_model['file'] = image_file_model - image_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model['minimum_provisioned_size'] = 38 image_model['name'] = 'my-image' @@ -25390,9 +26186,8 @@ def test_image_collection_serialization(self): image_model['status_reasons'] = [image_status_reason_model] image_model['visibility'] = 'private' - image_collection_next_model = {} # ImageCollectionNext - image_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + image_collection_next_model = {} # ImageCollectionNext + image_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a ImageCollection model image_collection_model_json = {} @@ -25402,13 +26197,11 @@ def test_image_collection_serialization(self): image_collection_model_json['next'] = image_collection_next_model # Construct a model instance of ImageCollection by calling from_dict on the json representation - image_collection_model = ImageCollection.from_dict( - image_collection_model_json) + image_collection_model = ImageCollection.from_dict(image_collection_model_json) assert image_collection_model != False # Construct a model instance of ImageCollection by calling from_dict on the json representation - image_collection_model_dict = ImageCollection.from_dict( - image_collection_model_json).__dict__ + image_collection_model_dict = ImageCollection.from_dict(image_collection_model_json).__dict__ image_collection_model2 = ImageCollection(**image_collection_model_dict) # Verify the model instances are equivalent @@ -25418,7 +26211,6 @@ def test_image_collection_serialization(self): image_collection_model_json2 = image_collection_model.to_dict() assert image_collection_model_json2 == image_collection_model_json - class TestImageCollectionFirst(): """ Test Class for ImageCollectionFirst @@ -25431,29 +26223,23 @@ def test_image_collection_first_serialization(self): # Construct a json representation of a ImageCollectionFirst model image_collection_first_model_json = {} - image_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' + image_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation - image_collection_first_model = ImageCollectionFirst.from_dict( - image_collection_first_model_json) + image_collection_first_model = ImageCollectionFirst.from_dict(image_collection_first_model_json) assert image_collection_first_model != False # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation - image_collection_first_model_dict = ImageCollectionFirst.from_dict( - image_collection_first_model_json).__dict__ - image_collection_first_model2 = ImageCollectionFirst( - **image_collection_first_model_dict) + image_collection_first_model_dict = ImageCollectionFirst.from_dict(image_collection_first_model_json).__dict__ + image_collection_first_model2 = ImageCollectionFirst(**image_collection_first_model_dict) # Verify the model instances are equivalent assert image_collection_first_model == image_collection_first_model2 # Convert model instance back to dict and verify no loss of data - image_collection_first_model_json2 = image_collection_first_model.to_dict( - ) + image_collection_first_model_json2 = image_collection_first_model.to_dict() assert image_collection_first_model_json2 == image_collection_first_model_json - class TestImageCollectionNext(): """ Test Class for ImageCollectionNext @@ -25466,29 +26252,23 @@ def test_image_collection_next_serialization(self): # Construct a json representation of a ImageCollectionNext model image_collection_next_model_json = {} - image_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + image_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation - image_collection_next_model = ImageCollectionNext.from_dict( - image_collection_next_model_json) + image_collection_next_model = ImageCollectionNext.from_dict(image_collection_next_model_json) assert image_collection_next_model != False # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation - image_collection_next_model_dict = ImageCollectionNext.from_dict( - image_collection_next_model_json).__dict__ - image_collection_next_model2 = ImageCollectionNext( - **image_collection_next_model_dict) + image_collection_next_model_dict = ImageCollectionNext.from_dict(image_collection_next_model_json).__dict__ + image_collection_next_model2 = ImageCollectionNext(**image_collection_next_model_dict) # Verify the model instances are equivalent assert image_collection_next_model == image_collection_next_model2 # Convert model instance back to dict and verify no loss of data - image_collection_next_model_json2 = image_collection_next_model.to_dict( - ) + image_collection_next_model_json2 = image_collection_next_model.to_dict() assert image_collection_next_model_json2 == image_collection_next_model_json - class TestImageFile(): """ Test Class for ImageFile @@ -25501,9 +26281,8 @@ def test_image_file_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - image_file_checksums_model = {} # ImageFileChecksums - image_file_checksums_model[ - 'sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' + image_file_checksums_model = {} # ImageFileChecksums + image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' # Construct a json representation of a ImageFile model image_file_model_json = {} @@ -25515,8 +26294,7 @@ def test_image_file_serialization(self): assert image_file_model != False # Construct a model instance of ImageFile by calling from_dict on the json representation - image_file_model_dict = ImageFile.from_dict( - image_file_model_json).__dict__ + image_file_model_dict = ImageFile.from_dict(image_file_model_json).__dict__ image_file_model2 = ImageFile(**image_file_model_dict) # Verify the model instances are equivalent @@ -25526,7 +26304,6 @@ def test_image_file_serialization(self): image_file_model_json2 = image_file_model.to_dict() assert image_file_model_json2 == image_file_model_json - class TestImageFileChecksums(): """ Test Class for ImageFileChecksums @@ -25539,19 +26316,15 @@ def test_image_file_checksums_serialization(self): # Construct a json representation of a ImageFileChecksums model image_file_checksums_model_json = {} - image_file_checksums_model_json[ - 'sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' + image_file_checksums_model_json['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15' # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation - image_file_checksums_model = ImageFileChecksums.from_dict( - image_file_checksums_model_json) + image_file_checksums_model = ImageFileChecksums.from_dict(image_file_checksums_model_json) assert image_file_checksums_model != False # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation - image_file_checksums_model_dict = ImageFileChecksums.from_dict( - image_file_checksums_model_json).__dict__ - image_file_checksums_model2 = ImageFileChecksums( - **image_file_checksums_model_dict) + image_file_checksums_model_dict = ImageFileChecksums.from_dict(image_file_checksums_model_json).__dict__ + image_file_checksums_model2 = ImageFileChecksums(**image_file_checksums_model_dict) # Verify the model instances are equivalent assert image_file_checksums_model == image_file_checksums_model2 @@ -25560,7 +26333,6 @@ def test_image_file_checksums_serialization(self): image_file_checksums_model_json2 = image_file_checksums_model.to_dict() assert image_file_checksums_model_json2 == image_file_checksums_model_json - class TestImageFilePrototype(): """ Test Class for ImageFilePrototype @@ -25573,19 +26345,15 @@ def test_image_file_prototype_serialization(self): # Construct a json representation of a ImageFilePrototype model image_file_prototype_model_json = {} - image_file_prototype_model_json[ - 'href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd' + image_file_prototype_model_json['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd' # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation - image_file_prototype_model = ImageFilePrototype.from_dict( - image_file_prototype_model_json) + image_file_prototype_model = ImageFilePrototype.from_dict(image_file_prototype_model_json) assert image_file_prototype_model != False # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation - image_file_prototype_model_dict = ImageFilePrototype.from_dict( - image_file_prototype_model_json).__dict__ - image_file_prototype_model2 = ImageFilePrototype( - **image_file_prototype_model_dict) + image_file_prototype_model_dict = ImageFilePrototype.from_dict(image_file_prototype_model_json).__dict__ + image_file_prototype_model2 = ImageFilePrototype(**image_file_prototype_model_dict) # Verify the model instances are equivalent assert image_file_prototype_model == image_file_prototype_model2 @@ -25594,7 +26362,6 @@ def test_image_file_prototype_serialization(self): image_file_prototype_model_json2 = image_file_prototype_model.to_dict() assert image_file_prototype_model_json2 == image_file_prototype_model_json - class TestImagePatch(): """ Test Class for ImagePatch @@ -25614,8 +26381,7 @@ def test_image_patch_serialization(self): assert image_patch_model != False # Construct a model instance of ImagePatch by calling from_dict on the json representation - image_patch_model_dict = ImagePatch.from_dict( - image_patch_model_json).__dict__ + image_patch_model_dict = ImagePatch.from_dict(image_patch_model_json).__dict__ image_patch_model2 = ImagePatch(**image_patch_model_dict) # Verify the model instances are equivalent @@ -25625,7 +26391,6 @@ def test_image_patch_serialization(self): image_patch_model_json2 = image_patch_model.to_dict() assert image_patch_model_json2 == image_patch_model_json - class TestImageReference(): """ Test Class for ImageReference @@ -25638,29 +26403,23 @@ def test_image_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - image_reference_deleted_model = {} # ImageReferenceDeleted - image_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + image_reference_deleted_model = {} # ImageReferenceDeleted + image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a ImageReference model image_reference_model_json = {} - image_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model_json['deleted'] = image_reference_deleted_model - image_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - image_reference_model_json[ - 'id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model_json['name'] = 'my-image' # Construct a model instance of ImageReference by calling from_dict on the json representation - image_reference_model = ImageReference.from_dict( - image_reference_model_json) + image_reference_model = ImageReference.from_dict(image_reference_model_json) assert image_reference_model != False # Construct a model instance of ImageReference by calling from_dict on the json representation - image_reference_model_dict = ImageReference.from_dict( - image_reference_model_json).__dict__ + image_reference_model_dict = ImageReference.from_dict(image_reference_model_json).__dict__ image_reference_model2 = ImageReference(**image_reference_model_dict) # Verify the model instances are equivalent @@ -25670,7 +26429,6 @@ def test_image_reference_serialization(self): image_reference_model_json2 = image_reference_model.to_dict() assert image_reference_model_json2 == image_reference_model_json - class TestImageReferenceDeleted(): """ Test Class for ImageReferenceDeleted @@ -25683,29 +26441,23 @@ def test_image_reference_deleted_serialization(self): # Construct a json representation of a ImageReferenceDeleted model image_reference_deleted_model_json = {} - image_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + image_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation - image_reference_deleted_model = ImageReferenceDeleted.from_dict( - image_reference_deleted_model_json) + image_reference_deleted_model = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json) assert image_reference_deleted_model != False # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation - image_reference_deleted_model_dict = ImageReferenceDeleted.from_dict( - image_reference_deleted_model_json).__dict__ - image_reference_deleted_model2 = ImageReferenceDeleted( - **image_reference_deleted_model_dict) + image_reference_deleted_model_dict = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json).__dict__ + image_reference_deleted_model2 = ImageReferenceDeleted(**image_reference_deleted_model_dict) # Verify the model instances are equivalent assert image_reference_deleted_model == image_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict( - ) + image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict() assert image_reference_deleted_model_json2 == image_reference_deleted_model_json - class TestImageStatusReason(): """ Test Class for ImageStatusReason @@ -25720,19 +26472,15 @@ def test_image_status_reason_serialization(self): image_status_reason_model_json = {} image_status_reason_model_json['code'] = 'encryption_key_deleted' image_status_reason_model_json['message'] = 'testString' - image_status_reason_model_json[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + image_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' # Construct a model instance of ImageStatusReason by calling from_dict on the json representation - image_status_reason_model = ImageStatusReason.from_dict( - image_status_reason_model_json) + image_status_reason_model = ImageStatusReason.from_dict(image_status_reason_model_json) assert image_status_reason_model != False # Construct a model instance of ImageStatusReason by calling from_dict on the json representation - image_status_reason_model_dict = ImageStatusReason.from_dict( - image_status_reason_model_json).__dict__ - image_status_reason_model2 = ImageStatusReason( - **image_status_reason_model_dict) + image_status_reason_model_dict = ImageStatusReason.from_dict(image_status_reason_model_json).__dict__ + image_status_reason_model2 = ImageStatusReason(**image_status_reason_model_dict) # Verify the model instances are equivalent assert image_status_reason_model == image_status_reason_model2 @@ -25741,7 +26489,6 @@ def test_image_status_reason_serialization(self): image_status_reason_model_json2 = image_status_reason_model.to_dict() assert image_status_reason_model_json2 == image_status_reason_model_json - class TestInstance(): """ Test Class for Instance @@ -25754,158 +26501,130 @@ def test_instance_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_reference_instance_context_deleted_model = { - } # VolumeAttachmentReferenceInstanceContextDeleted - volume_attachment_reference_instance_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted + volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_reference_model = {} # VolumeReference - volume_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model = {} # VolumeReference + volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['deleted'] = volume_reference_deleted_model - volume_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['name'] = 'my-volume' - volume_attachment_reference_instance_context_model = { - } # VolumeAttachmentReferenceInstanceContext - volume_attachment_reference_instance_context_model[ - 'deleted'] = volume_attachment_reference_instance_context_deleted_model - volume_attachment_reference_instance_context_model[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_reference_instance_context_model[ - 'volume'] = volume_reference_model - - instance_gpu_model = {} # InstanceGPU + volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext + volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model + volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model + volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_reference_instance_context_model['volume'] = volume_reference_model + + instance_disk_model = {} # InstanceDisk + instance_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['interface_type'] = 'virtio_blk' + instance_disk_model['name'] = 'my-instance-disk' + instance_disk_model['resource_type'] = 'instance_disk' + instance_disk_model['size'] = 100 + + instance_gpu_model = {} # InstanceGPU instance_gpu_model['count'] = 1 instance_gpu_model['manufacturer'] = 'nvidia' instance_gpu_model['memory'] = 1 instance_gpu_model['model'] = 'Tesla V100' - image_reference_deleted_model = {} # ImageReferenceDeleted - image_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + image_reference_deleted_model = {} # ImageReferenceDeleted + image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - image_reference_model = {} # ImageReference - image_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model = {} # ImageReference + image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['deleted'] = image_reference_deleted_model - image_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['name'] = 'my-image' - network_interface_instance_context_reference_deleted_model = { - } # NetworkInterfaceInstanceContextReferenceDeleted - network_interface_instance_context_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted + network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - network_interface_instance_context_reference_model = { - } # NetworkInterfaceInstanceContextReference - network_interface_instance_context_reference_model[ - 'deleted'] = network_interface_instance_context_reference_deleted_model - network_interface_instance_context_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model[ - 'name'] = 'my-network-interface' - network_interface_instance_context_reference_model[ - 'primary_ipv4_address'] = '192.168.3.4' - network_interface_instance_context_reference_model[ - 'resource_type'] = 'network_interface' - network_interface_instance_context_reference_model[ - 'subnet'] = subnet_reference_model - - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference + network_interface_instance_context_reference_model['deleted'] = network_interface_instance_context_reference_deleted_model + network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['name'] = 'my-network-interface' + network_interface_instance_context_reference_model['primary_ipv4_address'] = '192.168.3.4' + network_interface_instance_context_reference_model['resource_type'] = 'network_interface' + network_interface_instance_context_reference_model['subnet'] = subnet_reference_model + + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_vcpu_model = {} # InstanceVCPU + instance_status_reason_model = {} # InstanceStatusReason + instance_status_reason_model['code'] = 'cannot_start_storage' + instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted' + instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + + instance_vcpu_model = {} # InstanceVCPU instance_vcpu_model['architecture'] = 'amd64' instance_vcpu_model['count'] = 4 - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a Instance model instance_model_json = {} instance_model_json['bandwidth'] = 1000 - instance_model_json[ - 'boot_volume_attachment'] = volume_attachment_reference_instance_context_model - instance_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - instance_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model + instance_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model_json['disks'] = [instance_disk_model] instance_model_json['gpu'] = instance_gpu_model - instance_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['image'] = image_reference_model instance_model_json['memory'] = 8 instance_model_json['name'] = 'my-instance' - instance_model_json['network_interfaces'] = [ - network_interface_instance_context_reference_model - ] - instance_model_json[ - 'primary_network_interface'] = network_interface_instance_context_reference_model + instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model] + instance_model_json['primary_network_interface'] = network_interface_instance_context_reference_model instance_model_json['profile'] = instance_profile_reference_model instance_model_json['resource_group'] = resource_group_reference_model instance_model_json['status'] = 'deleting' + instance_model_json['status_reasons'] = [instance_status_reason_model] instance_model_json['vcpu'] = instance_vcpu_model - instance_model_json['volume_attachments'] = [ - volume_attachment_reference_instance_context_model - ] + instance_model_json['volume_attachments'] = [volume_attachment_reference_instance_context_model] instance_model_json['vpc'] = vpc_reference_model instance_model_json['zone'] = zone_reference_model @@ -25924,7 +26643,6 @@ def test_instance_serialization(self): instance_model_json2 = instance_model.to_dict() assert instance_model_json2 == instance_model_json - class TestInstanceAction(): """ Test Class for InstanceAction @@ -25937,26 +26655,21 @@ def test_instance_action_serialization(self): # Construct a json representation of a InstanceAction model instance_action_model_json = {} - instance_action_model_json[ - 'completed_at'] = '2020-01-28T18:40:40.123456Z' - instance_action_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' + instance_action_model_json['completed_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_action_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_action_model_json['force'] = True - instance_action_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed' - instance_action_model_json[ - 'id'] = '109a1b6e-1242-4de1-be44-38705e9474ed' - instance_action_model_json['started_at'] = '2020-01-28T18:40:40.123456Z' + instance_action_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed' + instance_action_model_json['id'] = '109a1b6e-1242-4de1-be44-38705e9474ed' + instance_action_model_json['started_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_action_model_json['status'] = 'completed' instance_action_model_json['type'] = 'reboot' # Construct a model instance of InstanceAction by calling from_dict on the json representation - instance_action_model = InstanceAction.from_dict( - instance_action_model_json) + instance_action_model = InstanceAction.from_dict(instance_action_model_json) assert instance_action_model != False # Construct a model instance of InstanceAction by calling from_dict on the json representation - instance_action_model_dict = InstanceAction.from_dict( - instance_action_model_json).__dict__ + instance_action_model_dict = InstanceAction.from_dict(instance_action_model_json).__dict__ instance_action_model2 = InstanceAction(**instance_action_model_dict) # Verify the model instances are equivalent @@ -25966,7 +26679,6 @@ def test_instance_action_serialization(self): instance_action_model_json2 = instance_action_model.to_dict() assert instance_action_model_json2 == instance_action_model_json - class TestInstanceCollection(): """ Test Class for InstanceCollection @@ -25979,187 +26691,153 @@ def test_instance_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_collection_first_model = {} # InstanceCollectionFirst - instance_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' + instance_collection_first_model = {} # InstanceCollectionFirst + instance_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' - volume_attachment_reference_instance_context_deleted_model = { - } # VolumeAttachmentReferenceInstanceContextDeleted - volume_attachment_reference_instance_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted + volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_reference_model = {} # VolumeReference - volume_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model = {} # VolumeReference + volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['deleted'] = volume_reference_deleted_model - volume_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['name'] = 'my-volume' - volume_attachment_reference_instance_context_model = { - } # VolumeAttachmentReferenceInstanceContext - volume_attachment_reference_instance_context_model[ - 'deleted'] = volume_attachment_reference_instance_context_deleted_model - volume_attachment_reference_instance_context_model[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_reference_instance_context_model[ - 'volume'] = volume_reference_model - - instance_gpu_model = {} # InstanceGPU + volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext + volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model + volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model + volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_reference_instance_context_model['volume'] = volume_reference_model + + instance_disk_model = {} # InstanceDisk + instance_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['interface_type'] = 'virtio_blk' + instance_disk_model['name'] = 'my-instance-disk' + instance_disk_model['resource_type'] = 'instance_disk' + instance_disk_model['size'] = 100 + + instance_gpu_model = {} # InstanceGPU instance_gpu_model['count'] = 1 instance_gpu_model['manufacturer'] = 'nvidia' instance_gpu_model['memory'] = 1 instance_gpu_model['model'] = 'Tesla V100' - image_reference_deleted_model = {} # ImageReferenceDeleted - image_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + image_reference_deleted_model = {} # ImageReferenceDeleted + image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - image_reference_model = {} # ImageReference - image_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model = {} # ImageReference + image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['deleted'] = image_reference_deleted_model - image_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['name'] = 'my-image' - network_interface_instance_context_reference_deleted_model = { - } # NetworkInterfaceInstanceContextReferenceDeleted - network_interface_instance_context_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted + network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - network_interface_instance_context_reference_model = { - } # NetworkInterfaceInstanceContextReference - network_interface_instance_context_reference_model[ - 'deleted'] = network_interface_instance_context_reference_deleted_model - network_interface_instance_context_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model[ - 'name'] = 'my-network-interface' - network_interface_instance_context_reference_model[ - 'primary_ipv4_address'] = '192.168.3.4' - network_interface_instance_context_reference_model[ - 'resource_type'] = 'network_interface' - network_interface_instance_context_reference_model[ - 'subnet'] = subnet_reference_model - - instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference + network_interface_instance_context_reference_model['deleted'] = network_interface_instance_context_reference_deleted_model + network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['name'] = 'my-network-interface' + network_interface_instance_context_reference_model['primary_ipv4_address'] = '192.168.3.4' + network_interface_instance_context_reference_model['resource_type'] = 'network_interface' + network_interface_instance_context_reference_model['subnet'] = subnet_reference_model + + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model['name'] = 'bc1-4x16' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - instance_vcpu_model = {} # InstanceVCPU + instance_status_reason_model = {} # InstanceStatusReason + instance_status_reason_model['code'] = 'cannot_start_storage' + instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted' + instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + + instance_vcpu_model = {} # InstanceVCPU instance_vcpu_model['architecture'] = 'amd64' instance_vcpu_model['count'] = 4 - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - instance_model = {} # Instance + instance_model = {} # Instance instance_model['bandwidth'] = 1000 - instance_model[ - 'boot_volume_attachment'] = volume_attachment_reference_instance_context_model - instance_model['created_at'] = '2020-01-28T18:40:40.123456Z' - instance_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model + instance_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model['disks'] = [instance_disk_model] instance_model['gpu'] = instance_gpu_model - instance_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['image'] = image_reference_model instance_model['memory'] = 8 instance_model['name'] = 'my-instance' - instance_model['network_interfaces'] = [ - network_interface_instance_context_reference_model - ] - instance_model[ - 'primary_network_interface'] = network_interface_instance_context_reference_model + instance_model['network_interfaces'] = [network_interface_instance_context_reference_model] + instance_model['primary_network_interface'] = network_interface_instance_context_reference_model instance_model['profile'] = instance_profile_reference_model instance_model['resource_group'] = resource_group_reference_model instance_model['status'] = 'deleting' + instance_model['status_reasons'] = [instance_status_reason_model] instance_model['vcpu'] = instance_vcpu_model - instance_model['volume_attachments'] = [ - volume_attachment_reference_instance_context_model - ] + instance_model['volume_attachments'] = [volume_attachment_reference_instance_context_model] instance_model['vpc'] = vpc_reference_model instance_model['zone'] = zone_reference_model - instance_collection_next_model = {} # InstanceCollectionNext - instance_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_collection_next_model = {} # InstanceCollectionNext + instance_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a InstanceCollection model instance_collection_model_json = {} - instance_collection_model_json[ - 'first'] = instance_collection_first_model + instance_collection_model_json['first'] = instance_collection_first_model instance_collection_model_json['instances'] = [instance_model] instance_collection_model_json['limit'] = 20 instance_collection_model_json['next'] = instance_collection_next_model instance_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceCollection by calling from_dict on the json representation - instance_collection_model = InstanceCollection.from_dict( - instance_collection_model_json) + instance_collection_model = InstanceCollection.from_dict(instance_collection_model_json) assert instance_collection_model != False # Construct a model instance of InstanceCollection by calling from_dict on the json representation - instance_collection_model_dict = InstanceCollection.from_dict( - instance_collection_model_json).__dict__ - instance_collection_model2 = InstanceCollection( - **instance_collection_model_dict) + instance_collection_model_dict = InstanceCollection.from_dict(instance_collection_model_json).__dict__ + instance_collection_model2 = InstanceCollection(**instance_collection_model_dict) # Verify the model instances are equivalent assert instance_collection_model == instance_collection_model2 @@ -26168,7 +26846,6 @@ def test_instance_collection_serialization(self): instance_collection_model_json2 = instance_collection_model.to_dict() assert instance_collection_model_json2 == instance_collection_model_json - class TestInstanceCollectionFirst(): """ Test Class for InstanceCollectionFirst @@ -26181,29 +26858,23 @@ def test_instance_collection_first_serialization(self): # Construct a json representation of a InstanceCollectionFirst model instance_collection_first_model_json = {} - instance_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' + instance_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation - instance_collection_first_model = InstanceCollectionFirst.from_dict( - instance_collection_first_model_json) + instance_collection_first_model = InstanceCollectionFirst.from_dict(instance_collection_first_model_json) assert instance_collection_first_model != False # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation - instance_collection_first_model_dict = InstanceCollectionFirst.from_dict( - instance_collection_first_model_json).__dict__ - instance_collection_first_model2 = InstanceCollectionFirst( - **instance_collection_first_model_dict) + instance_collection_first_model_dict = InstanceCollectionFirst.from_dict(instance_collection_first_model_json).__dict__ + instance_collection_first_model2 = InstanceCollectionFirst(**instance_collection_first_model_dict) # Verify the model instances are equivalent assert instance_collection_first_model == instance_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_collection_first_model_json2 = instance_collection_first_model.to_dict( - ) + instance_collection_first_model_json2 = instance_collection_first_model.to_dict() assert instance_collection_first_model_json2 == instance_collection_first_model_json - class TestInstanceCollectionNext(): """ Test Class for InstanceCollectionNext @@ -26216,28 +26887,227 @@ def test_instance_collection_next_serialization(self): # Construct a json representation of a InstanceCollectionNext model instance_collection_next_model_json = {} - instance_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation - instance_collection_next_model = InstanceCollectionNext.from_dict( - instance_collection_next_model_json) + instance_collection_next_model = InstanceCollectionNext.from_dict(instance_collection_next_model_json) assert instance_collection_next_model != False # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation - instance_collection_next_model_dict = InstanceCollectionNext.from_dict( - instance_collection_next_model_json).__dict__ - instance_collection_next_model2 = InstanceCollectionNext( - **instance_collection_next_model_dict) + instance_collection_next_model_dict = InstanceCollectionNext.from_dict(instance_collection_next_model_json).__dict__ + instance_collection_next_model2 = InstanceCollectionNext(**instance_collection_next_model_dict) # Verify the model instances are equivalent assert instance_collection_next_model == instance_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_collection_next_model_json2 = instance_collection_next_model.to_dict( - ) + instance_collection_next_model_json2 = instance_collection_next_model.to_dict() assert instance_collection_next_model_json2 == instance_collection_next_model_json +class TestInstanceConsoleAccessToken(): + """ + Test Class for InstanceConsoleAccessToken + """ + + def test_instance_console_access_token_serialization(self): + """ + Test serialization/deserialization for InstanceConsoleAccessToken + """ + + # Construct a json representation of a InstanceConsoleAccessToken model + instance_console_access_token_model_json = {} + instance_console_access_token_model_json['access_token'] = 'VGhpcyBJcyBhIHRva2Vu' + instance_console_access_token_model_json['console_type'] = 'serial' + instance_console_access_token_model_json['created_at'] = datetime_to_string(string_to_datetime("2020-07-27T21:50:14.000Z")) + instance_console_access_token_model_json['expires_at'] = datetime_to_string(string_to_datetime("2020-07-27T21:51:14.000Z")) + instance_console_access_token_model_json['force'] = False + instance_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu' + + # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation + instance_console_access_token_model = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json) + assert instance_console_access_token_model != False + + # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation + instance_console_access_token_model_dict = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json).__dict__ + instance_console_access_token_model2 = InstanceConsoleAccessToken(**instance_console_access_token_model_dict) + + # Verify the model instances are equivalent + assert instance_console_access_token_model == instance_console_access_token_model2 + + # Convert model instance back to dict and verify no loss of data + instance_console_access_token_model_json2 = instance_console_access_token_model.to_dict() + assert instance_console_access_token_model_json2 == instance_console_access_token_model_json + +class TestInstanceDisk(): + """ + Test Class for InstanceDisk + """ + + def test_instance_disk_serialization(self): + """ + Test serialization/deserialization for InstanceDisk + """ + + # Construct a json representation of a InstanceDisk model + instance_disk_model_json = {} + instance_disk_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model_json['interface_type'] = 'virtio_blk' + instance_disk_model_json['name'] = 'my-instance-disk' + instance_disk_model_json['resource_type'] = 'instance_disk' + instance_disk_model_json['size'] = 100 + + # Construct a model instance of InstanceDisk by calling from_dict on the json representation + instance_disk_model = InstanceDisk.from_dict(instance_disk_model_json) + assert instance_disk_model != False + + # Construct a model instance of InstanceDisk by calling from_dict on the json representation + instance_disk_model_dict = InstanceDisk.from_dict(instance_disk_model_json).__dict__ + instance_disk_model2 = InstanceDisk(**instance_disk_model_dict) + + # Verify the model instances are equivalent + assert instance_disk_model == instance_disk_model2 + + # Convert model instance back to dict and verify no loss of data + instance_disk_model_json2 = instance_disk_model.to_dict() + assert instance_disk_model_json2 == instance_disk_model_json + +class TestInstanceDiskCollection(): + """ + Test Class for InstanceDiskCollection + """ + + def test_instance_disk_collection_serialization(self): + """ + Test serialization/deserialization for InstanceDiskCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_disk_model = {} # InstanceDisk + instance_disk_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['interface_type'] = 'virtio_blk' + instance_disk_model['name'] = 'my-instance-disk' + instance_disk_model['resource_type'] = 'instance_disk' + instance_disk_model['size'] = 100 + + # Construct a json representation of a InstanceDiskCollection model + instance_disk_collection_model_json = {} + instance_disk_collection_model_json['disks'] = [instance_disk_model] + + # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation + instance_disk_collection_model = InstanceDiskCollection.from_dict(instance_disk_collection_model_json) + assert instance_disk_collection_model != False + + # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation + instance_disk_collection_model_dict = InstanceDiskCollection.from_dict(instance_disk_collection_model_json).__dict__ + instance_disk_collection_model2 = InstanceDiskCollection(**instance_disk_collection_model_dict) + + # Verify the model instances are equivalent + assert instance_disk_collection_model == instance_disk_collection_model2 + + # Convert model instance back to dict and verify no loss of data + instance_disk_collection_model_json2 = instance_disk_collection_model.to_dict() + assert instance_disk_collection_model_json2 == instance_disk_collection_model_json + +class TestInstanceDiskPatch(): + """ + Test Class for InstanceDiskPatch + """ + + def test_instance_disk_patch_serialization(self): + """ + Test serialization/deserialization for InstanceDiskPatch + """ + + # Construct a json representation of a InstanceDiskPatch model + instance_disk_patch_model_json = {} + instance_disk_patch_model_json['name'] = 'my-instance-disk-updated' + + # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation + instance_disk_patch_model = InstanceDiskPatch.from_dict(instance_disk_patch_model_json) + assert instance_disk_patch_model != False + + # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation + instance_disk_patch_model_dict = InstanceDiskPatch.from_dict(instance_disk_patch_model_json).__dict__ + instance_disk_patch_model2 = InstanceDiskPatch(**instance_disk_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_disk_patch_model == instance_disk_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_disk_patch_model_json2 = instance_disk_patch_model.to_dict() + assert instance_disk_patch_model_json2 == instance_disk_patch_model_json + +class TestInstanceDiskReference(): + """ + Test Class for InstanceDiskReference + """ + + def test_instance_disk_reference_serialization(self): + """ + Test serialization/deserialization for InstanceDiskReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted + instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a InstanceDiskReference model + instance_disk_reference_model_json = {} + instance_disk_reference_model_json['deleted'] = instance_disk_reference_deleted_model + instance_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model_json['name'] = 'my-instance-disk' + instance_disk_reference_model_json['resource_type'] = 'instance_disk' + + # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation + instance_disk_reference_model = InstanceDiskReference.from_dict(instance_disk_reference_model_json) + assert instance_disk_reference_model != False + + # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation + instance_disk_reference_model_dict = InstanceDiskReference.from_dict(instance_disk_reference_model_json).__dict__ + instance_disk_reference_model2 = InstanceDiskReference(**instance_disk_reference_model_dict) + + # Verify the model instances are equivalent + assert instance_disk_reference_model == instance_disk_reference_model2 + + # Convert model instance back to dict and verify no loss of data + instance_disk_reference_model_json2 = instance_disk_reference_model.to_dict() + assert instance_disk_reference_model_json2 == instance_disk_reference_model_json + +class TestInstanceDiskReferenceDeleted(): + """ + Test Class for InstanceDiskReferenceDeleted + """ + + def test_instance_disk_reference_deleted_serialization(self): + """ + Test serialization/deserialization for InstanceDiskReferenceDeleted + """ + + # Construct a json representation of a InstanceDiskReferenceDeleted model + instance_disk_reference_deleted_model_json = {} + instance_disk_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation + instance_disk_reference_deleted_model = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json) + assert instance_disk_reference_deleted_model != False + + # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation + instance_disk_reference_deleted_model_dict = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json).__dict__ + instance_disk_reference_deleted_model2 = InstanceDiskReferenceDeleted(**instance_disk_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert instance_disk_reference_deleted_model == instance_disk_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + instance_disk_reference_deleted_model_json2 = instance_disk_reference_deleted_model.to_dict() + assert instance_disk_reference_deleted_model_json2 == instance_disk_reference_deleted_model_json class TestInstanceGPU(): """ @@ -26261,8 +27131,7 @@ def test_instance_gpu_serialization(self): assert instance_gpu_model != False # Construct a model instance of InstanceGPU by calling from_dict on the json representation - instance_gpu_model_dict = InstanceGPU.from_dict( - instance_gpu_model_json).__dict__ + instance_gpu_model_dict = InstanceGPU.from_dict(instance_gpu_model_json).__dict__ instance_gpu_model2 = InstanceGPU(**instance_gpu_model_dict) # Verify the model instances are equivalent @@ -26272,7 +27141,6 @@ def test_instance_gpu_serialization(self): instance_gpu_model_json2 = instance_gpu_model.to_dict() assert instance_gpu_model_json2 == instance_gpu_model_json - class TestInstanceGroup(): """ Test Class for InstanceGroup @@ -26285,117 +27153,83 @@ def test_instance_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_template_reference_deleted_model = { - } # InstanceTemplateReferenceDeleted - instance_template_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_template_reference_model = {} # InstanceTemplateReference - instance_template_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'deleted'] = instance_template_reference_deleted_model - instance_template_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted + instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_template_reference_model = {} # InstanceTemplateReference + instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['deleted'] = instance_template_reference_deleted_model + instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_reference_model['name'] = 'my-instance-template' - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - instance_group_manager_reference_deleted_model = { - } # InstanceGroupManagerReferenceDeleted - instance_group_manager_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_manager_reference_model = { - } # InstanceGroupManagerReference - instance_group_manager_reference_model[ - 'deleted'] = instance_group_manager_reference_deleted_model - instance_group_manager_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - instance_group_manager_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_reference_model[ - 'name'] = 'my-instance-group-manager' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted + instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_reference_model = {} # InstanceGroupManagerReference + instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model + instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_reference_model['name'] = 'my-instance-group-manager' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a InstanceGroup model instance_group_model_json = {} instance_group_model_json['application_port'] = 22 - instance_group_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - instance_group_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_model_json[ - 'instance_template'] = instance_template_reference_model - instance_group_model_json[ - 'load_balancer_pool'] = load_balancer_pool_reference_model - instance_group_model_json['managers'] = [ - instance_group_manager_reference_model - ] + instance_group_model_json['instance_template'] = instance_template_reference_model + instance_group_model_json['load_balancer_pool'] = load_balancer_pool_reference_model + instance_group_model_json['managers'] = [instance_group_manager_reference_model] instance_group_model_json['membership_count'] = 10 instance_group_model_json['name'] = 'my-instance-group' - instance_group_model_json[ - 'resource_group'] = resource_group_reference_model + instance_group_model_json['resource_group'] = resource_group_reference_model instance_group_model_json['status'] = 'deleting' instance_group_model_json['subnets'] = [subnet_reference_model] + instance_group_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_group_model_json['vpc'] = vpc_reference_model # Construct a model instance of InstanceGroup by calling from_dict on the json representation - instance_group_model = InstanceGroup.from_dict( - instance_group_model_json) + instance_group_model = InstanceGroup.from_dict(instance_group_model_json) assert instance_group_model != False # Construct a model instance of InstanceGroup by calling from_dict on the json representation - instance_group_model_dict = InstanceGroup.from_dict( - instance_group_model_json).__dict__ + instance_group_model_dict = InstanceGroup.from_dict(instance_group_model_json).__dict__ instance_group_model2 = InstanceGroup(**instance_group_model_dict) # Verify the model instances are equivalent @@ -26405,7 +27239,6 @@ def test_instance_group_serialization(self): instance_group_model_json2 = instance_group_model.to_dict() assert instance_group_model_json2 == instance_group_model_json - class TestInstanceGroupCollection(): """ Test Class for InstanceGroupCollection @@ -26418,148 +27251,105 @@ def test_instance_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_collection_first_model = { - } # InstanceGroupCollectionFirst - instance_group_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' - - instance_template_reference_deleted_model = { - } # InstanceTemplateReferenceDeleted - instance_template_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_template_reference_model = {} # InstanceTemplateReference - instance_template_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'deleted'] = instance_template_reference_deleted_model - instance_template_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_group_collection_first_model = {} # InstanceGroupCollectionFirst + instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' + + instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted + instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_template_reference_model = {} # InstanceTemplateReference + instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['deleted'] = instance_template_reference_deleted_model + instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_reference_model['name'] = 'my-instance-template' - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - instance_group_manager_reference_deleted_model = { - } # InstanceGroupManagerReferenceDeleted - instance_group_manager_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_manager_reference_model = { - } # InstanceGroupManagerReference - instance_group_manager_reference_model[ - 'deleted'] = instance_group_manager_reference_deleted_model - instance_group_manager_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - instance_group_manager_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_reference_model[ - 'name'] = 'my-instance-group-manager' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted + instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_reference_model = {} # InstanceGroupManagerReference + instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model + instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_reference_model['name'] = 'my-instance-group-manager' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - instance_group_model = {} # InstanceGroup + instance_group_model = {} # InstanceGroup instance_group_model['application_port'] = 22 - instance_group_model['created_at'] = '2020-01-28T18:40:40.123456Z' - instance_group_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_model[ - 'instance_template'] = instance_template_reference_model - instance_group_model[ - 'load_balancer_pool'] = load_balancer_pool_reference_model - instance_group_model['managers'] = [ - instance_group_manager_reference_model - ] + instance_group_model['instance_template'] = instance_template_reference_model + instance_group_model['load_balancer_pool'] = load_balancer_pool_reference_model + instance_group_model['managers'] = [instance_group_manager_reference_model] instance_group_model['membership_count'] = 10 instance_group_model['name'] = 'my-instance-group' instance_group_model['resource_group'] = resource_group_reference_model instance_group_model['status'] = 'deleting' instance_group_model['subnets'] = [subnet_reference_model] + instance_group_model['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_group_model['vpc'] = vpc_reference_model - instance_group_collection_next_model = {} # InstanceGroupCollectionNext - instance_group_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_collection_next_model = {} # InstanceGroupCollectionNext + instance_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a InstanceGroupCollection model instance_group_collection_model_json = {} - instance_group_collection_model_json[ - 'first'] = instance_group_collection_first_model - instance_group_collection_model_json['instance_groups'] = [ - instance_group_model - ] + instance_group_collection_model_json['first'] = instance_group_collection_first_model + instance_group_collection_model_json['instance_groups'] = [instance_group_model] instance_group_collection_model_json['limit'] = 20 - instance_group_collection_model_json[ - 'next'] = instance_group_collection_next_model + instance_group_collection_model_json['next'] = instance_group_collection_next_model instance_group_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation - instance_group_collection_model = InstanceGroupCollection.from_dict( - instance_group_collection_model_json) + instance_group_collection_model = InstanceGroupCollection.from_dict(instance_group_collection_model_json) assert instance_group_collection_model != False # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation - instance_group_collection_model_dict = InstanceGroupCollection.from_dict( - instance_group_collection_model_json).__dict__ - instance_group_collection_model2 = InstanceGroupCollection( - **instance_group_collection_model_dict) + instance_group_collection_model_dict = InstanceGroupCollection.from_dict(instance_group_collection_model_json).__dict__ + instance_group_collection_model2 = InstanceGroupCollection(**instance_group_collection_model_dict) # Verify the model instances are equivalent assert instance_group_collection_model == instance_group_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_group_collection_model_json2 = instance_group_collection_model.to_dict( - ) + instance_group_collection_model_json2 = instance_group_collection_model.to_dict() assert instance_group_collection_model_json2 == instance_group_collection_model_json - class TestInstanceGroupCollectionFirst(): """ Test Class for InstanceGroupCollectionFirst @@ -26572,29 +27362,23 @@ def test_instance_group_collection_first_serialization(self): # Construct a json representation of a InstanceGroupCollectionFirst model instance_group_collection_first_model_json = {} - instance_group_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' + instance_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation - instance_group_collection_first_model = InstanceGroupCollectionFirst.from_dict( - instance_group_collection_first_model_json) + instance_group_collection_first_model = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json) assert instance_group_collection_first_model != False # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation - instance_group_collection_first_model_dict = InstanceGroupCollectionFirst.from_dict( - instance_group_collection_first_model_json).__dict__ - instance_group_collection_first_model2 = InstanceGroupCollectionFirst( - **instance_group_collection_first_model_dict) + instance_group_collection_first_model_dict = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json).__dict__ + instance_group_collection_first_model2 = InstanceGroupCollectionFirst(**instance_group_collection_first_model_dict) # Verify the model instances are equivalent assert instance_group_collection_first_model == instance_group_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_group_collection_first_model_json2 = instance_group_collection_first_model.to_dict( - ) + instance_group_collection_first_model_json2 = instance_group_collection_first_model.to_dict() assert instance_group_collection_first_model_json2 == instance_group_collection_first_model_json - class TestInstanceGroupCollectionNext(): """ Test Class for InstanceGroupCollectionNext @@ -26607,28 +27391,207 @@ def test_instance_group_collection_next_serialization(self): # Construct a json representation of a InstanceGroupCollectionNext model instance_group_collection_next_model_json = {} - instance_group_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation - instance_group_collection_next_model = InstanceGroupCollectionNext.from_dict( - instance_group_collection_next_model_json) + instance_group_collection_next_model = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json) assert instance_group_collection_next_model != False # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation - instance_group_collection_next_model_dict = InstanceGroupCollectionNext.from_dict( - instance_group_collection_next_model_json).__dict__ - instance_group_collection_next_model2 = InstanceGroupCollectionNext( - **instance_group_collection_next_model_dict) + instance_group_collection_next_model_dict = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json).__dict__ + instance_group_collection_next_model2 = InstanceGroupCollectionNext(**instance_group_collection_next_model_dict) # Verify the model instances are equivalent assert instance_group_collection_next_model == instance_group_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_group_collection_next_model_json2 = instance_group_collection_next_model.to_dict( - ) + instance_group_collection_next_model_json2 = instance_group_collection_next_model.to_dict() assert instance_group_collection_next_model_json2 == instance_group_collection_next_model_json +class TestInstanceGroupManagerActionReference(): + """ + Test Class for InstanceGroupManagerActionReference + """ + + def test_instance_group_manager_action_reference_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_action_reference_deleted_model = {} # InstanceGroupManagerActionReferenceDeleted + instance_group_manager_action_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a InstanceGroupManagerActionReference model + instance_group_manager_action_reference_model_json = {} + instance_group_manager_action_reference_model_json['deleted'] = instance_group_manager_action_reference_deleted_model + instance_group_manager_action_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_reference_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_reference_model_json['resource_type'] = 'instance_group_manager_action' + + # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation + instance_group_manager_action_reference_model = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json) + assert instance_group_manager_action_reference_model != False + + # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation + instance_group_manager_action_reference_model_dict = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json).__dict__ + instance_group_manager_action_reference_model2 = InstanceGroupManagerActionReference(**instance_group_manager_action_reference_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_reference_model == instance_group_manager_action_reference_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_reference_model_json2 = instance_group_manager_action_reference_model.to_dict() + assert instance_group_manager_action_reference_model_json2 == instance_group_manager_action_reference_model_json + +class TestInstanceGroupManagerActionReferenceDeleted(): + """ + Test Class for InstanceGroupManagerActionReferenceDeleted + """ + + def test_instance_group_manager_action_reference_deleted_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionReferenceDeleted + """ + + # Construct a json representation of a InstanceGroupManagerActionReferenceDeleted model + instance_group_manager_action_reference_deleted_model_json = {} + instance_group_manager_action_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation + instance_group_manager_action_reference_deleted_model = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json) + assert instance_group_manager_action_reference_deleted_model != False + + # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation + instance_group_manager_action_reference_deleted_model_dict = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json).__dict__ + instance_group_manager_action_reference_deleted_model2 = InstanceGroupManagerActionReferenceDeleted(**instance_group_manager_action_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_reference_deleted_model == instance_group_manager_action_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_reference_deleted_model_json2 = instance_group_manager_action_reference_deleted_model.to_dict() + assert instance_group_manager_action_reference_deleted_model_json2 == instance_group_manager_action_reference_deleted_model_json + +class TestInstanceGroupManagerActionsCollection(): + """ + Test Class for InstanceGroupManagerActionsCollection + """ + + def test_instance_group_manager_actions_collection_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionsCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_group_group_model = {} # InstanceGroupManagerScheduledActionGroupGroup + instance_group_manager_scheduled_action_group_group_model['membership_count'] = 10 + + instance_group_manager_action_model = {} # InstanceGroupManagerActionScheduledActionGroup + instance_group_manager_action_model['auto_delete'] = True + instance_group_manager_action_model['auto_delete_timeout'] = 24 + instance_group_manager_action_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_model['resource_type'] = 'instance_group_manager_action' + instance_group_manager_action_model['status'] = 'active' + instance_group_manager_action_model['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_model['action_type'] = 'scheduled' + instance_group_manager_action_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_model['last_applied_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_model['next_run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_group_model + + instance_group_manager_actions_collection_first_model = {} # InstanceGroupManagerActionsCollectionFirst + instance_group_manager_actions_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20' + + instance_group_manager_actions_collection_next_model = {} # InstanceGroupManagerActionsCollectionNext + instance_group_manager_actions_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a json representation of a InstanceGroupManagerActionsCollection model + instance_group_manager_actions_collection_model_json = {} + instance_group_manager_actions_collection_model_json['actions'] = [instance_group_manager_action_model] + instance_group_manager_actions_collection_model_json['first'] = instance_group_manager_actions_collection_first_model + instance_group_manager_actions_collection_model_json['limit'] = 20 + instance_group_manager_actions_collection_model_json['next'] = instance_group_manager_actions_collection_next_model + instance_group_manager_actions_collection_model_json['total_count'] = 132 + + # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation + instance_group_manager_actions_collection_model = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json) + assert instance_group_manager_actions_collection_model != False + + # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation + instance_group_manager_actions_collection_model_dict = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json).__dict__ + instance_group_manager_actions_collection_model2 = InstanceGroupManagerActionsCollection(**instance_group_manager_actions_collection_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_actions_collection_model == instance_group_manager_actions_collection_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_actions_collection_model_json2 = instance_group_manager_actions_collection_model.to_dict() + assert instance_group_manager_actions_collection_model_json2 == instance_group_manager_actions_collection_model_json + +class TestInstanceGroupManagerActionsCollectionFirst(): + """ + Test Class for InstanceGroupManagerActionsCollectionFirst + """ + + def test_instance_group_manager_actions_collection_first_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst + """ + + # Construct a json representation of a InstanceGroupManagerActionsCollectionFirst model + instance_group_manager_actions_collection_first_model_json = {} + instance_group_manager_actions_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20' + + # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation + instance_group_manager_actions_collection_first_model = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json) + assert instance_group_manager_actions_collection_first_model != False + + # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation + instance_group_manager_actions_collection_first_model_dict = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json).__dict__ + instance_group_manager_actions_collection_first_model2 = InstanceGroupManagerActionsCollectionFirst(**instance_group_manager_actions_collection_first_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_actions_collection_first_model_json2 = instance_group_manager_actions_collection_first_model.to_dict() + assert instance_group_manager_actions_collection_first_model_json2 == instance_group_manager_actions_collection_first_model_json + +class TestInstanceGroupManagerActionsCollectionNext(): + """ + Test Class for InstanceGroupManagerActionsCollectionNext + """ + + def test_instance_group_manager_actions_collection_next_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext + """ + + # Construct a json representation of a InstanceGroupManagerActionsCollectionNext model + instance_group_manager_actions_collection_next_model_json = {} + instance_group_manager_actions_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation + instance_group_manager_actions_collection_next_model = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json) + assert instance_group_manager_actions_collection_next_model != False + + # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation + instance_group_manager_actions_collection_next_model_dict = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json).__dict__ + instance_group_manager_actions_collection_next_model2 = InstanceGroupManagerActionsCollectionNext(**instance_group_manager_actions_collection_next_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_actions_collection_next_model_json2 = instance_group_manager_actions_collection_next_model.to_dict() + assert instance_group_manager_actions_collection_next_model_json2 == instance_group_manager_actions_collection_next_model_json class TestInstanceGroupManagerCollection(): """ @@ -26642,80 +27605,58 @@ def test_instance_group_manager_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_collection_first_model = { - } # InstanceGroupManagerCollectionFirst - instance_group_manager_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' - - instance_group_manager_policy_reference_deleted_model = { - } # InstanceGroupManagerPolicyReferenceDeleted - instance_group_manager_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_manager_policy_reference_model = { - } # InstanceGroupManagerPolicyReference - instance_group_manager_policy_reference_model[ - 'deleted'] = instance_group_manager_policy_reference_deleted_model - instance_group_manager_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model[ - 'name'] = 'my-instance-group-manager-policy' - - instance_group_manager_model = {} # InstanceGroupManagerAutoScale - instance_group_manager_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - instance_group_manager_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_collection_first_model = {} # InstanceGroupManagerCollectionFirst + instance_group_manager_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' + + instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted + instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_policy_reference_model = {} # InstanceGroupManagerPolicyReference + instance_group_manager_policy_reference_model['deleted'] = instance_group_manager_policy_reference_deleted_model + instance_group_manager_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model['name'] = 'my-instance-group-manager-policy' + + instance_group_manager_model = {} # InstanceGroupManagerAutoScale + instance_group_manager_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_manager_model['management_enabled'] = True instance_group_manager_model['name'] = 'my-instance-group-manager' + instance_group_manager_model['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_group_manager_model['aggregation_window'] = 120 instance_group_manager_model['cooldown'] = 210 instance_group_manager_model['manager_type'] = 'autoscale' instance_group_manager_model['max_membership_count'] = 10 instance_group_manager_model['min_membership_count'] = 10 - instance_group_manager_model['policies'] = [ - instance_group_manager_policy_reference_model - ] + instance_group_manager_model['policies'] = [instance_group_manager_policy_reference_model] - instance_group_manager_collection_next_model = { - } # InstanceGroupManagerCollectionNext - instance_group_manager_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_manager_collection_next_model = {} # InstanceGroupManagerCollectionNext + instance_group_manager_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a InstanceGroupManagerCollection model instance_group_manager_collection_model_json = {} - instance_group_manager_collection_model_json[ - 'first'] = instance_group_manager_collection_first_model + instance_group_manager_collection_model_json['first'] = instance_group_manager_collection_first_model instance_group_manager_collection_model_json['limit'] = 20 - instance_group_manager_collection_model_json['managers'] = [ - instance_group_manager_model - ] - instance_group_manager_collection_model_json[ - 'next'] = instance_group_manager_collection_next_model + instance_group_manager_collection_model_json['managers'] = [instance_group_manager_model] + instance_group_manager_collection_model_json['next'] = instance_group_manager_collection_next_model instance_group_manager_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation - instance_group_manager_collection_model = InstanceGroupManagerCollection.from_dict( - instance_group_manager_collection_model_json) + instance_group_manager_collection_model = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json) assert instance_group_manager_collection_model != False # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation - instance_group_manager_collection_model_dict = InstanceGroupManagerCollection.from_dict( - instance_group_manager_collection_model_json).__dict__ - instance_group_manager_collection_model2 = InstanceGroupManagerCollection( - **instance_group_manager_collection_model_dict) + instance_group_manager_collection_model_dict = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json).__dict__ + instance_group_manager_collection_model2 = InstanceGroupManagerCollection(**instance_group_manager_collection_model_dict) # Verify the model instances are equivalent assert instance_group_manager_collection_model == instance_group_manager_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_collection_model_json2 = instance_group_manager_collection_model.to_dict( - ) + instance_group_manager_collection_model_json2 = instance_group_manager_collection_model.to_dict() assert instance_group_manager_collection_model_json2 == instance_group_manager_collection_model_json - class TestInstanceGroupManagerCollectionFirst(): """ Test Class for InstanceGroupManagerCollectionFirst @@ -26728,29 +27669,23 @@ def test_instance_group_manager_collection_first_serialization(self): # Construct a json representation of a InstanceGroupManagerCollectionFirst model instance_group_manager_collection_first_model_json = {} - instance_group_manager_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' + instance_group_manager_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation - instance_group_manager_collection_first_model = InstanceGroupManagerCollectionFirst.from_dict( - instance_group_manager_collection_first_model_json) + instance_group_manager_collection_first_model = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json) assert instance_group_manager_collection_first_model != False # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation - instance_group_manager_collection_first_model_dict = InstanceGroupManagerCollectionFirst.from_dict( - instance_group_manager_collection_first_model_json).__dict__ - instance_group_manager_collection_first_model2 = InstanceGroupManagerCollectionFirst( - **instance_group_manager_collection_first_model_dict) + instance_group_manager_collection_first_model_dict = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json).__dict__ + instance_group_manager_collection_first_model2 = InstanceGroupManagerCollectionFirst(**instance_group_manager_collection_first_model_dict) # Verify the model instances are equivalent assert instance_group_manager_collection_first_model == instance_group_manager_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_collection_first_model_json2 = instance_group_manager_collection_first_model.to_dict( - ) + instance_group_manager_collection_first_model_json2 = instance_group_manager_collection_first_model.to_dict() assert instance_group_manager_collection_first_model_json2 == instance_group_manager_collection_first_model_json - class TestInstanceGroupManagerCollectionNext(): """ Test Class for InstanceGroupManagerCollectionNext @@ -26763,29 +27698,23 @@ def test_instance_group_manager_collection_next_serialization(self): # Construct a json representation of a InstanceGroupManagerCollectionNext model instance_group_manager_collection_next_model_json = {} - instance_group_manager_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_manager_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation - instance_group_manager_collection_next_model = InstanceGroupManagerCollectionNext.from_dict( - instance_group_manager_collection_next_model_json) + instance_group_manager_collection_next_model = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json) assert instance_group_manager_collection_next_model != False # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation - instance_group_manager_collection_next_model_dict = InstanceGroupManagerCollectionNext.from_dict( - instance_group_manager_collection_next_model_json).__dict__ - instance_group_manager_collection_next_model2 = InstanceGroupManagerCollectionNext( - **instance_group_manager_collection_next_model_dict) + instance_group_manager_collection_next_model_dict = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json).__dict__ + instance_group_manager_collection_next_model2 = InstanceGroupManagerCollectionNext(**instance_group_manager_collection_next_model_dict) # Verify the model instances are equivalent assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_collection_next_model_json2 = instance_group_manager_collection_next_model.to_dict( - ) + instance_group_manager_collection_next_model_json2 = instance_group_manager_collection_next_model.to_dict() assert instance_group_manager_collection_next_model_json2 == instance_group_manager_collection_next_model_json - class TestInstanceGroupManagerPatch(): """ Test Class for InstanceGroupManagerPatch @@ -26803,29 +27732,23 @@ def test_instance_group_manager_patch_serialization(self): instance_group_manager_patch_model_json['management_enabled'] = True instance_group_manager_patch_model_json['max_membership_count'] = 10 instance_group_manager_patch_model_json['min_membership_count'] = 10 - instance_group_manager_patch_model_json[ - 'name'] = 'my-instance-group-manager' + instance_group_manager_patch_model_json['name'] = 'my-instance-group-manager' # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation - instance_group_manager_patch_model = InstanceGroupManagerPatch.from_dict( - instance_group_manager_patch_model_json) + instance_group_manager_patch_model = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json) assert instance_group_manager_patch_model != False # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation - instance_group_manager_patch_model_dict = InstanceGroupManagerPatch.from_dict( - instance_group_manager_patch_model_json).__dict__ - instance_group_manager_patch_model2 = InstanceGroupManagerPatch( - **instance_group_manager_patch_model_dict) + instance_group_manager_patch_model_dict = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json).__dict__ + instance_group_manager_patch_model2 = InstanceGroupManagerPatch(**instance_group_manager_patch_model_dict) # Verify the model instances are equivalent assert instance_group_manager_patch_model == instance_group_manager_patch_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_patch_model_json2 = instance_group_manager_patch_model.to_dict( - ) + instance_group_manager_patch_model_json2 = instance_group_manager_patch_model.to_dict() assert instance_group_manager_patch_model_json2 == instance_group_manager_patch_model_json - class TestInstanceGroupManagerPolicyCollection(): """ Test Class for InstanceGroupManagerPolicyCollection @@ -26838,60 +27761,45 @@ def test_instance_group_manager_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_policy_collection_first_model = { - } # InstanceGroupManagerPolicyCollectionFirst - instance_group_manager_policy_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' - - instance_group_manager_policy_collection_next_model = { - } # InstanceGroupManagerPolicyCollectionNext - instance_group_manager_policy_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - instance_group_manager_policy_model = { - } # InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy - instance_group_manager_policy_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_model[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_collection_first_model = {} # InstanceGroupManagerPolicyCollectionFirst + instance_group_manager_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' + + instance_group_manager_policy_collection_next_model = {} # InstanceGroupManagerPolicyCollectionNext + instance_group_manager_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + instance_group_manager_policy_model = {} # InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy + instance_group_manager_policy_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_model['name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_model['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_group_manager_policy_model['metric_type'] = 'cpu' instance_group_manager_policy_model['metric_value'] = 38 instance_group_manager_policy_model['policy_type'] = 'target' # Construct a json representation of a InstanceGroupManagerPolicyCollection model instance_group_manager_policy_collection_model_json = {} - instance_group_manager_policy_collection_model_json[ - 'first'] = instance_group_manager_policy_collection_first_model + instance_group_manager_policy_collection_model_json['first'] = instance_group_manager_policy_collection_first_model instance_group_manager_policy_collection_model_json['limit'] = 20 - instance_group_manager_policy_collection_model_json[ - 'next'] = instance_group_manager_policy_collection_next_model - instance_group_manager_policy_collection_model_json['policies'] = [ - instance_group_manager_policy_model - ] + instance_group_manager_policy_collection_model_json['next'] = instance_group_manager_policy_collection_next_model + instance_group_manager_policy_collection_model_json['policies'] = [instance_group_manager_policy_model] instance_group_manager_policy_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation - instance_group_manager_policy_collection_model = InstanceGroupManagerPolicyCollection.from_dict( - instance_group_manager_policy_collection_model_json) + instance_group_manager_policy_collection_model = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json) assert instance_group_manager_policy_collection_model != False # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation - instance_group_manager_policy_collection_model_dict = InstanceGroupManagerPolicyCollection.from_dict( - instance_group_manager_policy_collection_model_json).__dict__ - instance_group_manager_policy_collection_model2 = InstanceGroupManagerPolicyCollection( - **instance_group_manager_policy_collection_model_dict) + instance_group_manager_policy_collection_model_dict = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json).__dict__ + instance_group_manager_policy_collection_model2 = InstanceGroupManagerPolicyCollection(**instance_group_manager_policy_collection_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_collection_model == instance_group_manager_policy_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_collection_model_json2 = instance_group_manager_policy_collection_model.to_dict( - ) + instance_group_manager_policy_collection_model_json2 = instance_group_manager_policy_collection_model.to_dict() assert instance_group_manager_policy_collection_model_json2 == instance_group_manager_policy_collection_model_json - class TestInstanceGroupManagerPolicyCollectionFirst(): """ Test Class for InstanceGroupManagerPolicyCollectionFirst @@ -26904,29 +27812,23 @@ def test_instance_group_manager_policy_collection_first_serialization(self): # Construct a json representation of a InstanceGroupManagerPolicyCollectionFirst model instance_group_manager_policy_collection_first_model_json = {} - instance_group_manager_policy_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' + instance_group_manager_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation - instance_group_manager_policy_collection_first_model = InstanceGroupManagerPolicyCollectionFirst.from_dict( - instance_group_manager_policy_collection_first_model_json) + instance_group_manager_policy_collection_first_model = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json) assert instance_group_manager_policy_collection_first_model != False # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation - instance_group_manager_policy_collection_first_model_dict = InstanceGroupManagerPolicyCollectionFirst.from_dict( - instance_group_manager_policy_collection_first_model_json).__dict__ - instance_group_manager_policy_collection_first_model2 = InstanceGroupManagerPolicyCollectionFirst( - **instance_group_manager_policy_collection_first_model_dict) + instance_group_manager_policy_collection_first_model_dict = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json).__dict__ + instance_group_manager_policy_collection_first_model2 = InstanceGroupManagerPolicyCollectionFirst(**instance_group_manager_policy_collection_first_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_collection_first_model == instance_group_manager_policy_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_collection_first_model_json2 = instance_group_manager_policy_collection_first_model.to_dict( - ) + instance_group_manager_policy_collection_first_model_json2 = instance_group_manager_policy_collection_first_model.to_dict() assert instance_group_manager_policy_collection_first_model_json2 == instance_group_manager_policy_collection_first_model_json - class TestInstanceGroupManagerPolicyCollectionNext(): """ Test Class for InstanceGroupManagerPolicyCollectionNext @@ -26939,29 +27841,23 @@ def test_instance_group_manager_policy_collection_next_serialization(self): # Construct a json representation of a InstanceGroupManagerPolicyCollectionNext model instance_group_manager_policy_collection_next_model_json = {} - instance_group_manager_policy_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_manager_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation - instance_group_manager_policy_collection_next_model = InstanceGroupManagerPolicyCollectionNext.from_dict( - instance_group_manager_policy_collection_next_model_json) + instance_group_manager_policy_collection_next_model = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json) assert instance_group_manager_policy_collection_next_model != False # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation - instance_group_manager_policy_collection_next_model_dict = InstanceGroupManagerPolicyCollectionNext.from_dict( - instance_group_manager_policy_collection_next_model_json).__dict__ - instance_group_manager_policy_collection_next_model2 = InstanceGroupManagerPolicyCollectionNext( - **instance_group_manager_policy_collection_next_model_dict) + instance_group_manager_policy_collection_next_model_dict = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json).__dict__ + instance_group_manager_policy_collection_next_model2 = InstanceGroupManagerPolicyCollectionNext(**instance_group_manager_policy_collection_next_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_collection_next_model == instance_group_manager_policy_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_collection_next_model_json2 = instance_group_manager_policy_collection_next_model.to_dict( - ) + instance_group_manager_policy_collection_next_model_json2 = instance_group_manager_policy_collection_next_model.to_dict() assert instance_group_manager_policy_collection_next_model_json2 == instance_group_manager_policy_collection_next_model_json - class TestInstanceGroupManagerPolicyPatch(): """ Test Class for InstanceGroupManagerPolicyPatch @@ -26976,29 +27872,23 @@ def test_instance_group_manager_policy_patch_serialization(self): instance_group_manager_policy_patch_model_json = {} instance_group_manager_policy_patch_model_json['metric_type'] = 'cpu' instance_group_manager_policy_patch_model_json['metric_value'] = 38 - instance_group_manager_policy_patch_model_json[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_patch_model_json['name'] = 'my-instance-group-manager-policy' # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation - instance_group_manager_policy_patch_model = InstanceGroupManagerPolicyPatch.from_dict( - instance_group_manager_policy_patch_model_json) + instance_group_manager_policy_patch_model = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json) assert instance_group_manager_policy_patch_model != False # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation - instance_group_manager_policy_patch_model_dict = InstanceGroupManagerPolicyPatch.from_dict( - instance_group_manager_policy_patch_model_json).__dict__ - instance_group_manager_policy_patch_model2 = InstanceGroupManagerPolicyPatch( - **instance_group_manager_policy_patch_model_dict) + instance_group_manager_policy_patch_model_dict = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json).__dict__ + instance_group_manager_policy_patch_model2 = InstanceGroupManagerPolicyPatch(**instance_group_manager_policy_patch_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_patch_model == instance_group_manager_policy_patch_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_patch_model_json2 = instance_group_manager_policy_patch_model.to_dict( - ) + instance_group_manager_policy_patch_model_json2 = instance_group_manager_policy_patch_model.to_dict() assert instance_group_manager_policy_patch_model_json2 == instance_group_manager_policy_patch_model_json - class TestInstanceGroupManagerPolicyReference(): """ Test Class for InstanceGroupManagerPolicyReference @@ -27011,78 +27901,60 @@ def test_instance_group_manager_policy_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_policy_reference_deleted_model = { - } # InstanceGroupManagerPolicyReferenceDeleted - instance_group_manager_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted + instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a InstanceGroupManagerPolicyReference model instance_group_manager_policy_reference_model_json = {} - instance_group_manager_policy_reference_model_json[ - 'deleted'] = instance_group_manager_policy_reference_deleted_model - instance_group_manager_policy_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model_json[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_reference_model_json['deleted'] = instance_group_manager_policy_reference_deleted_model + instance_group_manager_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model_json['name'] = 'my-instance-group-manager-policy' # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation - instance_group_manager_policy_reference_model = InstanceGroupManagerPolicyReference.from_dict( - instance_group_manager_policy_reference_model_json) + instance_group_manager_policy_reference_model = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json) assert instance_group_manager_policy_reference_model != False # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation - instance_group_manager_policy_reference_model_dict = InstanceGroupManagerPolicyReference.from_dict( - instance_group_manager_policy_reference_model_json).__dict__ - instance_group_manager_policy_reference_model2 = InstanceGroupManagerPolicyReference( - **instance_group_manager_policy_reference_model_dict) + instance_group_manager_policy_reference_model_dict = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json).__dict__ + instance_group_manager_policy_reference_model2 = InstanceGroupManagerPolicyReference(**instance_group_manager_policy_reference_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_reference_model == instance_group_manager_policy_reference_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_reference_model_json2 = instance_group_manager_policy_reference_model.to_dict( - ) + instance_group_manager_policy_reference_model_json2 = instance_group_manager_policy_reference_model.to_dict() assert instance_group_manager_policy_reference_model_json2 == instance_group_manager_policy_reference_model_json - class TestInstanceGroupManagerPolicyReferenceDeleted(): """ Test Class for InstanceGroupManagerPolicyReferenceDeleted """ - def test_instance_group_manager_policy_reference_deleted_serialization( - self): + def test_instance_group_manager_policy_reference_deleted_serialization(self): """ Test serialization/deserialization for InstanceGroupManagerPolicyReferenceDeleted """ # Construct a json representation of a InstanceGroupManagerPolicyReferenceDeleted model instance_group_manager_policy_reference_deleted_model_json = {} - instance_group_manager_policy_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_manager_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation - instance_group_manager_policy_reference_deleted_model = InstanceGroupManagerPolicyReferenceDeleted.from_dict( - instance_group_manager_policy_reference_deleted_model_json) + instance_group_manager_policy_reference_deleted_model = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json) assert instance_group_manager_policy_reference_deleted_model != False # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation - instance_group_manager_policy_reference_deleted_model_dict = InstanceGroupManagerPolicyReferenceDeleted.from_dict( - instance_group_manager_policy_reference_deleted_model_json).__dict__ - instance_group_manager_policy_reference_deleted_model2 = InstanceGroupManagerPolicyReferenceDeleted( - **instance_group_manager_policy_reference_deleted_model_dict) + instance_group_manager_policy_reference_deleted_model_dict = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json).__dict__ + instance_group_manager_policy_reference_deleted_model2 = InstanceGroupManagerPolicyReferenceDeleted(**instance_group_manager_policy_reference_deleted_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_reference_deleted_model == instance_group_manager_policy_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_reference_deleted_model_json2 = instance_group_manager_policy_reference_deleted_model.to_dict( - ) + instance_group_manager_policy_reference_deleted_model_json2 = instance_group_manager_policy_reference_deleted_model.to_dict() assert instance_group_manager_policy_reference_deleted_model_json2 == instance_group_manager_policy_reference_deleted_model_json - class TestInstanceGroupManagerReference(): """ Test Class for InstanceGroupManagerReference @@ -27095,42 +27967,31 @@ def test_instance_group_manager_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_reference_deleted_model = { - } # InstanceGroupManagerReferenceDeleted - instance_group_manager_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted + instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a InstanceGroupManagerReference model instance_group_manager_reference_model_json = {} - instance_group_manager_reference_model_json[ - 'deleted'] = instance_group_manager_reference_deleted_model - instance_group_manager_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - instance_group_manager_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_reference_model_json[ - 'name'] = 'my-instance-group-manager' + instance_group_manager_reference_model_json['deleted'] = instance_group_manager_reference_deleted_model + instance_group_manager_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_reference_model_json['name'] = 'my-instance-group-manager' # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation - instance_group_manager_reference_model = InstanceGroupManagerReference.from_dict( - instance_group_manager_reference_model_json) + instance_group_manager_reference_model = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json) assert instance_group_manager_reference_model != False # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation - instance_group_manager_reference_model_dict = InstanceGroupManagerReference.from_dict( - instance_group_manager_reference_model_json).__dict__ - instance_group_manager_reference_model2 = InstanceGroupManagerReference( - **instance_group_manager_reference_model_dict) + instance_group_manager_reference_model_dict = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json).__dict__ + instance_group_manager_reference_model2 = InstanceGroupManagerReference(**instance_group_manager_reference_model_dict) # Verify the model instances are equivalent assert instance_group_manager_reference_model == instance_group_manager_reference_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_reference_model_json2 = instance_group_manager_reference_model.to_dict( - ) + instance_group_manager_reference_model_json2 = instance_group_manager_reference_model.to_dict() assert instance_group_manager_reference_model_json2 == instance_group_manager_reference_model_json - class TestInstanceGroupManagerReferenceDeleted(): """ Test Class for InstanceGroupManagerReferenceDeleted @@ -27143,28 +28004,109 @@ def test_instance_group_manager_reference_deleted_serialization(self): # Construct a json representation of a InstanceGroupManagerReferenceDeleted model instance_group_manager_reference_deleted_model_json = {} - instance_group_manager_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_manager_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation - instance_group_manager_reference_deleted_model = InstanceGroupManagerReferenceDeleted.from_dict( - instance_group_manager_reference_deleted_model_json) + instance_group_manager_reference_deleted_model = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json) assert instance_group_manager_reference_deleted_model != False # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation - instance_group_manager_reference_deleted_model_dict = InstanceGroupManagerReferenceDeleted.from_dict( - instance_group_manager_reference_deleted_model_json).__dict__ - instance_group_manager_reference_deleted_model2 = InstanceGroupManagerReferenceDeleted( - **instance_group_manager_reference_deleted_model_dict) + instance_group_manager_reference_deleted_model_dict = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json).__dict__ + instance_group_manager_reference_deleted_model2 = InstanceGroupManagerReferenceDeleted(**instance_group_manager_reference_deleted_model_dict) # Verify the model instances are equivalent assert instance_group_manager_reference_deleted_model == instance_group_manager_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_reference_deleted_model_json2 = instance_group_manager_reference_deleted_model.to_dict( - ) + instance_group_manager_reference_deleted_model_json2 = instance_group_manager_reference_deleted_model.to_dict() assert instance_group_manager_reference_deleted_model_json2 == instance_group_manager_reference_deleted_model_json +class TestInstanceGroupManagerScheduledActionGroupGroup(): + """ + Test Class for InstanceGroupManagerScheduledActionGroupGroup + """ + + def test_instance_group_manager_scheduled_action_group_group_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupGroup + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionGroupGroup model + instance_group_manager_scheduled_action_group_group_model_json = {} + instance_group_manager_scheduled_action_group_group_model_json['membership_count'] = 10 + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupGroup by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_group_model = InstanceGroupManagerScheduledActionGroupGroup.from_dict(instance_group_manager_scheduled_action_group_group_model_json) + assert instance_group_manager_scheduled_action_group_group_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupGroup by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_group_model_dict = InstanceGroupManagerScheduledActionGroupGroup.from_dict(instance_group_manager_scheduled_action_group_group_model_json).__dict__ + instance_group_manager_scheduled_action_group_group_model2 = InstanceGroupManagerScheduledActionGroupGroup(**instance_group_manager_scheduled_action_group_group_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_group_group_model == instance_group_manager_scheduled_action_group_group_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_group_group_model_json2 = instance_group_manager_scheduled_action_group_group_model.to_dict() + assert instance_group_manager_scheduled_action_group_group_model_json2 == instance_group_manager_scheduled_action_group_group_model_json + +class TestInstanceGroupManagerScheduledActionGroupPatch(): + """ + Test Class for InstanceGroupManagerScheduledActionGroupPatch + """ + + def test_instance_group_manager_scheduled_action_group_patch_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPatch + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionGroupPatch model + instance_group_manager_scheduled_action_group_patch_model_json = {} + instance_group_manager_scheduled_action_group_patch_model_json['membership_count'] = 10 + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupPatch by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_patch_model = InstanceGroupManagerScheduledActionGroupPatch.from_dict(instance_group_manager_scheduled_action_group_patch_model_json) + assert instance_group_manager_scheduled_action_group_patch_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupPatch by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_patch_model_dict = InstanceGroupManagerScheduledActionGroupPatch.from_dict(instance_group_manager_scheduled_action_group_patch_model_json).__dict__ + instance_group_manager_scheduled_action_group_patch_model2 = InstanceGroupManagerScheduledActionGroupPatch(**instance_group_manager_scheduled_action_group_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_group_patch_model == instance_group_manager_scheduled_action_group_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_group_patch_model_json2 = instance_group_manager_scheduled_action_group_patch_model.to_dict() + assert instance_group_manager_scheduled_action_group_patch_model_json2 == instance_group_manager_scheduled_action_group_patch_model_json + +class TestInstanceGroupManagerScheduledActionGroupPrototype(): + """ + Test Class for InstanceGroupManagerScheduledActionGroupPrototype + """ + + def test_instance_group_manager_scheduled_action_group_prototype_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPrototype + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionGroupPrototype model + instance_group_manager_scheduled_action_group_prototype_model_json = {} + instance_group_manager_scheduled_action_group_prototype_model_json['membership_count'] = 10 + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_prototype_model = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json) + assert instance_group_manager_scheduled_action_group_prototype_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation + instance_group_manager_scheduled_action_group_prototype_model_dict = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json).__dict__ + instance_group_manager_scheduled_action_group_prototype_model2 = InstanceGroupManagerScheduledActionGroupPrototype(**instance_group_manager_scheduled_action_group_prototype_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_group_prototype_model == instance_group_manager_scheduled_action_group_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_group_prototype_model_json2 = instance_group_manager_scheduled_action_group_prototype_model.to_dict() + assert instance_group_manager_scheduled_action_group_prototype_model_json2 == instance_group_manager_scheduled_action_group_prototype_model_json class TestInstanceGroupMembership(): """ @@ -27178,87 +28120,62 @@ def test_instance_group_membership_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - instance_template_reference_deleted_model = { - } # InstanceTemplateReferenceDeleted - instance_template_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_template_reference_model = {} # InstanceTemplateReference - instance_template_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'deleted'] = instance_template_reference_deleted_model - instance_template_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted + instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_template_reference_model = {} # InstanceTemplateReference + instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['deleted'] = instance_template_reference_deleted_model + instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_reference_model['name'] = 'my-instance-template' - load_balancer_pool_member_reference_deleted_model = { - } # LoadBalancerPoolMemberReferenceDeleted - load_balancer_pool_member_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted + load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - load_balancer_pool_member_reference_model = { - } # LoadBalancerPoolMemberReference - load_balancer_pool_member_reference_model[ - 'deleted'] = load_balancer_pool_member_reference_deleted_model - load_balancer_pool_member_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference + load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model + load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a json representation of a InstanceGroupMembership model instance_group_membership_model_json = {} - instance_group_membership_model_json[ - 'delete_instance_on_membership_delete'] = True - instance_group_membership_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed' - instance_group_membership_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_membership_model_json[ - 'instance'] = instance_reference_model - instance_group_membership_model_json[ - 'instance_template'] = instance_template_reference_model - instance_group_membership_model_json[ - 'name'] = 'my-instance-group-membership' - instance_group_membership_model_json[ - 'pool_member'] = load_balancer_pool_member_reference_model + instance_group_membership_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_membership_model_json['delete_instance_on_membership_delete'] = True + instance_group_membership_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed' + instance_group_membership_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_membership_model_json['instance'] = instance_reference_model + instance_group_membership_model_json['instance_template'] = instance_template_reference_model + instance_group_membership_model_json['name'] = 'my-instance-group-membership' + instance_group_membership_model_json['pool_member'] = load_balancer_pool_member_reference_model instance_group_membership_model_json['status'] = 'deleting' + instance_group_membership_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation - instance_group_membership_model = InstanceGroupMembership.from_dict( - instance_group_membership_model_json) + instance_group_membership_model = InstanceGroupMembership.from_dict(instance_group_membership_model_json) assert instance_group_membership_model != False # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation - instance_group_membership_model_dict = InstanceGroupMembership.from_dict( - instance_group_membership_model_json).__dict__ - instance_group_membership_model2 = InstanceGroupMembership( - **instance_group_membership_model_dict) + instance_group_membership_model_dict = InstanceGroupMembership.from_dict(instance_group_membership_model_json).__dict__ + instance_group_membership_model2 = InstanceGroupMembership(**instance_group_membership_model_dict) # Verify the model instances are equivalent assert instance_group_membership_model == instance_group_membership_model2 # Convert model instance back to dict and verify no loss of data - instance_group_membership_model_json2 = instance_group_membership_model.to_dict( - ) + instance_group_membership_model_json2 = instance_group_membership_model.to_dict() assert instance_group_membership_model_json2 == instance_group_membership_model_json - class TestInstanceGroupMembershipCollection(): """ Test Class for InstanceGroupMembershipCollection @@ -27271,106 +28188,75 @@ def test_instance_group_membership_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_membership_collection_first_model = { - } # InstanceGroupMembershipCollectionFirst - instance_group_membership_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' + instance_group_membership_collection_first_model = {} # InstanceGroupMembershipCollectionFirst + instance_group_membership_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - instance_template_reference_deleted_model = { - } # InstanceTemplateReferenceDeleted - instance_template_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_template_reference_model = {} # InstanceTemplateReference - instance_template_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'deleted'] = instance_template_reference_deleted_model - instance_template_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted + instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_template_reference_model = {} # InstanceTemplateReference + instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['deleted'] = instance_template_reference_deleted_model + instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_reference_model['name'] = 'my-instance-template' - load_balancer_pool_member_reference_deleted_model = { - } # LoadBalancerPoolMemberReferenceDeleted - load_balancer_pool_member_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_member_reference_model = { - } # LoadBalancerPoolMemberReference - load_balancer_pool_member_reference_model[ - 'deleted'] = load_balancer_pool_member_reference_deleted_model - load_balancer_pool_member_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - instance_group_membership_model = {} # InstanceGroupMembership - instance_group_membership_model[ - 'delete_instance_on_membership_delete'] = True - instance_group_membership_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed' - instance_group_membership_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted + load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference + load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model + load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + instance_group_membership_model = {} # InstanceGroupMembership + instance_group_membership_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_membership_model['delete_instance_on_membership_delete'] = True + instance_group_membership_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed' + instance_group_membership_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_membership_model['instance'] = instance_reference_model - instance_group_membership_model[ - 'instance_template'] = instance_template_reference_model + instance_group_membership_model['instance_template'] = instance_template_reference_model instance_group_membership_model['name'] = 'my-instance-group-membership' - instance_group_membership_model[ - 'pool_member'] = load_balancer_pool_member_reference_model + instance_group_membership_model['pool_member'] = load_balancer_pool_member_reference_model instance_group_membership_model['status'] = 'deleting' + instance_group_membership_model['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) - instance_group_membership_collection_next_model = { - } # InstanceGroupMembershipCollectionNext - instance_group_membership_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_membership_collection_next_model = {} # InstanceGroupMembershipCollectionNext + instance_group_membership_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a InstanceGroupMembershipCollection model instance_group_membership_collection_model_json = {} - instance_group_membership_collection_model_json[ - 'first'] = instance_group_membership_collection_first_model + instance_group_membership_collection_model_json['first'] = instance_group_membership_collection_first_model instance_group_membership_collection_model_json['limit'] = 20 - instance_group_membership_collection_model_json['memberships'] = [ - instance_group_membership_model - ] - instance_group_membership_collection_model_json[ - 'next'] = instance_group_membership_collection_next_model + instance_group_membership_collection_model_json['memberships'] = [instance_group_membership_model] + instance_group_membership_collection_model_json['next'] = instance_group_membership_collection_next_model instance_group_membership_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation - instance_group_membership_collection_model = InstanceGroupMembershipCollection.from_dict( - instance_group_membership_collection_model_json) + instance_group_membership_collection_model = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json) assert instance_group_membership_collection_model != False # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation - instance_group_membership_collection_model_dict = InstanceGroupMembershipCollection.from_dict( - instance_group_membership_collection_model_json).__dict__ - instance_group_membership_collection_model2 = InstanceGroupMembershipCollection( - **instance_group_membership_collection_model_dict) + instance_group_membership_collection_model_dict = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json).__dict__ + instance_group_membership_collection_model2 = InstanceGroupMembershipCollection(**instance_group_membership_collection_model_dict) # Verify the model instances are equivalent assert instance_group_membership_collection_model == instance_group_membership_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_group_membership_collection_model_json2 = instance_group_membership_collection_model.to_dict( - ) + instance_group_membership_collection_model_json2 = instance_group_membership_collection_model.to_dict() assert instance_group_membership_collection_model_json2 == instance_group_membership_collection_model_json - class TestInstanceGroupMembershipCollectionFirst(): """ Test Class for InstanceGroupMembershipCollectionFirst @@ -27383,29 +28269,23 @@ def test_instance_group_membership_collection_first_serialization(self): # Construct a json representation of a InstanceGroupMembershipCollectionFirst model instance_group_membership_collection_first_model_json = {} - instance_group_membership_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' + instance_group_membership_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation - instance_group_membership_collection_first_model = InstanceGroupMembershipCollectionFirst.from_dict( - instance_group_membership_collection_first_model_json) + instance_group_membership_collection_first_model = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json) assert instance_group_membership_collection_first_model != False # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation - instance_group_membership_collection_first_model_dict = InstanceGroupMembershipCollectionFirst.from_dict( - instance_group_membership_collection_first_model_json).__dict__ - instance_group_membership_collection_first_model2 = InstanceGroupMembershipCollectionFirst( - **instance_group_membership_collection_first_model_dict) + instance_group_membership_collection_first_model_dict = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json).__dict__ + instance_group_membership_collection_first_model2 = InstanceGroupMembershipCollectionFirst(**instance_group_membership_collection_first_model_dict) # Verify the model instances are equivalent assert instance_group_membership_collection_first_model == instance_group_membership_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_group_membership_collection_first_model_json2 = instance_group_membership_collection_first_model.to_dict( - ) + instance_group_membership_collection_first_model_json2 = instance_group_membership_collection_first_model.to_dict() assert instance_group_membership_collection_first_model_json2 == instance_group_membership_collection_first_model_json - class TestInstanceGroupMembershipCollectionNext(): """ Test Class for InstanceGroupMembershipCollectionNext @@ -27418,29 +28298,23 @@ def test_instance_group_membership_collection_next_serialization(self): # Construct a json representation of a InstanceGroupMembershipCollectionNext model instance_group_membership_collection_next_model_json = {} - instance_group_membership_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_group_membership_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation - instance_group_membership_collection_next_model = InstanceGroupMembershipCollectionNext.from_dict( - instance_group_membership_collection_next_model_json) + instance_group_membership_collection_next_model = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json) assert instance_group_membership_collection_next_model != False # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation - instance_group_membership_collection_next_model_dict = InstanceGroupMembershipCollectionNext.from_dict( - instance_group_membership_collection_next_model_json).__dict__ - instance_group_membership_collection_next_model2 = InstanceGroupMembershipCollectionNext( - **instance_group_membership_collection_next_model_dict) + instance_group_membership_collection_next_model_dict = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json).__dict__ + instance_group_membership_collection_next_model2 = InstanceGroupMembershipCollectionNext(**instance_group_membership_collection_next_model_dict) # Verify the model instances are equivalent assert instance_group_membership_collection_next_model == instance_group_membership_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_group_membership_collection_next_model_json2 = instance_group_membership_collection_next_model.to_dict( - ) + instance_group_membership_collection_next_model_json2 = instance_group_membership_collection_next_model.to_dict() assert instance_group_membership_collection_next_model_json2 == instance_group_membership_collection_next_model_json - class TestInstanceGroupMembershipPatch(): """ Test Class for InstanceGroupMembershipPatch @@ -27453,29 +28327,23 @@ def test_instance_group_membership_patch_serialization(self): # Construct a json representation of a InstanceGroupMembershipPatch model instance_group_membership_patch_model_json = {} - instance_group_membership_patch_model_json[ - 'name'] = 'my-instance-group-membership' + instance_group_membership_patch_model_json['name'] = 'my-instance-group-membership' # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation - instance_group_membership_patch_model = InstanceGroupMembershipPatch.from_dict( - instance_group_membership_patch_model_json) + instance_group_membership_patch_model = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json) assert instance_group_membership_patch_model != False # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation - instance_group_membership_patch_model_dict = InstanceGroupMembershipPatch.from_dict( - instance_group_membership_patch_model_json).__dict__ - instance_group_membership_patch_model2 = InstanceGroupMembershipPatch( - **instance_group_membership_patch_model_dict) + instance_group_membership_patch_model_dict = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json).__dict__ + instance_group_membership_patch_model2 = InstanceGroupMembershipPatch(**instance_group_membership_patch_model_dict) # Verify the model instances are equivalent assert instance_group_membership_patch_model == instance_group_membership_patch_model2 # Convert model instance back to dict and verify no loss of data - instance_group_membership_patch_model_json2 = instance_group_membership_patch_model.to_dict( - ) + instance_group_membership_patch_model_json2 = instance_group_membership_patch_model.to_dict() assert instance_group_membership_patch_model_json2 == instance_group_membership_patch_model_json - class TestInstanceGroupPatch(): """ Test Class for InstanceGroupPatch @@ -27488,44 +28356,35 @@ def test_instance_group_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_template_identity_model = {} # InstanceTemplateIdentityById - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model = {} # InstanceTemplateIdentityById + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - load_balancer_identity_model = {} # LoadBalancerIdentityById - load_balancer_identity_model[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_model = {} # LoadBalancerIdentityById + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a json representation of a InstanceGroupPatch model instance_group_patch_model_json = {} instance_group_patch_model_json['application_port'] = 22 - instance_group_patch_model_json[ - 'instance_template'] = instance_template_identity_model - instance_group_patch_model_json[ - 'load_balancer'] = load_balancer_identity_model - instance_group_patch_model_json[ - 'load_balancer_pool'] = load_balancer_pool_identity_model + instance_group_patch_model_json['instance_template'] = instance_template_identity_model + instance_group_patch_model_json['load_balancer'] = load_balancer_identity_model + instance_group_patch_model_json['load_balancer_pool'] = load_balancer_pool_identity_model instance_group_patch_model_json['membership_count'] = 10 instance_group_patch_model_json['name'] = 'my-instance-group' instance_group_patch_model_json['subnets'] = [subnet_identity_model] # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation - instance_group_patch_model = InstanceGroupPatch.from_dict( - instance_group_patch_model_json) + instance_group_patch_model = InstanceGroupPatch.from_dict(instance_group_patch_model_json) assert instance_group_patch_model != False # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation - instance_group_patch_model_dict = InstanceGroupPatch.from_dict( - instance_group_patch_model_json).__dict__ - instance_group_patch_model2 = InstanceGroupPatch( - **instance_group_patch_model_dict) + instance_group_patch_model_dict = InstanceGroupPatch.from_dict(instance_group_patch_model_json).__dict__ + instance_group_patch_model2 = InstanceGroupPatch(**instance_group_patch_model_dict) # Verify the model instances are equivalent assert instance_group_patch_model == instance_group_patch_model2 @@ -27534,7 +28393,6 @@ def test_instance_group_patch_serialization(self): instance_group_patch_model_json2 = instance_group_patch_model.to_dict() assert instance_group_patch_model_json2 == instance_group_patch_model_json - class TestInstanceGroupReference(): """ Test Class for InstanceGroupReference @@ -27547,43 +28405,32 @@ def test_instance_group_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_reference_deleted_model = { - } # InstanceGroupReferenceDeleted - instance_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted + instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a InstanceGroupReference model instance_group_reference_model_json = {} - instance_group_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model_json[ - 'deleted'] = instance_group_reference_deleted_model - instance_group_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model_json['deleted'] = instance_group_reference_deleted_model + instance_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_reference_model_json['name'] = 'my-instance-group' # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation - instance_group_reference_model = InstanceGroupReference.from_dict( - instance_group_reference_model_json) + instance_group_reference_model = InstanceGroupReference.from_dict(instance_group_reference_model_json) assert instance_group_reference_model != False # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation - instance_group_reference_model_dict = InstanceGroupReference.from_dict( - instance_group_reference_model_json).__dict__ - instance_group_reference_model2 = InstanceGroupReference( - **instance_group_reference_model_dict) + instance_group_reference_model_dict = InstanceGroupReference.from_dict(instance_group_reference_model_json).__dict__ + instance_group_reference_model2 = InstanceGroupReference(**instance_group_reference_model_dict) # Verify the model instances are equivalent assert instance_group_reference_model == instance_group_reference_model2 # Convert model instance back to dict and verify no loss of data - instance_group_reference_model_json2 = instance_group_reference_model.to_dict( - ) + instance_group_reference_model_json2 = instance_group_reference_model.to_dict() assert instance_group_reference_model_json2 == instance_group_reference_model_json - class TestInstanceGroupReferenceDeleted(): """ Test Class for InstanceGroupReferenceDeleted @@ -27596,29 +28443,23 @@ def test_instance_group_reference_deleted_serialization(self): # Construct a json representation of a InstanceGroupReferenceDeleted model instance_group_reference_deleted_model_json = {} - instance_group_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation - instance_group_reference_deleted_model = InstanceGroupReferenceDeleted.from_dict( - instance_group_reference_deleted_model_json) + instance_group_reference_deleted_model = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json) assert instance_group_reference_deleted_model != False # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation - instance_group_reference_deleted_model_dict = InstanceGroupReferenceDeleted.from_dict( - instance_group_reference_deleted_model_json).__dict__ - instance_group_reference_deleted_model2 = InstanceGroupReferenceDeleted( - **instance_group_reference_deleted_model_dict) + instance_group_reference_deleted_model_dict = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json).__dict__ + instance_group_reference_deleted_model2 = InstanceGroupReferenceDeleted(**instance_group_reference_deleted_model_dict) # Verify the model instances are equivalent assert instance_group_reference_deleted_model == instance_group_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - instance_group_reference_deleted_model_json2 = instance_group_reference_deleted_model.to_dict( - ) + instance_group_reference_deleted_model_json2 = instance_group_reference_deleted_model.to_dict() assert instance_group_reference_deleted_model_json2 == instance_group_reference_deleted_model_json - class TestInstanceInitialization(): """ Test Class for InstanceInitialization @@ -27631,59 +28472,41 @@ def test_instance_initialization_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_reference_deleted_model = {} # KeyReferenceDeleted - key_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - key_reference_instance_initialization_context_model = { - } # KeyReferenceInstanceInitializationContextKeyReference - key_reference_instance_initialization_context_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model[ - 'deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_model[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_instance_initialization_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_deleted_model = {} # KeyReferenceDeleted + key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + key_reference_instance_initialization_context_model = {} # KeyReferenceInstanceInitializationContextKeyReference + key_reference_instance_initialization_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_model['deleted'] = key_reference_deleted_model + key_reference_instance_initialization_context_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_reference_instance_initialization_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' key_reference_instance_initialization_context_model['name'] = 'my-key' - instance_initialization_password_model = { - } # InstanceInitializationPassword - instance_initialization_password_model[ - 'encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' - instance_initialization_password_model[ - 'encryption_key'] = key_reference_instance_initialization_context_model + instance_initialization_password_model = {} # InstanceInitializationPassword + instance_initialization_password_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' + instance_initialization_password_model['encryption_key'] = key_reference_instance_initialization_context_model # Construct a json representation of a InstanceInitialization model instance_initialization_model_json = {} - instance_initialization_model_json['keys'] = [ - key_reference_instance_initialization_context_model - ] - instance_initialization_model_json[ - 'password'] = instance_initialization_password_model + instance_initialization_model_json['keys'] = [key_reference_instance_initialization_context_model] + instance_initialization_model_json['password'] = instance_initialization_password_model # Construct a model instance of InstanceInitialization by calling from_dict on the json representation - instance_initialization_model = InstanceInitialization.from_dict( - instance_initialization_model_json) + instance_initialization_model = InstanceInitialization.from_dict(instance_initialization_model_json) assert instance_initialization_model != False # Construct a model instance of InstanceInitialization by calling from_dict on the json representation - instance_initialization_model_dict = InstanceInitialization.from_dict( - instance_initialization_model_json).__dict__ - instance_initialization_model2 = InstanceInitialization( - **instance_initialization_model_dict) + instance_initialization_model_dict = InstanceInitialization.from_dict(instance_initialization_model_json).__dict__ + instance_initialization_model2 = InstanceInitialization(**instance_initialization_model_dict) # Verify the model instances are equivalent assert instance_initialization_model == instance_initialization_model2 # Convert model instance back to dict and verify no loss of data - instance_initialization_model_json2 = instance_initialization_model.to_dict( - ) + instance_initialization_model_json2 = instance_initialization_model.to_dict() assert instance_initialization_model_json2 == instance_initialization_model_json - class TestInstanceInitializationPassword(): """ Test Class for InstanceInitializationPassword @@ -27696,51 +28519,37 @@ def test_instance_initialization_password_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_reference_deleted_model = {} # KeyReferenceDeleted - key_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - key_reference_instance_initialization_context_model = { - } # KeyReferenceInstanceInitializationContextKeyReference - key_reference_instance_initialization_context_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model[ - 'deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_model[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_instance_initialization_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_deleted_model = {} # KeyReferenceDeleted + key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + key_reference_instance_initialization_context_model = {} # KeyReferenceInstanceInitializationContextKeyReference + key_reference_instance_initialization_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_model['deleted'] = key_reference_deleted_model + key_reference_instance_initialization_context_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_reference_instance_initialization_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' key_reference_instance_initialization_context_model['name'] = 'my-key' # Construct a json representation of a InstanceInitializationPassword model instance_initialization_password_model_json = {} - instance_initialization_password_model_json[ - 'encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' - instance_initialization_password_model_json[ - 'encryption_key'] = key_reference_instance_initialization_context_model + instance_initialization_password_model_json['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' + instance_initialization_password_model_json['encryption_key'] = key_reference_instance_initialization_context_model # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation - instance_initialization_password_model = InstanceInitializationPassword.from_dict( - instance_initialization_password_model_json) + instance_initialization_password_model = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json) assert instance_initialization_password_model != False # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation - instance_initialization_password_model_dict = InstanceInitializationPassword.from_dict( - instance_initialization_password_model_json).__dict__ - instance_initialization_password_model2 = InstanceInitializationPassword( - **instance_initialization_password_model_dict) + instance_initialization_password_model_dict = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json).__dict__ + instance_initialization_password_model2 = InstanceInitializationPassword(**instance_initialization_password_model_dict) # Verify the model instances are equivalent assert instance_initialization_password_model == instance_initialization_password_model2 # Convert model instance back to dict and verify no loss of data - instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict( - ) + instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict() assert instance_initialization_password_model_json2 == instance_initialization_password_model_json - class TestInstancePatch(): """ Test Class for InstancePatch @@ -27751,18 +28560,22 @@ def test_instance_patch_serialization(self): Test serialization/deserialization for InstancePatch """ + # Construct dict forms of any model objects needed in order to build this model. + + instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName + instance_patch_profile_model['name'] = 'bc1-4x16' + # Construct a json representation of a InstancePatch model instance_patch_model_json = {} instance_patch_model_json['name'] = 'my-instance' + instance_patch_model_json['profile'] = instance_patch_profile_model # Construct a model instance of InstancePatch by calling from_dict on the json representation - instance_patch_model = InstancePatch.from_dict( - instance_patch_model_json) + instance_patch_model = InstancePatch.from_dict(instance_patch_model_json) assert instance_patch_model != False # Construct a model instance of InstancePatch by calling from_dict on the json representation - instance_patch_model_dict = InstancePatch.from_dict( - instance_patch_model_json).__dict__ + instance_patch_model_dict = InstancePatch.from_dict(instance_patch_model_json).__dict__ instance_patch_model2 = InstancePatch(**instance_patch_model_dict) # Verify the model instances are equivalent @@ -27772,7 +28585,6 @@ def test_instance_patch_serialization(self): instance_patch_model_json2 = instance_patch_model.to_dict() assert instance_patch_model_json2 == instance_patch_model_json - class TestInstanceProfile(): """ Test Class for InstanceProfile @@ -27785,59 +28597,69 @@ def test_instance_profile_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed + instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed instance_profile_bandwidth_model['type'] = 'fixed' instance_profile_bandwidth_model['value'] = 20000 - instance_profile_memory_model = {} # InstanceProfileMemoryFixed + instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed + instance_profile_disk_quantity_model['type'] = 'fixed' + instance_profile_disk_quantity_model['value'] = 4 + + instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed + instance_profile_disk_size_model['type'] = 'fixed' + instance_profile_disk_size_model['value'] = 100 + + instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces + instance_profile_disk_supported_interfaces_model['default'] = 'virtio_blk' + instance_profile_disk_supported_interfaces_model['type'] = 'enum' + instance_profile_disk_supported_interfaces_model['values'] = ['virtio_blk'] + + instance_profile_disk_model = {} # InstanceProfileDisk + instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model + instance_profile_disk_model['size'] = instance_profile_disk_size_model + instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model + + instance_profile_memory_model = {} # InstanceProfileMemoryFixed instance_profile_memory_model['type'] = 'fixed' instance_profile_memory_model['value'] = 16 - instance_profile_os_architecture_model = { - } # InstanceProfileOSArchitecture + instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture instance_profile_os_architecture_model['default'] = 'testString' instance_profile_os_architecture_model['type'] = 'enum' instance_profile_os_architecture_model['values'] = ['amd64'] - instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed + instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed instance_profile_port_speed_model['type'] = 'fixed' instance_profile_port_speed_model['value'] = 1000 - instance_profile_vcpu_architecture_model = { - } # InstanceProfileVCPUArchitecture + instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture instance_profile_vcpu_architecture_model['default'] = 'testString' instance_profile_vcpu_architecture_model['type'] = 'fixed' instance_profile_vcpu_architecture_model['value'] = 'amd64' - instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed + instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed instance_profile_vcpu_model['type'] = 'fixed' instance_profile_vcpu_model['value'] = 16 # Construct a json representation of a InstanceProfile model instance_profile_model_json = {} - instance_profile_model_json[ - 'bandwidth'] = instance_profile_bandwidth_model + instance_profile_model_json['bandwidth'] = instance_profile_bandwidth_model + instance_profile_model_json['disks'] = [instance_profile_disk_model] instance_profile_model_json['family'] = 'balanced' - instance_profile_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_model_json['memory'] = instance_profile_memory_model instance_profile_model_json['name'] = 'bc1-4x16' - instance_profile_model_json[ - 'os_architecture'] = instance_profile_os_architecture_model - instance_profile_model_json[ - 'port_speed'] = instance_profile_port_speed_model - instance_profile_model_json[ - 'vcpu_architecture'] = instance_profile_vcpu_architecture_model + instance_profile_model_json['os_architecture'] = instance_profile_os_architecture_model + instance_profile_model_json['port_speed'] = instance_profile_port_speed_model + instance_profile_model_json['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model_json['vcpu_count'] = instance_profile_vcpu_model # Construct a model instance of InstanceProfile by calling from_dict on the json representation - instance_profile_model = InstanceProfile.from_dict( - instance_profile_model_json) + instance_profile_model = InstanceProfile.from_dict(instance_profile_model_json) assert instance_profile_model != False # Construct a model instance of InstanceProfile by calling from_dict on the json representation - instance_profile_model_dict = InstanceProfile.from_dict( - instance_profile_model_json).__dict__ + instance_profile_model_dict = InstanceProfile.from_dict(instance_profile_model_json).__dict__ instance_profile_model2 = InstanceProfile(**instance_profile_model_dict) # Verify the model instances are equivalent @@ -27847,7 +28669,6 @@ def test_instance_profile_serialization(self): instance_profile_model_json2 = instance_profile_model.to_dict() assert instance_profile_model_json2 == instance_profile_model_json - class TestInstanceProfileCollection(): """ Test Class for InstanceProfileCollection @@ -27860,73 +28681,157 @@ def test_instance_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed + instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed instance_profile_bandwidth_model['type'] = 'fixed' instance_profile_bandwidth_model['value'] = 20000 - instance_profile_memory_model = {} # InstanceProfileMemoryFixed + instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed + instance_profile_disk_quantity_model['type'] = 'fixed' + instance_profile_disk_quantity_model['value'] = 4 + + instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed + instance_profile_disk_size_model['type'] = 'fixed' + instance_profile_disk_size_model['value'] = 100 + + instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces + instance_profile_disk_supported_interfaces_model['default'] = 'virtio_blk' + instance_profile_disk_supported_interfaces_model['type'] = 'enum' + instance_profile_disk_supported_interfaces_model['values'] = ['virtio_blk'] + + instance_profile_disk_model = {} # InstanceProfileDisk + instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model + instance_profile_disk_model['size'] = instance_profile_disk_size_model + instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model + + instance_profile_memory_model = {} # InstanceProfileMemoryFixed instance_profile_memory_model['type'] = 'fixed' instance_profile_memory_model['value'] = 16 - instance_profile_os_architecture_model = { - } # InstanceProfileOSArchitecture + instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture instance_profile_os_architecture_model['default'] = 'testString' instance_profile_os_architecture_model['type'] = 'enum' instance_profile_os_architecture_model['values'] = ['amd64'] - instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed + instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed instance_profile_port_speed_model['type'] = 'fixed' instance_profile_port_speed_model['value'] = 1000 - instance_profile_vcpu_architecture_model = { - } # InstanceProfileVCPUArchitecture + instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture instance_profile_vcpu_architecture_model['default'] = 'testString' instance_profile_vcpu_architecture_model['type'] = 'fixed' instance_profile_vcpu_architecture_model['value'] = 'amd64' - instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed + instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed instance_profile_vcpu_model['type'] = 'fixed' instance_profile_vcpu_model['value'] = 16 - instance_profile_model = {} # InstanceProfile + instance_profile_model = {} # InstanceProfile instance_profile_model['bandwidth'] = instance_profile_bandwidth_model + instance_profile_model['disks'] = [instance_profile_disk_model] instance_profile_model['family'] = 'balanced' - instance_profile_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_model['memory'] = instance_profile_memory_model instance_profile_model['name'] = 'bc1-4x16' - instance_profile_model[ - 'os_architecture'] = instance_profile_os_architecture_model + instance_profile_model['os_architecture'] = instance_profile_os_architecture_model instance_profile_model['port_speed'] = instance_profile_port_speed_model - instance_profile_model[ - 'vcpu_architecture'] = instance_profile_vcpu_architecture_model + instance_profile_model['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model['vcpu_count'] = instance_profile_vcpu_model # Construct a json representation of a InstanceProfileCollection model instance_profile_collection_model_json = {} - instance_profile_collection_model_json['profiles'] = [ - instance_profile_model - ] + instance_profile_collection_model_json['profiles'] = [instance_profile_model] # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation - instance_profile_collection_model = InstanceProfileCollection.from_dict( - instance_profile_collection_model_json) + instance_profile_collection_model = InstanceProfileCollection.from_dict(instance_profile_collection_model_json) assert instance_profile_collection_model != False # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation - instance_profile_collection_model_dict = InstanceProfileCollection.from_dict( - instance_profile_collection_model_json).__dict__ - instance_profile_collection_model2 = InstanceProfileCollection( - **instance_profile_collection_model_dict) + instance_profile_collection_model_dict = InstanceProfileCollection.from_dict(instance_profile_collection_model_json).__dict__ + instance_profile_collection_model2 = InstanceProfileCollection(**instance_profile_collection_model_dict) # Verify the model instances are equivalent assert instance_profile_collection_model == instance_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_collection_model_json2 = instance_profile_collection_model.to_dict( - ) + instance_profile_collection_model_json2 = instance_profile_collection_model.to_dict() assert instance_profile_collection_model_json2 == instance_profile_collection_model_json +class TestInstanceProfileDisk(): + """ + Test Class for InstanceProfileDisk + """ + + def test_instance_profile_disk_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDisk + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed + instance_profile_disk_quantity_model['type'] = 'fixed' + instance_profile_disk_quantity_model['value'] = 4 + + instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed + instance_profile_disk_size_model['type'] = 'fixed' + instance_profile_disk_size_model['value'] = 100 + + instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces + instance_profile_disk_supported_interfaces_model['default'] = 'virtio_blk' + instance_profile_disk_supported_interfaces_model['type'] = 'enum' + instance_profile_disk_supported_interfaces_model['values'] = ['virtio_blk'] + + # Construct a json representation of a InstanceProfileDisk model + instance_profile_disk_model_json = {} + instance_profile_disk_model_json['quantity'] = instance_profile_disk_quantity_model + instance_profile_disk_model_json['size'] = instance_profile_disk_size_model + instance_profile_disk_model_json['supported_interface_types'] = instance_profile_disk_supported_interfaces_model + + # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation + instance_profile_disk_model = InstanceProfileDisk.from_dict(instance_profile_disk_model_json) + assert instance_profile_disk_model != False + + # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation + instance_profile_disk_model_dict = InstanceProfileDisk.from_dict(instance_profile_disk_model_json).__dict__ + instance_profile_disk_model2 = InstanceProfileDisk(**instance_profile_disk_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_model == instance_profile_disk_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_model_json2 = instance_profile_disk_model.to_dict() + assert instance_profile_disk_model_json2 == instance_profile_disk_model_json + +class TestInstanceProfileDiskSupportedInterfaces(): + """ + Test Class for InstanceProfileDiskSupportedInterfaces + """ + + def test_instance_profile_disk_supported_interfaces_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskSupportedInterfaces + """ + + # Construct a json representation of a InstanceProfileDiskSupportedInterfaces model + instance_profile_disk_supported_interfaces_model_json = {} + instance_profile_disk_supported_interfaces_model_json['default'] = 'virtio_blk' + instance_profile_disk_supported_interfaces_model_json['type'] = 'enum' + instance_profile_disk_supported_interfaces_model_json['values'] = ['virtio_blk'] + + # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation + instance_profile_disk_supported_interfaces_model = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json) + assert instance_profile_disk_supported_interfaces_model != False + + # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation + instance_profile_disk_supported_interfaces_model_dict = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json).__dict__ + instance_profile_disk_supported_interfaces_model2 = InstanceProfileDiskSupportedInterfaces(**instance_profile_disk_supported_interfaces_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_supported_interfaces_model == instance_profile_disk_supported_interfaces_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_supported_interfaces_model_json2 = instance_profile_disk_supported_interfaces_model.to_dict() + assert instance_profile_disk_supported_interfaces_model_json2 == instance_profile_disk_supported_interfaces_model_json class TestInstanceProfileOSArchitecture(): """ @@ -27945,25 +28850,20 @@ def test_instance_profile_os_architecture_serialization(self): instance_profile_os_architecture_model_json['values'] = ['amd64'] # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation - instance_profile_os_architecture_model = InstanceProfileOSArchitecture.from_dict( - instance_profile_os_architecture_model_json) + instance_profile_os_architecture_model = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json) assert instance_profile_os_architecture_model != False # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation - instance_profile_os_architecture_model_dict = InstanceProfileOSArchitecture.from_dict( - instance_profile_os_architecture_model_json).__dict__ - instance_profile_os_architecture_model2 = InstanceProfileOSArchitecture( - **instance_profile_os_architecture_model_dict) + instance_profile_os_architecture_model_dict = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json).__dict__ + instance_profile_os_architecture_model2 = InstanceProfileOSArchitecture(**instance_profile_os_architecture_model_dict) # Verify the model instances are equivalent assert instance_profile_os_architecture_model == instance_profile_os_architecture_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_os_architecture_model_json2 = instance_profile_os_architecture_model.to_dict( - ) + instance_profile_os_architecture_model_json2 = instance_profile_os_architecture_model.to_dict() assert instance_profile_os_architecture_model_json2 == instance_profile_os_architecture_model_json - class TestInstanceProfileReference(): """ Test Class for InstanceProfileReference @@ -27976,30 +28876,24 @@ def test_instance_profile_reference_serialization(self): # Construct a json representation of a InstanceProfileReference model instance_profile_reference_model_json = {} - instance_profile_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' instance_profile_reference_model_json['name'] = 'bc1-4x16' # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation - instance_profile_reference_model = InstanceProfileReference.from_dict( - instance_profile_reference_model_json) + instance_profile_reference_model = InstanceProfileReference.from_dict(instance_profile_reference_model_json) assert instance_profile_reference_model != False # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation - instance_profile_reference_model_dict = InstanceProfileReference.from_dict( - instance_profile_reference_model_json).__dict__ - instance_profile_reference_model2 = InstanceProfileReference( - **instance_profile_reference_model_dict) + instance_profile_reference_model_dict = InstanceProfileReference.from_dict(instance_profile_reference_model_json).__dict__ + instance_profile_reference_model2 = InstanceProfileReference(**instance_profile_reference_model_dict) # Verify the model instances are equivalent assert instance_profile_reference_model == instance_profile_reference_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict( - ) + instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict() assert instance_profile_reference_model_json2 == instance_profile_reference_model_json - class TestInstanceProfileVCPUArchitecture(): """ Test Class for InstanceProfileVCPUArchitecture @@ -28017,25 +28911,20 @@ def test_instance_profile_vcpu_architecture_serialization(self): instance_profile_vcpu_architecture_model_json['value'] = 'amd64' # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation - instance_profile_vcpu_architecture_model = InstanceProfileVCPUArchitecture.from_dict( - instance_profile_vcpu_architecture_model_json) + instance_profile_vcpu_architecture_model = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json) assert instance_profile_vcpu_architecture_model != False # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation - instance_profile_vcpu_architecture_model_dict = InstanceProfileVCPUArchitecture.from_dict( - instance_profile_vcpu_architecture_model_json).__dict__ - instance_profile_vcpu_architecture_model2 = InstanceProfileVCPUArchitecture( - **instance_profile_vcpu_architecture_model_dict) + instance_profile_vcpu_architecture_model_dict = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json).__dict__ + instance_profile_vcpu_architecture_model2 = InstanceProfileVCPUArchitecture(**instance_profile_vcpu_architecture_model_dict) # Verify the model instances are equivalent assert instance_profile_vcpu_architecture_model == instance_profile_vcpu_architecture_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_vcpu_architecture_model_json2 = instance_profile_vcpu_architecture_model.to_dict( - ) + instance_profile_vcpu_architecture_model_json2 = instance_profile_vcpu_architecture_model.to_dict() assert instance_profile_vcpu_architecture_model_json2 == instance_profile_vcpu_architecture_model_json - class TestInstanceReference(): """ Test Class for InstanceReference @@ -28048,32 +28937,24 @@ def test_instance_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a InstanceReference model instance_reference_model_json = {} - instance_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_reference_model_json[ - 'deleted'] = instance_reference_deleted_model - instance_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model_json['deleted'] = instance_reference_deleted_model + instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of InstanceReference by calling from_dict on the json representation - instance_reference_model = InstanceReference.from_dict( - instance_reference_model_json) + instance_reference_model = InstanceReference.from_dict(instance_reference_model_json) assert instance_reference_model != False # Construct a model instance of InstanceReference by calling from_dict on the json representation - instance_reference_model_dict = InstanceReference.from_dict( - instance_reference_model_json).__dict__ - instance_reference_model2 = InstanceReference( - **instance_reference_model_dict) + instance_reference_model_dict = InstanceReference.from_dict(instance_reference_model_json).__dict__ + instance_reference_model2 = InstanceReference(**instance_reference_model_dict) # Verify the model instances are equivalent assert instance_reference_model == instance_reference_model2 @@ -28082,7 +28963,6 @@ def test_instance_reference_serialization(self): instance_reference_model_json2 = instance_reference_model.to_dict() assert instance_reference_model_json2 == instance_reference_model_json - class TestInstanceReferenceDeleted(): """ Test Class for InstanceReferenceDeleted @@ -28095,28 +28975,53 @@ def test_instance_reference_deleted_serialization(self): # Construct a json representation of a InstanceReferenceDeleted model instance_reference_deleted_model_json = {} - instance_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation - instance_reference_deleted_model = InstanceReferenceDeleted.from_dict( - instance_reference_deleted_model_json) + instance_reference_deleted_model = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json) assert instance_reference_deleted_model != False # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation - instance_reference_deleted_model_dict = InstanceReferenceDeleted.from_dict( - instance_reference_deleted_model_json).__dict__ - instance_reference_deleted_model2 = InstanceReferenceDeleted( - **instance_reference_deleted_model_dict) + instance_reference_deleted_model_dict = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json).__dict__ + instance_reference_deleted_model2 = InstanceReferenceDeleted(**instance_reference_deleted_model_dict) # Verify the model instances are equivalent assert instance_reference_deleted_model == instance_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - instance_reference_deleted_model_json2 = instance_reference_deleted_model.to_dict( - ) + instance_reference_deleted_model_json2 = instance_reference_deleted_model.to_dict() assert instance_reference_deleted_model_json2 == instance_reference_deleted_model_json +class TestInstanceStatusReason(): + """ + Test Class for InstanceStatusReason + """ + + def test_instance_status_reason_serialization(self): + """ + Test serialization/deserialization for InstanceStatusReason + """ + + # Construct a json representation of a InstanceStatusReason model + instance_status_reason_model_json = {} + instance_status_reason_model_json['code'] = 'cannot_start_storage' + instance_status_reason_model_json['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted' + instance_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + + # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation + instance_status_reason_model = InstanceStatusReason.from_dict(instance_status_reason_model_json) + assert instance_status_reason_model != False + + # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation + instance_status_reason_model_dict = InstanceStatusReason.from_dict(instance_status_reason_model_json).__dict__ + instance_status_reason_model2 = InstanceStatusReason(**instance_status_reason_model_dict) + + # Verify the model instances are equivalent + assert instance_status_reason_model == instance_status_reason_model2 + + # Convert model instance back to dict and verify no loss of data + instance_status_reason_model_json2 = instance_status_reason_model.to_dict() + assert instance_status_reason_model_json2 == instance_status_reason_model_json class TestInstanceTemplateCollection(): """ @@ -28130,153 +29035,116 @@ def test_instance_template_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_template_collection_first_model = { - } # InstanceTemplateCollectionFirst - instance_template_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' + instance_template_collection_first_model = {} # InstanceTemplateCollectionFirst + instance_template_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' - instance_template_collection_next_model = { - } # InstanceTemplateCollectionNext - instance_template_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_template_collection_next_model = {} # InstanceTemplateCollectionNext + instance_template_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - instance_template_model = {} # InstanceTemplateInstanceByImage - instance_template_model['created_at'] = '2020-01-28T18:40:40.123456Z' - instance_template_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_model = {} # InstanceTemplateInstanceByImage + instance_template_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_model['keys'] = [key_identity_model] instance_template_model['name'] = 'my-instance-template' - instance_template_model['network_interfaces'] = [ - network_interface_prototype_model - ] + instance_template_model['network_interfaces'] = [network_interface_prototype_model] + instance_template_model['placement_target'] = instance_placement_target_prototype_model instance_template_model['profile'] = instance_profile_identity_model - instance_template_model[ - 'resource_group'] = resource_group_reference_model + instance_template_model['resource_group'] = resource_group_reference_model instance_template_model['user_data'] = 'testString' - instance_template_model['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] + instance_template_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_model['vpc'] = vpc_identity_model - instance_template_model[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_model['image'] = image_identity_model - instance_template_model[ - 'primary_network_interface'] = network_interface_prototype_model + instance_template_model['primary_network_interface'] = network_interface_prototype_model instance_template_model['zone'] = zone_identity_model # Construct a json representation of a InstanceTemplateCollection model instance_template_collection_model_json = {} - instance_template_collection_model_json[ - 'first'] = instance_template_collection_first_model + instance_template_collection_model_json['first'] = instance_template_collection_first_model instance_template_collection_model_json['limit'] = 20 - instance_template_collection_model_json[ - 'next'] = instance_template_collection_next_model - instance_template_collection_model_json['templates'] = [ - instance_template_model - ] + instance_template_collection_model_json['next'] = instance_template_collection_next_model + instance_template_collection_model_json['templates'] = [instance_template_model] instance_template_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation - instance_template_collection_model = InstanceTemplateCollection.from_dict( - instance_template_collection_model_json) + instance_template_collection_model = InstanceTemplateCollection.from_dict(instance_template_collection_model_json) assert instance_template_collection_model != False # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation - instance_template_collection_model_dict = InstanceTemplateCollection.from_dict( - instance_template_collection_model_json).__dict__ - instance_template_collection_model2 = InstanceTemplateCollection( - **instance_template_collection_model_dict) + instance_template_collection_model_dict = InstanceTemplateCollection.from_dict(instance_template_collection_model_json).__dict__ + instance_template_collection_model2 = InstanceTemplateCollection(**instance_template_collection_model_dict) # Verify the model instances are equivalent assert instance_template_collection_model == instance_template_collection_model2 # Convert model instance back to dict and verify no loss of data - instance_template_collection_model_json2 = instance_template_collection_model.to_dict( - ) + instance_template_collection_model_json2 = instance_template_collection_model.to_dict() assert instance_template_collection_model_json2 == instance_template_collection_model_json - class TestInstanceTemplateCollectionFirst(): """ Test Class for InstanceTemplateCollectionFirst @@ -28289,29 +29157,23 @@ def test_instance_template_collection_first_serialization(self): # Construct a json representation of a InstanceTemplateCollectionFirst model instance_template_collection_first_model_json = {} - instance_template_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' + instance_template_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation - instance_template_collection_first_model = InstanceTemplateCollectionFirst.from_dict( - instance_template_collection_first_model_json) + instance_template_collection_first_model = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json) assert instance_template_collection_first_model != False # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation - instance_template_collection_first_model_dict = InstanceTemplateCollectionFirst.from_dict( - instance_template_collection_first_model_json).__dict__ - instance_template_collection_first_model2 = InstanceTemplateCollectionFirst( - **instance_template_collection_first_model_dict) + instance_template_collection_first_model_dict = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json).__dict__ + instance_template_collection_first_model2 = InstanceTemplateCollectionFirst(**instance_template_collection_first_model_dict) # Verify the model instances are equivalent assert instance_template_collection_first_model == instance_template_collection_first_model2 # Convert model instance back to dict and verify no loss of data - instance_template_collection_first_model_json2 = instance_template_collection_first_model.to_dict( - ) + instance_template_collection_first_model_json2 = instance_template_collection_first_model.to_dict() assert instance_template_collection_first_model_json2 == instance_template_collection_first_model_json - class TestInstanceTemplateCollectionNext(): """ Test Class for InstanceTemplateCollectionNext @@ -28324,29 +29186,23 @@ def test_instance_template_collection_next_serialization(self): # Construct a json representation of a InstanceTemplateCollectionNext model instance_template_collection_next_model_json = {} - instance_template_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + instance_template_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation - instance_template_collection_next_model = InstanceTemplateCollectionNext.from_dict( - instance_template_collection_next_model_json) + instance_template_collection_next_model = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json) assert instance_template_collection_next_model != False # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation - instance_template_collection_next_model_dict = InstanceTemplateCollectionNext.from_dict( - instance_template_collection_next_model_json).__dict__ - instance_template_collection_next_model2 = InstanceTemplateCollectionNext( - **instance_template_collection_next_model_dict) + instance_template_collection_next_model_dict = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json).__dict__ + instance_template_collection_next_model2 = InstanceTemplateCollectionNext(**instance_template_collection_next_model_dict) # Verify the model instances are equivalent assert instance_template_collection_next_model == instance_template_collection_next_model2 # Convert model instance back to dict and verify no loss of data - instance_template_collection_next_model_json2 = instance_template_collection_next_model.to_dict( - ) + instance_template_collection_next_model_json2 = instance_template_collection_next_model.to_dict() assert instance_template_collection_next_model_json2 == instance_template_collection_next_model_json - class TestInstanceTemplatePatch(): """ Test Class for InstanceTemplatePatch @@ -28362,25 +29218,20 @@ def test_instance_template_patch_serialization(self): instance_template_patch_model_json['name'] = 'my-instance-template' # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation - instance_template_patch_model = InstanceTemplatePatch.from_dict( - instance_template_patch_model_json) + instance_template_patch_model = InstanceTemplatePatch.from_dict(instance_template_patch_model_json) assert instance_template_patch_model != False # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation - instance_template_patch_model_dict = InstanceTemplatePatch.from_dict( - instance_template_patch_model_json).__dict__ - instance_template_patch_model2 = InstanceTemplatePatch( - **instance_template_patch_model_dict) + instance_template_patch_model_dict = InstanceTemplatePatch.from_dict(instance_template_patch_model_json).__dict__ + instance_template_patch_model2 = InstanceTemplatePatch(**instance_template_patch_model_dict) # Verify the model instances are equivalent assert instance_template_patch_model == instance_template_patch_model2 # Convert model instance back to dict and verify no loss of data - instance_template_patch_model_json2 = instance_template_patch_model.to_dict( - ) + instance_template_patch_model_json2 = instance_template_patch_model.to_dict() assert instance_template_patch_model_json2 == instance_template_patch_model_json - class TestInstanceTemplateReference(): """ Test Class for InstanceTemplateReference @@ -28393,43 +29244,32 @@ def test_instance_template_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_template_reference_deleted_model = { - } # InstanceTemplateReferenceDeleted - instance_template_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted + instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a InstanceTemplateReference model instance_template_reference_model_json = {} - instance_template_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model_json[ - 'deleted'] = instance_template_reference_deleted_model - instance_template_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_reference_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model_json['deleted'] = instance_template_reference_deleted_model + instance_template_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_reference_model_json['name'] = 'my-instance-template' # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation - instance_template_reference_model = InstanceTemplateReference.from_dict( - instance_template_reference_model_json) + instance_template_reference_model = InstanceTemplateReference.from_dict(instance_template_reference_model_json) assert instance_template_reference_model != False # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation - instance_template_reference_model_dict = InstanceTemplateReference.from_dict( - instance_template_reference_model_json).__dict__ - instance_template_reference_model2 = InstanceTemplateReference( - **instance_template_reference_model_dict) + instance_template_reference_model_dict = InstanceTemplateReference.from_dict(instance_template_reference_model_json).__dict__ + instance_template_reference_model2 = InstanceTemplateReference(**instance_template_reference_model_dict) # Verify the model instances are equivalent assert instance_template_reference_model == instance_template_reference_model2 # Convert model instance back to dict and verify no loss of data - instance_template_reference_model_json2 = instance_template_reference_model.to_dict( - ) + instance_template_reference_model_json2 = instance_template_reference_model.to_dict() assert instance_template_reference_model_json2 == instance_template_reference_model_json - class TestInstanceTemplateReferenceDeleted(): """ Test Class for InstanceTemplateReferenceDeleted @@ -28442,29 +29282,23 @@ def test_instance_template_reference_deleted_serialization(self): # Construct a json representation of a InstanceTemplateReferenceDeleted model instance_template_reference_deleted_model_json = {} - instance_template_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_template_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation - instance_template_reference_deleted_model = InstanceTemplateReferenceDeleted.from_dict( - instance_template_reference_deleted_model_json) + instance_template_reference_deleted_model = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json) assert instance_template_reference_deleted_model != False # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation - instance_template_reference_deleted_model_dict = InstanceTemplateReferenceDeleted.from_dict( - instance_template_reference_deleted_model_json).__dict__ - instance_template_reference_deleted_model2 = InstanceTemplateReferenceDeleted( - **instance_template_reference_deleted_model_dict) + instance_template_reference_deleted_model_dict = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json).__dict__ + instance_template_reference_deleted_model2 = InstanceTemplateReferenceDeleted(**instance_template_reference_deleted_model_dict) # Verify the model instances are equivalent assert instance_template_reference_deleted_model == instance_template_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - instance_template_reference_deleted_model_json2 = instance_template_reference_deleted_model.to_dict( - ) + instance_template_reference_deleted_model_json2 = instance_template_reference_deleted_model.to_dict() assert instance_template_reference_deleted_model_json2 == instance_template_reference_deleted_model_json - class TestInstanceVCPU(): """ Test Class for InstanceVCPU @@ -28485,8 +29319,7 @@ def test_instance_vcpu_serialization(self): assert instance_vcpu_model != False # Construct a model instance of InstanceVCPU by calling from_dict on the json representation - instance_vcpu_model_dict = InstanceVCPU.from_dict( - instance_vcpu_model_json).__dict__ + instance_vcpu_model_dict = InstanceVCPU.from_dict(instance_vcpu_model_json).__dict__ instance_vcpu_model2 = InstanceVCPU(**instance_vcpu_model_dict) # Verify the model instances are equivalent @@ -28496,7 +29329,6 @@ def test_instance_vcpu_serialization(self): instance_vcpu_model_json2 = instance_vcpu_model.to_dict() assert instance_vcpu_model_json2 == instance_vcpu_model_json - class TestKey(): """ Test Class for Key @@ -28509,27 +29341,21 @@ def test_key_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' # Construct a json representation of a Key model key_model_json = {} - key_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - key_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_model_json[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + key_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' key_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' key_model_json['length'] = 2048 key_model_json['name'] = 'my-key' - key_model_json[ - 'public_key'] = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + key_model_json['public_key'] = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' key_model_json['resource_group'] = resource_group_reference_model key_model_json['type'] = 'rsa' @@ -28548,7 +29374,6 @@ def test_key_serialization(self): key_model_json2 = key_model.to_dict() assert key_model_json2 == key_model_json - class TestKeyCollection(): """ Test Class for KeyCollection @@ -28561,26 +29386,20 @@ def test_key_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - key_model = {} # Key - key_model['created_at'] = '2020-01-28T18:40:40.123456Z' - key_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_model[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_model = {} # Key + key_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + key_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' key_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' key_model['length'] = 2048 key_model['name'] = 'my-key' - key_model[ - 'public_key'] = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' + key_model['public_key'] = 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' key_model['resource_group'] = resource_group_reference_model key_model['type'] = 'rsa' @@ -28589,13 +29408,11 @@ def test_key_collection_serialization(self): key_collection_model_json['keys'] = [key_model] # Construct a model instance of KeyCollection by calling from_dict on the json representation - key_collection_model = KeyCollection.from_dict( - key_collection_model_json) + key_collection_model = KeyCollection.from_dict(key_collection_model_json) assert key_collection_model != False # Construct a model instance of KeyCollection by calling from_dict on the json representation - key_collection_model_dict = KeyCollection.from_dict( - key_collection_model_json).__dict__ + key_collection_model_dict = KeyCollection.from_dict(key_collection_model_json).__dict__ key_collection_model2 = KeyCollection(**key_collection_model_dict) # Verify the model instances are equivalent @@ -28605,7 +29422,6 @@ def test_key_collection_serialization(self): key_collection_model_json2 = key_collection_model.to_dict() assert key_collection_model_json2 == key_collection_model_json - class TestKeyPatch(): """ Test Class for KeyPatch @@ -28635,7 +29451,6 @@ def test_key_patch_serialization(self): key_patch_model_json2 = key_patch_model.to_dict() assert key_patch_model_json2 == key_patch_model_json - class TestKeyReferenceDeleted(): """ Test Class for KeyReferenceDeleted @@ -28648,29 +29463,23 @@ def test_key_reference_deleted_serialization(self): # Construct a json representation of a KeyReferenceDeleted model key_reference_deleted_model_json = {} - key_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + key_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation - key_reference_deleted_model = KeyReferenceDeleted.from_dict( - key_reference_deleted_model_json) + key_reference_deleted_model = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json) assert key_reference_deleted_model != False # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation - key_reference_deleted_model_dict = KeyReferenceDeleted.from_dict( - key_reference_deleted_model_json).__dict__ - key_reference_deleted_model2 = KeyReferenceDeleted( - **key_reference_deleted_model_dict) + key_reference_deleted_model_dict = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json).__dict__ + key_reference_deleted_model2 = KeyReferenceDeleted(**key_reference_deleted_model_dict) # Verify the model instances are equivalent assert key_reference_deleted_model == key_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict( - ) + key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict() assert key_reference_deleted_model_json2 == key_reference_deleted_model_json - class TestLoadBalancer(): """ Test Class for LoadBalancer @@ -28683,115 +29492,81 @@ def test_load_balancer_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_reference_deleted_model = { - } # LoadBalancerListenerReferenceDeleted - load_balancer_listener_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_reference_model = { - } # LoadBalancerListenerReference - load_balancer_listener_reference_model[ - 'deleted'] = load_balancer_listener_reference_deleted_model - load_balancer_listener_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath + load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted + load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_reference_model = {} # LoadBalancerListenerReference + load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model + load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath load_balancer_logging_datapath_model['active'] = True - load_balancer_logging_model = {} # LoadBalancerLogging - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_logging_model = {} # LoadBalancerLogging + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - load_balancer_profile_reference_model = { - } # LoadBalancerProfileReference + load_balancer_profile_reference_model = {} # LoadBalancerProfileReference load_balancer_profile_reference_model['family'] = 'network' - load_balancer_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' load_balancer_profile_reference_model['name'] = 'network-fixed' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a LoadBalancer model load_balancer_model_json = {} - load_balancer_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - load_balancer_model_json[ - 'hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' - load_balancer_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_model_json['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' + load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model_json['is_public'] = True - load_balancer_model_json['listeners'] = [ - load_balancer_listener_reference_model - ] + load_balancer_model_json['listeners'] = [load_balancer_listener_reference_model] load_balancer_model_json['logging'] = load_balancer_logging_model load_balancer_model_json['name'] = 'my-load-balancer' load_balancer_model_json['operating_status'] = 'offline' load_balancer_model_json['pools'] = [load_balancer_pool_reference_model] load_balancer_model_json['private_ips'] = [ip_model] - load_balancer_model_json[ - 'profile'] = load_balancer_profile_reference_model + load_balancer_model_json['profile'] = load_balancer_profile_reference_model load_balancer_model_json['provisioning_status'] = 'active' load_balancer_model_json['public_ips'] = [ip_model] - load_balancer_model_json[ - 'resource_group'] = resource_group_reference_model - load_balancer_model_json['security_groups'] = [ - security_group_reference_model - ] + load_balancer_model_json['resource_group'] = resource_group_reference_model + load_balancer_model_json['security_groups'] = [security_group_reference_model] load_balancer_model_json['security_groups_supported'] = True load_balancer_model_json['subnets'] = [subnet_reference_model] @@ -28800,8 +29575,7 @@ def test_load_balancer_serialization(self): assert load_balancer_model != False # Construct a model instance of LoadBalancer by calling from_dict on the json representation - load_balancer_model_dict = LoadBalancer.from_dict( - load_balancer_model_json).__dict__ + load_balancer_model_dict = LoadBalancer.from_dict(load_balancer_model_json).__dict__ load_balancer_model2 = LoadBalancer(**load_balancer_model_dict) # Verify the model instances are equivalent @@ -28811,7 +29585,6 @@ def test_load_balancer_serialization(self): load_balancer_model_json2 = load_balancer_model.to_dict() assert load_balancer_model_json2 == load_balancer_model_json - class TestLoadBalancerCollection(): """ Test Class for LoadBalancerCollection @@ -28824,100 +29597,70 @@ def test_load_balancer_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_reference_deleted_model = { - } # LoadBalancerListenerReferenceDeleted - load_balancer_listener_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_reference_model = { - } # LoadBalancerListenerReference - load_balancer_listener_reference_model[ - 'deleted'] = load_balancer_listener_reference_deleted_model - load_balancer_listener_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath + load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted + load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_reference_model = {} # LoadBalancerListenerReference + load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model + load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath load_balancer_logging_datapath_model['active'] = True - load_balancer_logging_model = {} # LoadBalancerLogging - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_logging_model = {} # LoadBalancerLogging + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - load_balancer_profile_reference_model = { - } # LoadBalancerProfileReference + load_balancer_profile_reference_model = {} # LoadBalancerProfileReference load_balancer_profile_reference_model['family'] = 'network' - load_balancer_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' load_balancer_profile_reference_model['name'] = 'network-fixed' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - load_balancer_model = {} # LoadBalancer - load_balancer_model['created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - load_balancer_model[ - 'hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' - load_balancer_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_model = {} # LoadBalancer + load_balancer_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_model['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' + load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model['is_public'] = True - load_balancer_model['listeners'] = [ - load_balancer_listener_reference_model - ] + load_balancer_model['listeners'] = [load_balancer_listener_reference_model] load_balancer_model['logging'] = load_balancer_logging_model load_balancer_model['name'] = 'my-load-balancer' load_balancer_model['operating_status'] = 'offline' @@ -28927,38 +29670,29 @@ def test_load_balancer_collection_serialization(self): load_balancer_model['provisioning_status'] = 'active' load_balancer_model['public_ips'] = [ip_model] load_balancer_model['resource_group'] = resource_group_reference_model - load_balancer_model['security_groups'] = [ - security_group_reference_model - ] + load_balancer_model['security_groups'] = [security_group_reference_model] load_balancer_model['security_groups_supported'] = True load_balancer_model['subnets'] = [subnet_reference_model] # Construct a json representation of a LoadBalancerCollection model load_balancer_collection_model_json = {} - load_balancer_collection_model_json['load_balancers'] = [ - load_balancer_model - ] + load_balancer_collection_model_json['load_balancers'] = [load_balancer_model] # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation - load_balancer_collection_model = LoadBalancerCollection.from_dict( - load_balancer_collection_model_json) + load_balancer_collection_model = LoadBalancerCollection.from_dict(load_balancer_collection_model_json) assert load_balancer_collection_model != False # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation - load_balancer_collection_model_dict = LoadBalancerCollection.from_dict( - load_balancer_collection_model_json).__dict__ - load_balancer_collection_model2 = LoadBalancerCollection( - **load_balancer_collection_model_dict) + load_balancer_collection_model_dict = LoadBalancerCollection.from_dict(load_balancer_collection_model_json).__dict__ + load_balancer_collection_model2 = LoadBalancerCollection(**load_balancer_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_collection_model == load_balancer_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_collection_model_json2 = load_balancer_collection_model.to_dict( - ) + load_balancer_collection_model_json2 = load_balancer_collection_model.to_dict() assert load_balancer_collection_model_json2 == load_balancer_collection_model_json - class TestLoadBalancerListener(): """ Test Class for LoadBalancerListener @@ -28971,80 +29705,55 @@ def test_load_balancer_listener_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - certificate_instance_reference_model = { - } # CertificateInstanceReference - certificate_instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + certificate_instance_reference_model = {} # CertificateInstanceReference + certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - load_balancer_listener_policy_reference_deleted_model = { - } # LoadBalancerListenerPolicyReferenceDeleted - load_balancer_listener_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted + load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - load_balancer_listener_policy_reference_model = { - } # LoadBalancerListenerPolicyReference - load_balancer_listener_policy_reference_model[ - 'deleted'] = load_balancer_listener_policy_reference_deleted_model - load_balancer_listener_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' - load_balancer_listener_policy_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference + load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model + load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' + load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a json representation of a LoadBalancerListener model load_balancer_listener_model_json = {} load_balancer_listener_model_json['accept_proxy_protocol'] = True - load_balancer_listener_model_json[ - 'certificate_instance'] = certificate_instance_reference_model + load_balancer_listener_model_json['certificate_instance'] = certificate_instance_reference_model load_balancer_listener_model_json['connection_limit'] = 2000 - load_balancer_listener_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_listener_model_json[ - 'default_pool'] = load_balancer_pool_reference_model - load_balancer_listener_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_model_json['policies'] = [ - load_balancer_listener_policy_reference_model - ] + load_balancer_listener_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_listener_model_json['default_pool'] = load_balancer_pool_reference_model + load_balancer_listener_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model_json['policies'] = [load_balancer_listener_policy_reference_model] load_balancer_listener_model_json['port'] = 443 load_balancer_listener_model_json['protocol'] = 'http' load_balancer_listener_model_json['provisioning_status'] = 'active' # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation - load_balancer_listener_model = LoadBalancerListener.from_dict( - load_balancer_listener_model_json) + load_balancer_listener_model = LoadBalancerListener.from_dict(load_balancer_listener_model_json) assert load_balancer_listener_model != False # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation - load_balancer_listener_model_dict = LoadBalancerListener.from_dict( - load_balancer_listener_model_json).__dict__ - load_balancer_listener_model2 = LoadBalancerListener( - **load_balancer_listener_model_dict) + load_balancer_listener_model_dict = LoadBalancerListener.from_dict(load_balancer_listener_model_json).__dict__ + load_balancer_listener_model2 = LoadBalancerListener(**load_balancer_listener_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_model == load_balancer_listener_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_model_json2 = load_balancer_listener_model.to_dict( - ) + load_balancer_listener_model_json2 = load_balancer_listener_model.to_dict() assert load_balancer_listener_model_json2 == load_balancer_listener_model_json - class TestLoadBalancerListenerCollection(): """ Test Class for LoadBalancerListenerCollection @@ -29057,85 +29766,58 @@ def test_load_balancer_listener_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - certificate_instance_reference_model = { - } # CertificateInstanceReference - certificate_instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_reference_model = {} # LoadBalancerPoolReference - load_balancer_pool_reference_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + certificate_instance_reference_model = {} # CertificateInstanceReference + certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_reference_model = {} # LoadBalancerPoolReference + load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - load_balancer_listener_policy_reference_deleted_model = { - } # LoadBalancerListenerPolicyReferenceDeleted - load_balancer_listener_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_policy_reference_model = { - } # LoadBalancerListenerPolicyReference - load_balancer_listener_policy_reference_model[ - 'deleted'] = load_balancer_listener_policy_reference_deleted_model - load_balancer_listener_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' - load_balancer_listener_policy_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_listener_model = {} # LoadBalancerListener + load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted + load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference + load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model + load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' + load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_listener_model = {} # LoadBalancerListener load_balancer_listener_model['accept_proxy_protocol'] = True - load_balancer_listener_model[ - 'certificate_instance'] = certificate_instance_reference_model + load_balancer_listener_model['certificate_instance'] = certificate_instance_reference_model load_balancer_listener_model['connection_limit'] = 2000 - load_balancer_listener_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_listener_model[ - 'default_pool'] = load_balancer_pool_reference_model - load_balancer_listener_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_model['policies'] = [ - load_balancer_listener_policy_reference_model - ] + load_balancer_listener_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_listener_model['default_pool'] = load_balancer_pool_reference_model + load_balancer_listener_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_model['policies'] = [load_balancer_listener_policy_reference_model] load_balancer_listener_model['port'] = 443 load_balancer_listener_model['protocol'] = 'http' load_balancer_listener_model['provisioning_status'] = 'active' # Construct a json representation of a LoadBalancerListenerCollection model load_balancer_listener_collection_model_json = {} - load_balancer_listener_collection_model_json['listeners'] = [ - load_balancer_listener_model - ] + load_balancer_listener_collection_model_json['listeners'] = [load_balancer_listener_model] # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation - load_balancer_listener_collection_model = LoadBalancerListenerCollection.from_dict( - load_balancer_listener_collection_model_json) + load_balancer_listener_collection_model = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json) assert load_balancer_listener_collection_model != False # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation - load_balancer_listener_collection_model_dict = LoadBalancerListenerCollection.from_dict( - load_balancer_listener_collection_model_json).__dict__ - load_balancer_listener_collection_model2 = LoadBalancerListenerCollection( - **load_balancer_listener_collection_model_dict) + load_balancer_listener_collection_model_dict = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json).__dict__ + load_balancer_listener_collection_model2 = LoadBalancerListenerCollection(**load_balancer_listener_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_collection_model == load_balancer_listener_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_collection_model_json2 = load_balancer_listener_collection_model.to_dict( - ) + load_balancer_listener_collection_model_json2 = load_balancer_listener_collection_model.to_dict() assert load_balancer_listener_collection_model_json2 == load_balancer_listener_collection_model_json - class TestLoadBalancerListenerPatch(): """ Test Class for LoadBalancerListenerPatch @@ -29148,46 +29830,36 @@ def test_load_balancer_listener_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - certificate_instance_identity_model = { - } # CertificateInstanceIdentityByCRN - certificate_instance_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' - load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById - load_balancer_pool_identity_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a json representation of a LoadBalancerListenerPatch model load_balancer_listener_patch_model_json = {} load_balancer_listener_patch_model_json['accept_proxy_protocol'] = True - load_balancer_listener_patch_model_json[ - 'certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_patch_model_json['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_patch_model_json['connection_limit'] = 2000 - load_balancer_listener_patch_model_json[ - 'default_pool'] = load_balancer_pool_identity_model + load_balancer_listener_patch_model_json['default_pool'] = load_balancer_pool_identity_model load_balancer_listener_patch_model_json['port'] = 443 load_balancer_listener_patch_model_json['protocol'] = 'http' # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation - load_balancer_listener_patch_model = LoadBalancerListenerPatch.from_dict( - load_balancer_listener_patch_model_json) + load_balancer_listener_patch_model = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json) assert load_balancer_listener_patch_model != False # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation - load_balancer_listener_patch_model_dict = LoadBalancerListenerPatch.from_dict( - load_balancer_listener_patch_model_json).__dict__ - load_balancer_listener_patch_model2 = LoadBalancerListenerPatch( - **load_balancer_listener_patch_model_dict) + load_balancer_listener_patch_model_dict = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json).__dict__ + load_balancer_listener_patch_model2 = LoadBalancerListenerPatch(**load_balancer_listener_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_patch_model == load_balancer_listener_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_patch_model_json2 = load_balancer_listener_patch_model.to_dict( - ) + load_balancer_listener_patch_model_json2 = load_balancer_listener_patch_model.to_dict() assert load_balancer_listener_patch_model_json2 == load_balancer_listener_patch_model_json - class TestLoadBalancerListenerPolicy(): """ Test Class for LoadBalancerListenerPolicy @@ -29200,75 +29872,50 @@ def test_load_balancer_listener_policy_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_rule_reference_deleted_model = { - } # LoadBalancerListenerPolicyRuleReferenceDeleted - load_balancer_listener_policy_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_policy_rule_reference_model = { - } # LoadBalancerListenerPolicyRuleReference - load_balancer_listener_policy_rule_reference_model[ - 'deleted'] = load_balancer_listener_policy_rule_reference_deleted_model - load_balancer_listener_policy_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' - load_balancer_listener_policy_rule_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_policy_target_model = { - } # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference - load_balancer_listener_policy_target_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_listener_policy_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_model[ - 'name'] = 'my-load-balancer-pool' + load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted + load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference + load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model + load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' + load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference + load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool' # Construct a json representation of a LoadBalancerListenerPolicy model load_balancer_listener_policy_model_json = {} load_balancer_listener_policy_model_json['action'] = 'forward' - load_balancer_listener_policy_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_listener_policy_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' - load_balancer_listener_policy_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_listener_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' + load_balancer_listener_policy_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_listener_policy_model_json['name'] = 'my-policy' load_balancer_listener_policy_model_json['priority'] = 5 - load_balancer_listener_policy_model_json[ - 'provisioning_status'] = 'active' - load_balancer_listener_policy_model_json['rules'] = [ - load_balancer_listener_policy_rule_reference_model - ] - load_balancer_listener_policy_model_json[ - 'target'] = load_balancer_listener_policy_target_model + load_balancer_listener_policy_model_json['provisioning_status'] = 'active' + load_balancer_listener_policy_model_json['rules'] = [load_balancer_listener_policy_rule_reference_model] + load_balancer_listener_policy_model_json['target'] = load_balancer_listener_policy_target_model # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation - load_balancer_listener_policy_model = LoadBalancerListenerPolicy.from_dict( - load_balancer_listener_policy_model_json) + load_balancer_listener_policy_model = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json) assert load_balancer_listener_policy_model != False # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation - load_balancer_listener_policy_model_dict = LoadBalancerListenerPolicy.from_dict( - load_balancer_listener_policy_model_json).__dict__ - load_balancer_listener_policy_model2 = LoadBalancerListenerPolicy( - **load_balancer_listener_policy_model_dict) + load_balancer_listener_policy_model_dict = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json).__dict__ + load_balancer_listener_policy_model2 = LoadBalancerListenerPolicy(**load_balancer_listener_policy_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_model == load_balancer_listener_policy_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_model_json2 = load_balancer_listener_policy_model.to_dict( - ) + load_balancer_listener_policy_model_json2 = load_balancer_listener_policy_model.to_dict() assert load_balancer_listener_policy_model_json2 == load_balancer_listener_policy_model_json - class TestLoadBalancerListenerPolicyCollection(): """ Test Class for LoadBalancerListenerPolicyCollection @@ -29281,79 +29928,53 @@ def test_load_balancer_listener_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_rule_reference_deleted_model = { - } # LoadBalancerListenerPolicyRuleReferenceDeleted - load_balancer_listener_policy_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_policy_rule_reference_model = { - } # LoadBalancerListenerPolicyRuleReference - load_balancer_listener_policy_rule_reference_model[ - 'deleted'] = load_balancer_listener_policy_rule_reference_deleted_model - load_balancer_listener_policy_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' - load_balancer_listener_policy_rule_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_listener_policy_target_model = { - } # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference - load_balancer_listener_policy_target_model[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_listener_policy_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_model[ - 'name'] = 'my-load-balancer-pool' - - load_balancer_listener_policy_model = {} # LoadBalancerListenerPolicy + load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted + load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference + load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model + load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' + load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference + load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool' + + load_balancer_listener_policy_model = {} # LoadBalancerListenerPolicy load_balancer_listener_policy_model['action'] = 'forward' - load_balancer_listener_policy_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_listener_policy_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' - load_balancer_listener_policy_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_listener_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' + load_balancer_listener_policy_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_listener_policy_model['name'] = 'my-policy' load_balancer_listener_policy_model['priority'] = 5 load_balancer_listener_policy_model['provisioning_status'] = 'active' - load_balancer_listener_policy_model['rules'] = [ - load_balancer_listener_policy_rule_reference_model - ] - load_balancer_listener_policy_model[ - 'target'] = load_balancer_listener_policy_target_model + load_balancer_listener_policy_model['rules'] = [load_balancer_listener_policy_rule_reference_model] + load_balancer_listener_policy_model['target'] = load_balancer_listener_policy_target_model # Construct a json representation of a LoadBalancerListenerPolicyCollection model load_balancer_listener_policy_collection_model_json = {} - load_balancer_listener_policy_collection_model_json['policies'] = [ - load_balancer_listener_policy_model - ] + load_balancer_listener_policy_collection_model_json['policies'] = [load_balancer_listener_policy_model] # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation - load_balancer_listener_policy_collection_model = LoadBalancerListenerPolicyCollection.from_dict( - load_balancer_listener_policy_collection_model_json) + load_balancer_listener_policy_collection_model = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json) assert load_balancer_listener_policy_collection_model != False # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation - load_balancer_listener_policy_collection_model_dict = LoadBalancerListenerPolicyCollection.from_dict( - load_balancer_listener_policy_collection_model_json).__dict__ - load_balancer_listener_policy_collection_model2 = LoadBalancerListenerPolicyCollection( - **load_balancer_listener_policy_collection_model_dict) + load_balancer_listener_policy_collection_model_dict = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json).__dict__ + load_balancer_listener_policy_collection_model2 = LoadBalancerListenerPolicyCollection(**load_balancer_listener_policy_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_collection_model == load_balancer_listener_policy_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_collection_model_json2 = load_balancer_listener_policy_collection_model.to_dict( - ) + load_balancer_listener_policy_collection_model_json2 = load_balancer_listener_policy_collection_model.to_dict() assert load_balancer_listener_policy_collection_model_json2 == load_balancer_listener_policy_collection_model_json - class TestLoadBalancerListenerPolicyPatch(): """ Test Class for LoadBalancerListenerPolicyPatch @@ -29366,38 +29987,30 @@ def test_load_balancer_listener_policy_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_target_patch_model = { - } # LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById - load_balancer_listener_policy_target_patch_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_patch_model = {} # LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById + load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a json representation of a LoadBalancerListenerPolicyPatch model load_balancer_listener_policy_patch_model_json = {} load_balancer_listener_policy_patch_model_json['name'] = 'my-policy' load_balancer_listener_policy_patch_model_json['priority'] = 5 - load_balancer_listener_policy_patch_model_json[ - 'target'] = load_balancer_listener_policy_target_patch_model + load_balancer_listener_policy_patch_model_json['target'] = load_balancer_listener_policy_target_patch_model # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation - load_balancer_listener_policy_patch_model = LoadBalancerListenerPolicyPatch.from_dict( - load_balancer_listener_policy_patch_model_json) + load_balancer_listener_policy_patch_model = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json) assert load_balancer_listener_policy_patch_model != False # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation - load_balancer_listener_policy_patch_model_dict = LoadBalancerListenerPolicyPatch.from_dict( - load_balancer_listener_policy_patch_model_json).__dict__ - load_balancer_listener_policy_patch_model2 = LoadBalancerListenerPolicyPatch( - **load_balancer_listener_policy_patch_model_dict) + load_balancer_listener_policy_patch_model_dict = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json).__dict__ + load_balancer_listener_policy_patch_model2 = LoadBalancerListenerPolicyPatch(**load_balancer_listener_policy_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_patch_model == load_balancer_listener_policy_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_patch_model_json2 = load_balancer_listener_policy_patch_model.to_dict( - ) + load_balancer_listener_policy_patch_model_json2 = load_balancer_listener_policy_patch_model.to_dict() assert load_balancer_listener_policy_patch_model_json2 == load_balancer_listener_policy_patch_model_json - class TestLoadBalancerListenerPolicyPrototype(): """ Test Class for LoadBalancerListenerPolicyPrototype @@ -29410,52 +30023,38 @@ def test_load_balancer_listener_policy_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_rule_prototype_model = { - } # LoadBalancerListenerPolicyRulePrototype - load_balancer_listener_policy_rule_prototype_model[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model = {} # LoadBalancerListenerPolicyRulePrototype + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_prototype_model['type'] = 'header' - load_balancer_listener_policy_rule_prototype_model[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - load_balancer_listener_policy_target_prototype_model = { - } # LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById - load_balancer_listener_policy_target_prototype_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_model = {} # LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a json representation of a LoadBalancerListenerPolicyPrototype model load_balancer_listener_policy_prototype_model_json = {} load_balancer_listener_policy_prototype_model_json['action'] = 'forward' load_balancer_listener_policy_prototype_model_json['name'] = 'my-policy' load_balancer_listener_policy_prototype_model_json['priority'] = 5 - load_balancer_listener_policy_prototype_model_json['rules'] = [ - load_balancer_listener_policy_rule_prototype_model - ] - load_balancer_listener_policy_prototype_model_json[ - 'target'] = load_balancer_listener_policy_target_prototype_model + load_balancer_listener_policy_prototype_model_json['rules'] = [load_balancer_listener_policy_rule_prototype_model] + load_balancer_listener_policy_prototype_model_json['target'] = load_balancer_listener_policy_target_prototype_model # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation - load_balancer_listener_policy_prototype_model = LoadBalancerListenerPolicyPrototype.from_dict( - load_balancer_listener_policy_prototype_model_json) + load_balancer_listener_policy_prototype_model = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json) assert load_balancer_listener_policy_prototype_model != False # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation - load_balancer_listener_policy_prototype_model_dict = LoadBalancerListenerPolicyPrototype.from_dict( - load_balancer_listener_policy_prototype_model_json).__dict__ - load_balancer_listener_policy_prototype_model2 = LoadBalancerListenerPolicyPrototype( - **load_balancer_listener_policy_prototype_model_dict) + load_balancer_listener_policy_prototype_model_dict = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json).__dict__ + load_balancer_listener_policy_prototype_model2 = LoadBalancerListenerPolicyPrototype(**load_balancer_listener_policy_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_prototype_model == load_balancer_listener_policy_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_prototype_model_json2 = load_balancer_listener_policy_prototype_model.to_dict( - ) + load_balancer_listener_policy_prototype_model_json2 = load_balancer_listener_policy_prototype_model.to_dict() assert load_balancer_listener_policy_prototype_model_json2 == load_balancer_listener_policy_prototype_model_json - class TestLoadBalancerListenerPolicyReference(): """ Test Class for LoadBalancerListenerPolicyReference @@ -29468,76 +30067,59 @@ def test_load_balancer_listener_policy_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_reference_deleted_model = { - } # LoadBalancerListenerPolicyReferenceDeleted - load_balancer_listener_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted + load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerListenerPolicyReference model load_balancer_listener_policy_reference_model_json = {} - load_balancer_listener_policy_reference_model_json[ - 'deleted'] = load_balancer_listener_policy_reference_deleted_model - load_balancer_listener_policy_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' - load_balancer_listener_policy_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_reference_model_json['deleted'] = load_balancer_listener_policy_reference_deleted_model + load_balancer_listener_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' + load_balancer_listener_policy_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation - load_balancer_listener_policy_reference_model = LoadBalancerListenerPolicyReference.from_dict( - load_balancer_listener_policy_reference_model_json) + load_balancer_listener_policy_reference_model = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json) assert load_balancer_listener_policy_reference_model != False # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation - load_balancer_listener_policy_reference_model_dict = LoadBalancerListenerPolicyReference.from_dict( - load_balancer_listener_policy_reference_model_json).__dict__ - load_balancer_listener_policy_reference_model2 = LoadBalancerListenerPolicyReference( - **load_balancer_listener_policy_reference_model_dict) + load_balancer_listener_policy_reference_model_dict = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json).__dict__ + load_balancer_listener_policy_reference_model2 = LoadBalancerListenerPolicyReference(**load_balancer_listener_policy_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_reference_model == load_balancer_listener_policy_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_reference_model_json2 = load_balancer_listener_policy_reference_model.to_dict( - ) + load_balancer_listener_policy_reference_model_json2 = load_balancer_listener_policy_reference_model.to_dict() assert load_balancer_listener_policy_reference_model_json2 == load_balancer_listener_policy_reference_model_json - class TestLoadBalancerListenerPolicyReferenceDeleted(): """ Test Class for LoadBalancerListenerPolicyReferenceDeleted """ - def test_load_balancer_listener_policy_reference_deleted_serialization( - self): + def test_load_balancer_listener_policy_reference_deleted_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyReferenceDeleted """ # Construct a json representation of a LoadBalancerListenerPolicyReferenceDeleted model load_balancer_listener_policy_reference_deleted_model_json = {} - load_balancer_listener_policy_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_policy_reference_deleted_model = LoadBalancerListenerPolicyReferenceDeleted.from_dict( - load_balancer_listener_policy_reference_deleted_model_json) + load_balancer_listener_policy_reference_deleted_model = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json) assert load_balancer_listener_policy_reference_deleted_model != False # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_policy_reference_deleted_model_dict = LoadBalancerListenerPolicyReferenceDeleted.from_dict( - load_balancer_listener_policy_reference_deleted_model_json).__dict__ - load_balancer_listener_policy_reference_deleted_model2 = LoadBalancerListenerPolicyReferenceDeleted( - **load_balancer_listener_policy_reference_deleted_model_dict) + load_balancer_listener_policy_reference_deleted_model_dict = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json).__dict__ + load_balancer_listener_policy_reference_deleted_model2 = LoadBalancerListenerPolicyReferenceDeleted(**load_balancer_listener_policy_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_reference_deleted_model == load_balancer_listener_policy_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_reference_deleted_model_json2 = load_balancer_listener_policy_reference_deleted_model.to_dict( - ) + load_balancer_listener_policy_reference_deleted_model_json2 = load_balancer_listener_policy_reference_deleted_model.to_dict() assert load_balancer_listener_policy_reference_deleted_model_json2 == load_balancer_listener_policy_reference_deleted_model_json - class TestLoadBalancerListenerPolicyRule(): """ Test Class for LoadBalancerListenerPolicyRule @@ -29551,38 +30133,29 @@ def test_load_balancer_listener_policy_rule_serialization(self): # Construct a json representation of a LoadBalancerListenerPolicyRule model load_balancer_listener_policy_rule_model_json = {} load_balancer_listener_policy_rule_model_json['condition'] = 'contains' - load_balancer_listener_policy_rule_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + load_balancer_listener_policy_rule_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) load_balancer_listener_policy_rule_model_json['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' - load_balancer_listener_policy_rule_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_rule_model_json[ - 'provisioning_status'] = 'active' + load_balancer_listener_policy_rule_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' + load_balancer_listener_policy_rule_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_rule_model_json['provisioning_status'] = 'active' load_balancer_listener_policy_rule_model_json['type'] = 'header' load_balancer_listener_policy_rule_model_json['value'] = 'testString' # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation - load_balancer_listener_policy_rule_model = LoadBalancerListenerPolicyRule.from_dict( - load_balancer_listener_policy_rule_model_json) + load_balancer_listener_policy_rule_model = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json) assert load_balancer_listener_policy_rule_model != False # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation - load_balancer_listener_policy_rule_model_dict = LoadBalancerListenerPolicyRule.from_dict( - load_balancer_listener_policy_rule_model_json).__dict__ - load_balancer_listener_policy_rule_model2 = LoadBalancerListenerPolicyRule( - **load_balancer_listener_policy_rule_model_dict) + load_balancer_listener_policy_rule_model_dict = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json).__dict__ + load_balancer_listener_policy_rule_model2 = LoadBalancerListenerPolicyRule(**load_balancer_listener_policy_rule_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_model == load_balancer_listener_policy_rule_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_model_json2 = load_balancer_listener_policy_rule_model.to_dict( - ) + load_balancer_listener_policy_rule_model_json2 = load_balancer_listener_policy_rule_model.to_dict() assert load_balancer_listener_policy_rule_model_json2 == load_balancer_listener_policy_rule_model_json - class TestLoadBalancerListenerPolicyRuleCollection(): """ Test Class for LoadBalancerListenerPolicyRuleCollection @@ -29595,47 +30168,35 @@ def test_load_balancer_listener_policy_rule_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_rule_model = { - } # LoadBalancerListenerPolicyRule + load_balancer_listener_policy_rule_model = {} # LoadBalancerListenerPolicyRule load_balancer_listener_policy_rule_model['condition'] = 'contains' - load_balancer_listener_policy_rule_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + load_balancer_listener_policy_rule_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) load_balancer_listener_policy_rule_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' - load_balancer_listener_policy_rule_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_rule_model[ - 'provisioning_status'] = 'active' + load_balancer_listener_policy_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' + load_balancer_listener_policy_rule_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_rule_model['provisioning_status'] = 'active' load_balancer_listener_policy_rule_model['type'] = 'header' load_balancer_listener_policy_rule_model['value'] = 'testString' # Construct a json representation of a LoadBalancerListenerPolicyRuleCollection model load_balancer_listener_policy_rule_collection_model_json = {} - load_balancer_listener_policy_rule_collection_model_json['rules'] = [ - load_balancer_listener_policy_rule_model - ] + load_balancer_listener_policy_rule_collection_model_json['rules'] = [load_balancer_listener_policy_rule_model] # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation - load_balancer_listener_policy_rule_collection_model = LoadBalancerListenerPolicyRuleCollection.from_dict( - load_balancer_listener_policy_rule_collection_model_json) + load_balancer_listener_policy_rule_collection_model = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json) assert load_balancer_listener_policy_rule_collection_model != False # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation - load_balancer_listener_policy_rule_collection_model_dict = LoadBalancerListenerPolicyRuleCollection.from_dict( - load_balancer_listener_policy_rule_collection_model_json).__dict__ - load_balancer_listener_policy_rule_collection_model2 = LoadBalancerListenerPolicyRuleCollection( - **load_balancer_listener_policy_rule_collection_model_dict) + load_balancer_listener_policy_rule_collection_model_dict = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json).__dict__ + load_balancer_listener_policy_rule_collection_model2 = LoadBalancerListenerPolicyRuleCollection(**load_balancer_listener_policy_rule_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_collection_model == load_balancer_listener_policy_rule_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_collection_model_json2 = load_balancer_listener_policy_rule_collection_model.to_dict( - ) + load_balancer_listener_policy_rule_collection_model_json2 = load_balancer_listener_policy_rule_collection_model.to_dict() assert load_balancer_listener_policy_rule_collection_model_json2 == load_balancer_listener_policy_rule_collection_model_json - class TestLoadBalancerListenerPolicyRulePatch(): """ Test Class for LoadBalancerListenerPolicyRulePatch @@ -29648,34 +30209,26 @@ def test_load_balancer_listener_policy_rule_patch_serialization(self): # Construct a json representation of a LoadBalancerListenerPolicyRulePatch model load_balancer_listener_policy_rule_patch_model_json = {} - load_balancer_listener_policy_rule_patch_model_json[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_patch_model_json[ - 'field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_patch_model_json['condition'] = 'contains' + load_balancer_listener_policy_rule_patch_model_json['field'] = 'MY-APP-HEADER' load_balancer_listener_policy_rule_patch_model_json['type'] = 'header' - load_balancer_listener_policy_rule_patch_model_json[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_patch_model_json['value'] = 'testString' # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation - load_balancer_listener_policy_rule_patch_model = LoadBalancerListenerPolicyRulePatch.from_dict( - load_balancer_listener_policy_rule_patch_model_json) + load_balancer_listener_policy_rule_patch_model = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json) assert load_balancer_listener_policy_rule_patch_model != False # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation - load_balancer_listener_policy_rule_patch_model_dict = LoadBalancerListenerPolicyRulePatch.from_dict( - load_balancer_listener_policy_rule_patch_model_json).__dict__ - load_balancer_listener_policy_rule_patch_model2 = LoadBalancerListenerPolicyRulePatch( - **load_balancer_listener_policy_rule_patch_model_dict) + load_balancer_listener_policy_rule_patch_model_dict = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json).__dict__ + load_balancer_listener_policy_rule_patch_model2 = LoadBalancerListenerPolicyRulePatch(**load_balancer_listener_policy_rule_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_patch_model == load_balancer_listener_policy_rule_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_patch_model_json2 = load_balancer_listener_policy_rule_patch_model.to_dict( - ) + load_balancer_listener_policy_rule_patch_model_json2 = load_balancer_listener_policy_rule_patch_model.to_dict() assert load_balancer_listener_policy_rule_patch_model_json2 == load_balancer_listener_policy_rule_patch_model_json - class TestLoadBalancerListenerPolicyRulePrototype(): """ Test Class for LoadBalancerListenerPolicyRulePrototype @@ -29688,35 +30241,26 @@ def test_load_balancer_listener_policy_rule_prototype_serialization(self): # Construct a json representation of a LoadBalancerListenerPolicyRulePrototype model load_balancer_listener_policy_rule_prototype_model_json = {} - load_balancer_listener_policy_rule_prototype_model_json[ - 'condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model_json[ - 'field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_prototype_model_json[ - 'type'] = 'header' - load_balancer_listener_policy_rule_prototype_model_json[ - 'value'] = 'testString' + load_balancer_listener_policy_rule_prototype_model_json['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model_json['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model_json['type'] = 'header' + load_balancer_listener_policy_rule_prototype_model_json['value'] = 'testString' # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation - load_balancer_listener_policy_rule_prototype_model = LoadBalancerListenerPolicyRulePrototype.from_dict( - load_balancer_listener_policy_rule_prototype_model_json) + load_balancer_listener_policy_rule_prototype_model = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json) assert load_balancer_listener_policy_rule_prototype_model != False # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation - load_balancer_listener_policy_rule_prototype_model_dict = LoadBalancerListenerPolicyRulePrototype.from_dict( - load_balancer_listener_policy_rule_prototype_model_json).__dict__ - load_balancer_listener_policy_rule_prototype_model2 = LoadBalancerListenerPolicyRulePrototype( - **load_balancer_listener_policy_rule_prototype_model_dict) + load_balancer_listener_policy_rule_prototype_model_dict = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json).__dict__ + load_balancer_listener_policy_rule_prototype_model2 = LoadBalancerListenerPolicyRulePrototype(**load_balancer_listener_policy_rule_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_prototype_model == load_balancer_listener_policy_rule_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_prototype_model_json2 = load_balancer_listener_policy_rule_prototype_model.to_dict( - ) + load_balancer_listener_policy_rule_prototype_model_json2 = load_balancer_listener_policy_rule_prototype_model.to_dict() assert load_balancer_listener_policy_rule_prototype_model_json2 == load_balancer_listener_policy_rule_prototype_model_json - class TestLoadBalancerListenerPolicyRuleReference(): """ Test Class for LoadBalancerListenerPolicyRuleReference @@ -29729,129 +30273,97 @@ def test_load_balancer_listener_policy_rule_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_policy_rule_reference_deleted_model = { - } # LoadBalancerListenerPolicyRuleReferenceDeleted - load_balancer_listener_policy_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted + load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerListenerPolicyRuleReference model load_balancer_listener_policy_rule_reference_model_json = {} - load_balancer_listener_policy_rule_reference_model_json[ - 'deleted'] = load_balancer_listener_policy_rule_reference_deleted_model - load_balancer_listener_policy_rule_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' - load_balancer_listener_policy_rule_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_rule_reference_model_json['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model + load_balancer_listener_policy_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762' + load_balancer_listener_policy_rule_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation - load_balancer_listener_policy_rule_reference_model = LoadBalancerListenerPolicyRuleReference.from_dict( - load_balancer_listener_policy_rule_reference_model_json) + load_balancer_listener_policy_rule_reference_model = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json) assert load_balancer_listener_policy_rule_reference_model != False # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation - load_balancer_listener_policy_rule_reference_model_dict = LoadBalancerListenerPolicyRuleReference.from_dict( - load_balancer_listener_policy_rule_reference_model_json).__dict__ - load_balancer_listener_policy_rule_reference_model2 = LoadBalancerListenerPolicyRuleReference( - **load_balancer_listener_policy_rule_reference_model_dict) + load_balancer_listener_policy_rule_reference_model_dict = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json).__dict__ + load_balancer_listener_policy_rule_reference_model2 = LoadBalancerListenerPolicyRuleReference(**load_balancer_listener_policy_rule_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_reference_model == load_balancer_listener_policy_rule_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_reference_model_json2 = load_balancer_listener_policy_rule_reference_model.to_dict( - ) + load_balancer_listener_policy_rule_reference_model_json2 = load_balancer_listener_policy_rule_reference_model.to_dict() assert load_balancer_listener_policy_rule_reference_model_json2 == load_balancer_listener_policy_rule_reference_model_json - class TestLoadBalancerListenerPolicyRuleReferenceDeleted(): """ Test Class for LoadBalancerListenerPolicyRuleReferenceDeleted """ - def test_load_balancer_listener_policy_rule_reference_deleted_serialization( - self): + def test_load_balancer_listener_policy_rule_reference_deleted_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyRuleReferenceDeleted """ # Construct a json representation of a LoadBalancerListenerPolicyRuleReferenceDeleted model load_balancer_listener_policy_rule_reference_deleted_model_json = {} - load_balancer_listener_policy_rule_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_policy_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_policy_rule_reference_deleted_model = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict( - load_balancer_listener_policy_rule_reference_deleted_model_json) + load_balancer_listener_policy_rule_reference_deleted_model = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json) assert load_balancer_listener_policy_rule_reference_deleted_model != False # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_policy_rule_reference_deleted_model_dict = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict( - load_balancer_listener_policy_rule_reference_deleted_model_json - ).__dict__ - load_balancer_listener_policy_rule_reference_deleted_model2 = LoadBalancerListenerPolicyRuleReferenceDeleted( - **load_balancer_listener_policy_rule_reference_deleted_model_dict) + load_balancer_listener_policy_rule_reference_deleted_model_dict = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json).__dict__ + load_balancer_listener_policy_rule_reference_deleted_model2 = LoadBalancerListenerPolicyRuleReferenceDeleted(**load_balancer_listener_policy_rule_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_rule_reference_deleted_model == load_balancer_listener_policy_rule_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_rule_reference_deleted_model_json2 = load_balancer_listener_policy_rule_reference_deleted_model.to_dict( - ) + load_balancer_listener_policy_rule_reference_deleted_model_json2 = load_balancer_listener_policy_rule_reference_deleted_model.to_dict() assert load_balancer_listener_policy_rule_reference_deleted_model_json2 == load_balancer_listener_policy_rule_reference_deleted_model_json - class TestLoadBalancerListenerPrototypeLoadBalancerContext(): """ Test Class for LoadBalancerListenerPrototypeLoadBalancerContext """ - def test_load_balancer_listener_prototype_load_balancer_context_serialization( - self): + def test_load_balancer_listener_prototype_load_balancer_context_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPrototypeLoadBalancerContext """ # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_identity_by_name_model = { - } # LoadBalancerPoolIdentityByName - load_balancer_pool_identity_by_name_model[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName + load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model_json = {} - load_balancer_listener_prototype_load_balancer_context_model_json[ - 'accept_proxy_protocol'] = True - load_balancer_listener_prototype_load_balancer_context_model_json[ - 'connection_limit'] = 2000 - load_balancer_listener_prototype_load_balancer_context_model_json[ - 'default_pool'] = load_balancer_pool_identity_by_name_model - load_balancer_listener_prototype_load_balancer_context_model_json[ - 'port'] = 443 - load_balancer_listener_prototype_load_balancer_context_model_json[ - 'protocol'] = 'http' + load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000 + load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model_json['port'] = 443 + load_balancer_listener_prototype_load_balancer_context_model_json['protocol'] = 'http' # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation - load_balancer_listener_prototype_load_balancer_context_model = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict( - load_balancer_listener_prototype_load_balancer_context_model_json) + load_balancer_listener_prototype_load_balancer_context_model = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json) assert load_balancer_listener_prototype_load_balancer_context_model != False # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation - load_balancer_listener_prototype_load_balancer_context_model_dict = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict( - load_balancer_listener_prototype_load_balancer_context_model_json - ).__dict__ - load_balancer_listener_prototype_load_balancer_context_model2 = LoadBalancerListenerPrototypeLoadBalancerContext( - **load_balancer_listener_prototype_load_balancer_context_model_dict) + load_balancer_listener_prototype_load_balancer_context_model_dict = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json).__dict__ + load_balancer_listener_prototype_load_balancer_context_model2 = LoadBalancerListenerPrototypeLoadBalancerContext(**load_balancer_listener_prototype_load_balancer_context_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_prototype_load_balancer_context_model == load_balancer_listener_prototype_load_balancer_context_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_prototype_load_balancer_context_model_json2 = load_balancer_listener_prototype_load_balancer_context_model.to_dict( - ) + load_balancer_listener_prototype_load_balancer_context_model_json2 = load_balancer_listener_prototype_load_balancer_context_model.to_dict() assert load_balancer_listener_prototype_load_balancer_context_model_json2 == load_balancer_listener_prototype_load_balancer_context_model_json - class TestLoadBalancerListenerReference(): """ Test Class for LoadBalancerListenerReference @@ -29864,40 +30376,30 @@ def test_load_balancer_listener_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_listener_reference_deleted_model = { - } # LoadBalancerListenerReferenceDeleted - load_balancer_listener_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted + load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerListenerReference model load_balancer_listener_reference_model_json = {} - load_balancer_listener_reference_model_json[ - 'deleted'] = load_balancer_listener_reference_deleted_model - load_balancer_listener_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model_json['deleted'] = load_balancer_listener_reference_deleted_model + load_balancer_listener_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation - load_balancer_listener_reference_model = LoadBalancerListenerReference.from_dict( - load_balancer_listener_reference_model_json) + load_balancer_listener_reference_model = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json) assert load_balancer_listener_reference_model != False # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation - load_balancer_listener_reference_model_dict = LoadBalancerListenerReference.from_dict( - load_balancer_listener_reference_model_json).__dict__ - load_balancer_listener_reference_model2 = LoadBalancerListenerReference( - **load_balancer_listener_reference_model_dict) + load_balancer_listener_reference_model_dict = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json).__dict__ + load_balancer_listener_reference_model2 = LoadBalancerListenerReference(**load_balancer_listener_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_reference_model == load_balancer_listener_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_reference_model_json2 = load_balancer_listener_reference_model.to_dict( - ) + load_balancer_listener_reference_model_json2 = load_balancer_listener_reference_model.to_dict() assert load_balancer_listener_reference_model_json2 == load_balancer_listener_reference_model_json - class TestLoadBalancerListenerReferenceDeleted(): """ Test Class for LoadBalancerListenerReferenceDeleted @@ -29910,29 +30412,23 @@ def test_load_balancer_listener_reference_deleted_serialization(self): # Construct a json representation of a LoadBalancerListenerReferenceDeleted model load_balancer_listener_reference_deleted_model_json = {} - load_balancer_listener_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_listener_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_reference_deleted_model = LoadBalancerListenerReferenceDeleted.from_dict( - load_balancer_listener_reference_deleted_model_json) + load_balancer_listener_reference_deleted_model = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json) assert load_balancer_listener_reference_deleted_model != False # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation - load_balancer_listener_reference_deleted_model_dict = LoadBalancerListenerReferenceDeleted.from_dict( - load_balancer_listener_reference_deleted_model_json).__dict__ - load_balancer_listener_reference_deleted_model2 = LoadBalancerListenerReferenceDeleted( - **load_balancer_listener_reference_deleted_model_dict) + load_balancer_listener_reference_deleted_model_dict = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json).__dict__ + load_balancer_listener_reference_deleted_model2 = LoadBalancerListenerReferenceDeleted(**load_balancer_listener_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_reference_deleted_model == load_balancer_listener_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_reference_deleted_model_json2 = load_balancer_listener_reference_deleted_model.to_dict( - ) + load_balancer_listener_reference_deleted_model_json2 = load_balancer_listener_reference_deleted_model.to_dict() assert load_balancer_listener_reference_deleted_model_json2 == load_balancer_listener_reference_deleted_model_json - class TestLoadBalancerLogging(): """ Test Class for LoadBalancerLogging @@ -29945,34 +30441,28 @@ def test_load_balancer_logging_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath + load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath load_balancer_logging_datapath_model['active'] = True # Construct a json representation of a LoadBalancerLogging model load_balancer_logging_model_json = {} - load_balancer_logging_model_json[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model_json['datapath'] = load_balancer_logging_datapath_model # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation - load_balancer_logging_model = LoadBalancerLogging.from_dict( - load_balancer_logging_model_json) + load_balancer_logging_model = LoadBalancerLogging.from_dict(load_balancer_logging_model_json) assert load_balancer_logging_model != False # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation - load_balancer_logging_model_dict = LoadBalancerLogging.from_dict( - load_balancer_logging_model_json).__dict__ - load_balancer_logging_model2 = LoadBalancerLogging( - **load_balancer_logging_model_dict) + load_balancer_logging_model_dict = LoadBalancerLogging.from_dict(load_balancer_logging_model_json).__dict__ + load_balancer_logging_model2 = LoadBalancerLogging(**load_balancer_logging_model_dict) # Verify the model instances are equivalent assert load_balancer_logging_model == load_balancer_logging_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_logging_model_json2 = load_balancer_logging_model.to_dict( - ) + load_balancer_logging_model_json2 = load_balancer_logging_model.to_dict() assert load_balancer_logging_model_json2 == load_balancer_logging_model_json - class TestLoadBalancerLoggingDatapath(): """ Test Class for LoadBalancerLoggingDatapath @@ -29988,25 +30478,20 @@ def test_load_balancer_logging_datapath_serialization(self): load_balancer_logging_datapath_model_json['active'] = True # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation - load_balancer_logging_datapath_model = LoadBalancerLoggingDatapath.from_dict( - load_balancer_logging_datapath_model_json) + load_balancer_logging_datapath_model = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json) assert load_balancer_logging_datapath_model != False # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation - load_balancer_logging_datapath_model_dict = LoadBalancerLoggingDatapath.from_dict( - load_balancer_logging_datapath_model_json).__dict__ - load_balancer_logging_datapath_model2 = LoadBalancerLoggingDatapath( - **load_balancer_logging_datapath_model_dict) + load_balancer_logging_datapath_model_dict = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json).__dict__ + load_balancer_logging_datapath_model2 = LoadBalancerLoggingDatapath(**load_balancer_logging_datapath_model_dict) # Verify the model instances are equivalent assert load_balancer_logging_datapath_model == load_balancer_logging_datapath_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_logging_datapath_model_json2 = load_balancer_logging_datapath_model.to_dict( - ) + load_balancer_logging_datapath_model_json2 = load_balancer_logging_datapath_model.to_dict() assert load_balancer_logging_datapath_model_json2 == load_balancer_logging_datapath_model_json - class TestLoadBalancerPatch(): """ Test Class for LoadBalancerPatch @@ -30019,12 +30504,11 @@ def test_load_balancer_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath + load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath load_balancer_logging_datapath_model['active'] = True - load_balancer_logging_model = {} # LoadBalancerLogging - load_balancer_logging_model[ - 'datapath'] = load_balancer_logging_datapath_model + load_balancer_logging_model = {} # LoadBalancerLogging + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model # Construct a json representation of a LoadBalancerPatch model load_balancer_patch_model_json = {} @@ -30032,15 +30516,12 @@ def test_load_balancer_patch_serialization(self): load_balancer_patch_model_json['name'] = 'my-load-balancer' # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation - load_balancer_patch_model = LoadBalancerPatch.from_dict( - load_balancer_patch_model_json) + load_balancer_patch_model = LoadBalancerPatch.from_dict(load_balancer_patch_model_json) assert load_balancer_patch_model != False # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation - load_balancer_patch_model_dict = LoadBalancerPatch.from_dict( - load_balancer_patch_model_json).__dict__ - load_balancer_patch_model2 = LoadBalancerPatch( - **load_balancer_patch_model_dict) + load_balancer_patch_model_dict = LoadBalancerPatch.from_dict(load_balancer_patch_model_json).__dict__ + load_balancer_patch_model2 = LoadBalancerPatch(**load_balancer_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_patch_model == load_balancer_patch_model2 @@ -30049,7 +30530,6 @@ def test_load_balancer_patch_serialization(self): load_balancer_patch_model_json2 = load_balancer_patch_model.to_dict() assert load_balancer_patch_model_json2 == load_balancer_patch_model_json - class TestLoadBalancerPool(): """ Test Class for LoadBalancerPool @@ -30062,8 +30542,7 @@ def test_load_balancer_pool_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_health_monitor_model = { - } # LoadBalancerPoolHealthMonitor + load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor load_balancer_pool_health_monitor_model['delay'] = 5 load_balancer_pool_health_monitor_model['max_retries'] = 2 load_balancer_pool_health_monitor_model['port'] = 22 @@ -30071,73 +30550,49 @@ def test_load_balancer_pool_serialization(self): load_balancer_pool_health_monitor_model['type'] = 'http' load_balancer_pool_health_monitor_model['url_path'] = '/' - instance_group_reference_deleted_model = { - } # InstanceGroupReferenceDeleted - instance_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_reference_model = {} # InstanceGroupReference - instance_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model[ - 'deleted'] = instance_group_reference_deleted_model - instance_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted + instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_reference_model = {} # InstanceGroupReference + instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model['deleted'] = instance_group_reference_deleted_model + instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_reference_model['name'] = 'my-instance-group' - load_balancer_pool_member_reference_deleted_model = { - } # LoadBalancerPoolMemberReferenceDeleted - load_balancer_pool_member_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_member_reference_model = { - } # LoadBalancerPoolMemberReference - load_balancer_pool_member_reference_model[ - 'deleted'] = load_balancer_pool_member_reference_deleted_model - load_balancer_pool_member_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_pool_session_persistence_model = { - } # LoadBalancerPoolSessionPersistence + load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted + load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference + load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model + load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence load_balancer_pool_session_persistence_model['type'] = 'source_ip' # Construct a json representation of a LoadBalancerPool model load_balancer_pool_model_json = {} load_balancer_pool_model_json['algorithm'] = 'least_connections' - load_balancer_pool_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_pool_model_json[ - 'health_monitor'] = load_balancer_pool_health_monitor_model - load_balancer_pool_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_model_json[ - 'instance_group'] = instance_group_reference_model - load_balancer_pool_model_json['members'] = [ - load_balancer_pool_member_reference_model - ] + load_balancer_pool_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_pool_model_json['health_monitor'] = load_balancer_pool_health_monitor_model + load_balancer_pool_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_model_json['instance_group'] = instance_group_reference_model + load_balancer_pool_model_json['members'] = [load_balancer_pool_member_reference_model] load_balancer_pool_model_json['name'] = 'my-load-balancer-pool' load_balancer_pool_model_json['protocol'] = 'http' load_balancer_pool_model_json['provisioning_status'] = 'active' load_balancer_pool_model_json['proxy_protocol'] = 'disabled' - load_balancer_pool_model_json[ - 'session_persistence'] = load_balancer_pool_session_persistence_model + load_balancer_pool_model_json['session_persistence'] = load_balancer_pool_session_persistence_model # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation - load_balancer_pool_model = LoadBalancerPool.from_dict( - load_balancer_pool_model_json) + load_balancer_pool_model = LoadBalancerPool.from_dict(load_balancer_pool_model_json) assert load_balancer_pool_model != False # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation - load_balancer_pool_model_dict = LoadBalancerPool.from_dict( - load_balancer_pool_model_json).__dict__ - load_balancer_pool_model2 = LoadBalancerPool( - **load_balancer_pool_model_dict) + load_balancer_pool_model_dict = LoadBalancerPool.from_dict(load_balancer_pool_model_json).__dict__ + load_balancer_pool_model2 = LoadBalancerPool(**load_balancer_pool_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_model == load_balancer_pool_model2 @@ -30146,7 +30601,6 @@ def test_load_balancer_pool_serialization(self): load_balancer_pool_model_json2 = load_balancer_pool_model.to_dict() assert load_balancer_pool_model_json2 == load_balancer_pool_model_json - class TestLoadBalancerPoolCollection(): """ Test Class for LoadBalancerPoolCollection @@ -30159,8 +30613,7 @@ def test_load_balancer_pool_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_health_monitor_model = { - } # LoadBalancerPoolHealthMonitor + load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor load_balancer_pool_health_monitor_model['delay'] = 5 load_balancer_pool_health_monitor_model['max_retries'] = 2 load_balancer_pool_health_monitor_model['port'] = 22 @@ -30168,86 +30621,60 @@ def test_load_balancer_pool_collection_serialization(self): load_balancer_pool_health_monitor_model['type'] = 'http' load_balancer_pool_health_monitor_model['url_path'] = '/' - instance_group_reference_deleted_model = { - } # InstanceGroupReferenceDeleted - instance_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_reference_model = {} # InstanceGroupReference - instance_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model[ - 'deleted'] = instance_group_reference_deleted_model - instance_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted + instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_reference_model = {} # InstanceGroupReference + instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model['deleted'] = instance_group_reference_deleted_model + instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_group_reference_model['name'] = 'my-instance-group' - load_balancer_pool_member_reference_deleted_model = { - } # LoadBalancerPoolMemberReferenceDeleted - load_balancer_pool_member_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_member_reference_model = { - } # LoadBalancerPoolMemberReference - load_balancer_pool_member_reference_model[ - 'deleted'] = load_balancer_pool_member_reference_deleted_model - load_balancer_pool_member_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_reference_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - load_balancer_pool_session_persistence_model = { - } # LoadBalancerPoolSessionPersistence + load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted + load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference + load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model + load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence load_balancer_pool_session_persistence_model['type'] = 'source_ip' - load_balancer_pool_model = {} # LoadBalancerPool + load_balancer_pool_model = {} # LoadBalancerPool load_balancer_pool_model['algorithm'] = 'least_connections' - load_balancer_pool_model['created_at'] = '2020-01-28T18:40:40.123456Z' - load_balancer_pool_model[ - 'health_monitor'] = load_balancer_pool_health_monitor_model - load_balancer_pool_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + load_balancer_pool_model['health_monitor'] = load_balancer_pool_health_monitor_model + load_balancer_pool_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_model[ - 'instance_group'] = instance_group_reference_model - load_balancer_pool_model['members'] = [ - load_balancer_pool_member_reference_model - ] + load_balancer_pool_model['instance_group'] = instance_group_reference_model + load_balancer_pool_model['members'] = [load_balancer_pool_member_reference_model] load_balancer_pool_model['name'] = 'my-load-balancer-pool' load_balancer_pool_model['protocol'] = 'http' load_balancer_pool_model['provisioning_status'] = 'active' load_balancer_pool_model['proxy_protocol'] = 'disabled' - load_balancer_pool_model[ - 'session_persistence'] = load_balancer_pool_session_persistence_model + load_balancer_pool_model['session_persistence'] = load_balancer_pool_session_persistence_model # Construct a json representation of a LoadBalancerPoolCollection model load_balancer_pool_collection_model_json = {} - load_balancer_pool_collection_model_json['pools'] = [ - load_balancer_pool_model - ] + load_balancer_pool_collection_model_json['pools'] = [load_balancer_pool_model] # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation - load_balancer_pool_collection_model = LoadBalancerPoolCollection.from_dict( - load_balancer_pool_collection_model_json) + load_balancer_pool_collection_model = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json) assert load_balancer_pool_collection_model != False # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation - load_balancer_pool_collection_model_dict = LoadBalancerPoolCollection.from_dict( - load_balancer_pool_collection_model_json).__dict__ - load_balancer_pool_collection_model2 = LoadBalancerPoolCollection( - **load_balancer_pool_collection_model_dict) + load_balancer_pool_collection_model_dict = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json).__dict__ + load_balancer_pool_collection_model2 = LoadBalancerPoolCollection(**load_balancer_pool_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_collection_model == load_balancer_pool_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_collection_model_json2 = load_balancer_pool_collection_model.to_dict( - ) + load_balancer_pool_collection_model_json2 = load_balancer_pool_collection_model.to_dict() assert load_balancer_pool_collection_model_json2 == load_balancer_pool_collection_model_json - class TestLoadBalancerPoolHealthMonitor(): """ Test Class for LoadBalancerPoolHealthMonitor @@ -30268,25 +30695,20 @@ def test_load_balancer_pool_health_monitor_serialization(self): load_balancer_pool_health_monitor_model_json['url_path'] = '/' # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation - load_balancer_pool_health_monitor_model = LoadBalancerPoolHealthMonitor.from_dict( - load_balancer_pool_health_monitor_model_json) + load_balancer_pool_health_monitor_model = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json) assert load_balancer_pool_health_monitor_model != False # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation - load_balancer_pool_health_monitor_model_dict = LoadBalancerPoolHealthMonitor.from_dict( - load_balancer_pool_health_monitor_model_json).__dict__ - load_balancer_pool_health_monitor_model2 = LoadBalancerPoolHealthMonitor( - **load_balancer_pool_health_monitor_model_dict) + load_balancer_pool_health_monitor_model_dict = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json).__dict__ + load_balancer_pool_health_monitor_model2 = LoadBalancerPoolHealthMonitor(**load_balancer_pool_health_monitor_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_health_monitor_model == load_balancer_pool_health_monitor_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_health_monitor_model_json2 = load_balancer_pool_health_monitor_model.to_dict( - ) + load_balancer_pool_health_monitor_model_json2 = load_balancer_pool_health_monitor_model.to_dict() assert load_balancer_pool_health_monitor_model_json2 == load_balancer_pool_health_monitor_model_json - class TestLoadBalancerPoolHealthMonitorPatch(): """ Test Class for LoadBalancerPoolHealthMonitorPatch @@ -30307,25 +30729,20 @@ def test_load_balancer_pool_health_monitor_patch_serialization(self): load_balancer_pool_health_monitor_patch_model_json['url_path'] = '/' # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation - load_balancer_pool_health_monitor_patch_model = LoadBalancerPoolHealthMonitorPatch.from_dict( - load_balancer_pool_health_monitor_patch_model_json) + load_balancer_pool_health_monitor_patch_model = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json) assert load_balancer_pool_health_monitor_patch_model != False # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation - load_balancer_pool_health_monitor_patch_model_dict = LoadBalancerPoolHealthMonitorPatch.from_dict( - load_balancer_pool_health_monitor_patch_model_json).__dict__ - load_balancer_pool_health_monitor_patch_model2 = LoadBalancerPoolHealthMonitorPatch( - **load_balancer_pool_health_monitor_patch_model_dict) + load_balancer_pool_health_monitor_patch_model_dict = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json).__dict__ + load_balancer_pool_health_monitor_patch_model2 = LoadBalancerPoolHealthMonitorPatch(**load_balancer_pool_health_monitor_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_health_monitor_patch_model == load_balancer_pool_health_monitor_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_health_monitor_patch_model_json2 = load_balancer_pool_health_monitor_patch_model.to_dict( - ) + load_balancer_pool_health_monitor_patch_model_json2 = load_balancer_pool_health_monitor_patch_model.to_dict() assert load_balancer_pool_health_monitor_patch_model_json2 == load_balancer_pool_health_monitor_patch_model_json - class TestLoadBalancerPoolHealthMonitorPrototype(): """ Test Class for LoadBalancerPoolHealthMonitorPrototype @@ -30339,33 +30756,27 @@ def test_load_balancer_pool_health_monitor_prototype_serialization(self): # Construct a json representation of a LoadBalancerPoolHealthMonitorPrototype model load_balancer_pool_health_monitor_prototype_model_json = {} load_balancer_pool_health_monitor_prototype_model_json['delay'] = 5 - load_balancer_pool_health_monitor_prototype_model_json[ - 'max_retries'] = 2 + load_balancer_pool_health_monitor_prototype_model_json['max_retries'] = 2 load_balancer_pool_health_monitor_prototype_model_json['port'] = 22 load_balancer_pool_health_monitor_prototype_model_json['timeout'] = 2 load_balancer_pool_health_monitor_prototype_model_json['type'] = 'http' load_balancer_pool_health_monitor_prototype_model_json['url_path'] = '/' # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation - load_balancer_pool_health_monitor_prototype_model = LoadBalancerPoolHealthMonitorPrototype.from_dict( - load_balancer_pool_health_monitor_prototype_model_json) + load_balancer_pool_health_monitor_prototype_model = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json) assert load_balancer_pool_health_monitor_prototype_model != False # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation - load_balancer_pool_health_monitor_prototype_model_dict = LoadBalancerPoolHealthMonitorPrototype.from_dict( - load_balancer_pool_health_monitor_prototype_model_json).__dict__ - load_balancer_pool_health_monitor_prototype_model2 = LoadBalancerPoolHealthMonitorPrototype( - **load_balancer_pool_health_monitor_prototype_model_dict) + load_balancer_pool_health_monitor_prototype_model_dict = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json).__dict__ + load_balancer_pool_health_monitor_prototype_model2 = LoadBalancerPoolHealthMonitorPrototype(**load_balancer_pool_health_monitor_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_health_monitor_prototype_model == load_balancer_pool_health_monitor_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_health_monitor_prototype_model_json2 = load_balancer_pool_health_monitor_prototype_model.to_dict( - ) + load_balancer_pool_health_monitor_prototype_model_json2 = load_balancer_pool_health_monitor_prototype_model.to_dict() assert load_balancer_pool_health_monitor_prototype_model_json2 == load_balancer_pool_health_monitor_prototype_model_json - class TestLoadBalancerPoolIdentityByName(): """ Test Class for LoadBalancerPoolIdentityByName @@ -30378,29 +30789,23 @@ def test_load_balancer_pool_identity_by_name_serialization(self): # Construct a json representation of a LoadBalancerPoolIdentityByName model load_balancer_pool_identity_by_name_model_json = {} - load_balancer_pool_identity_by_name_model_json[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_identity_by_name_model_json['name'] = 'my-load-balancer-pool' # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation - load_balancer_pool_identity_by_name_model = LoadBalancerPoolIdentityByName.from_dict( - load_balancer_pool_identity_by_name_model_json) + load_balancer_pool_identity_by_name_model = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json) assert load_balancer_pool_identity_by_name_model != False # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation - load_balancer_pool_identity_by_name_model_dict = LoadBalancerPoolIdentityByName.from_dict( - load_balancer_pool_identity_by_name_model_json).__dict__ - load_balancer_pool_identity_by_name_model2 = LoadBalancerPoolIdentityByName( - **load_balancer_pool_identity_by_name_model_dict) + load_balancer_pool_identity_by_name_model_dict = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json).__dict__ + load_balancer_pool_identity_by_name_model2 = LoadBalancerPoolIdentityByName(**load_balancer_pool_identity_by_name_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_identity_by_name_model == load_balancer_pool_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_identity_by_name_model_json2 = load_balancer_pool_identity_by_name_model.to_dict( - ) + load_balancer_pool_identity_by_name_model_json2 = load_balancer_pool_identity_by_name_model.to_dict() assert load_balancer_pool_identity_by_name_model_json2 == load_balancer_pool_identity_by_name_model_json - class TestLoadBalancerPoolMember(): """ Test Class for LoadBalancerPoolMember @@ -30413,57 +30818,42 @@ def test_load_balancer_pool_member_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_member_target_model = { - } # LoadBalancerPoolMemberTargetInstanceReference - load_balancer_pool_member_target_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_model[ - 'deleted'] = instance_reference_deleted_model - load_balancer_pool_member_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference + load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model + load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' load_balancer_pool_member_target_model['name'] = 'my-instance' # Construct a json representation of a LoadBalancerPoolMember model load_balancer_pool_member_model_json = {} - load_balancer_pool_member_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + load_balancer_pool_member_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) load_balancer_pool_member_model_json['health'] = 'faulted' - load_balancer_pool_member_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_member_model_json['port'] = 80 load_balancer_pool_member_model_json['provisioning_status'] = 'active' - load_balancer_pool_member_model_json[ - 'target'] = load_balancer_pool_member_target_model + load_balancer_pool_member_model_json['target'] = load_balancer_pool_member_target_model load_balancer_pool_member_model_json['weight'] = 50 # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation - load_balancer_pool_member_model = LoadBalancerPoolMember.from_dict( - load_balancer_pool_member_model_json) + load_balancer_pool_member_model = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json) assert load_balancer_pool_member_model != False # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation - load_balancer_pool_member_model_dict = LoadBalancerPoolMember.from_dict( - load_balancer_pool_member_model_json).__dict__ - load_balancer_pool_member_model2 = LoadBalancerPoolMember( - **load_balancer_pool_member_model_dict) + load_balancer_pool_member_model_dict = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json).__dict__ + load_balancer_pool_member_model2 = LoadBalancerPoolMember(**load_balancer_pool_member_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_model == load_balancer_pool_member_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_model_json2 = load_balancer_pool_member_model.to_dict( - ) + load_balancer_pool_member_model_json2 = load_balancer_pool_member_model.to_dict() assert load_balancer_pool_member_model_json2 == load_balancer_pool_member_model_json - class TestLoadBalancerPoolMemberCollection(): """ Test Class for LoadBalancerPoolMemberCollection @@ -30476,62 +30866,45 @@ def test_load_balancer_pool_member_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - load_balancer_pool_member_target_model = { - } # LoadBalancerPoolMemberTargetInstanceReference - load_balancer_pool_member_target_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_model[ - 'deleted'] = instance_reference_deleted_model - load_balancer_pool_member_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference + load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model + load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' load_balancer_pool_member_target_model['name'] = 'my-instance' - load_balancer_pool_member_model = {} # LoadBalancerPoolMember - load_balancer_pool_member_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + load_balancer_pool_member_model = {} # LoadBalancerPoolMember + load_balancer_pool_member_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) load_balancer_pool_member_model['health'] = 'faulted' - load_balancer_pool_member_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_model[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_member_model['port'] = 80 load_balancer_pool_member_model['provisioning_status'] = 'active' - load_balancer_pool_member_model[ - 'target'] = load_balancer_pool_member_target_model + load_balancer_pool_member_model['target'] = load_balancer_pool_member_target_model load_balancer_pool_member_model['weight'] = 50 # Construct a json representation of a LoadBalancerPoolMemberCollection model load_balancer_pool_member_collection_model_json = {} - load_balancer_pool_member_collection_model_json['members'] = [ - load_balancer_pool_member_model - ] + load_balancer_pool_member_collection_model_json['members'] = [load_balancer_pool_member_model] # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation - load_balancer_pool_member_collection_model = LoadBalancerPoolMemberCollection.from_dict( - load_balancer_pool_member_collection_model_json) + load_balancer_pool_member_collection_model = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json) assert load_balancer_pool_member_collection_model != False # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation - load_balancer_pool_member_collection_model_dict = LoadBalancerPoolMemberCollection.from_dict( - load_balancer_pool_member_collection_model_json).__dict__ - load_balancer_pool_member_collection_model2 = LoadBalancerPoolMemberCollection( - **load_balancer_pool_member_collection_model_dict) + load_balancer_pool_member_collection_model_dict = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json).__dict__ + load_balancer_pool_member_collection_model2 = LoadBalancerPoolMemberCollection(**load_balancer_pool_member_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_collection_model == load_balancer_pool_member_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_collection_model_json2 = load_balancer_pool_member_collection_model.to_dict( - ) + load_balancer_pool_member_collection_model_json2 = load_balancer_pool_member_collection_model.to_dict() assert load_balancer_pool_member_collection_model_json2 == load_balancer_pool_member_collection_model_json - class TestLoadBalancerPoolMemberPatch(): """ Test Class for LoadBalancerPoolMemberPatch @@ -30544,38 +30917,30 @@ def test_load_balancer_pool_member_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_member_target_prototype_model = { - } # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a json representation of a LoadBalancerPoolMemberPatch model load_balancer_pool_member_patch_model_json = {} load_balancer_pool_member_patch_model_json['port'] = 80 - load_balancer_pool_member_patch_model_json[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_patch_model_json['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_patch_model_json['weight'] = 50 # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation - load_balancer_pool_member_patch_model = LoadBalancerPoolMemberPatch.from_dict( - load_balancer_pool_member_patch_model_json) + load_balancer_pool_member_patch_model = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json) assert load_balancer_pool_member_patch_model != False # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation - load_balancer_pool_member_patch_model_dict = LoadBalancerPoolMemberPatch.from_dict( - load_balancer_pool_member_patch_model_json).__dict__ - load_balancer_pool_member_patch_model2 = LoadBalancerPoolMemberPatch( - **load_balancer_pool_member_patch_model_dict) + load_balancer_pool_member_patch_model_dict = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json).__dict__ + load_balancer_pool_member_patch_model2 = LoadBalancerPoolMemberPatch(**load_balancer_pool_member_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_patch_model == load_balancer_pool_member_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_patch_model_json2 = load_balancer_pool_member_patch_model.to_dict( - ) + load_balancer_pool_member_patch_model_json2 = load_balancer_pool_member_patch_model.to_dict() assert load_balancer_pool_member_patch_model_json2 == load_balancer_pool_member_patch_model_json - class TestLoadBalancerPoolMemberPrototype(): """ Test Class for LoadBalancerPoolMemberPrototype @@ -30588,38 +30953,30 @@ def test_load_balancer_pool_member_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_member_target_prototype_model = { - } # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a json representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model_json = {} load_balancer_pool_member_prototype_model_json['port'] = 80 - load_balancer_pool_member_prototype_model_json[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model_json['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model_json['weight'] = 50 # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation - load_balancer_pool_member_prototype_model = LoadBalancerPoolMemberPrototype.from_dict( - load_balancer_pool_member_prototype_model_json) + load_balancer_pool_member_prototype_model = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json) assert load_balancer_pool_member_prototype_model != False # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation - load_balancer_pool_member_prototype_model_dict = LoadBalancerPoolMemberPrototype.from_dict( - load_balancer_pool_member_prototype_model_json).__dict__ - load_balancer_pool_member_prototype_model2 = LoadBalancerPoolMemberPrototype( - **load_balancer_pool_member_prototype_model_dict) + load_balancer_pool_member_prototype_model_dict = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json).__dict__ + load_balancer_pool_member_prototype_model2 = LoadBalancerPoolMemberPrototype(**load_balancer_pool_member_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_prototype_model == load_balancer_pool_member_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_prototype_model_json2 = load_balancer_pool_member_prototype_model.to_dict( - ) + load_balancer_pool_member_prototype_model_json2 = load_balancer_pool_member_prototype_model.to_dict() assert load_balancer_pool_member_prototype_model_json2 == load_balancer_pool_member_prototype_model_json - class TestLoadBalancerPoolMemberReference(): """ Test Class for LoadBalancerPoolMemberReference @@ -30632,40 +30989,30 @@ def test_load_balancer_pool_member_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_member_reference_deleted_model = { - } # LoadBalancerPoolMemberReferenceDeleted - load_balancer_pool_member_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted + load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerPoolMemberReference model load_balancer_pool_member_reference_model_json = {} - load_balancer_pool_member_reference_model_json[ - 'deleted'] = load_balancer_pool_member_reference_deleted_model - load_balancer_pool_member_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_member_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model_json['deleted'] = load_balancer_pool_member_reference_deleted_model + load_balancer_pool_member_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_member_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation - load_balancer_pool_member_reference_model = LoadBalancerPoolMemberReference.from_dict( - load_balancer_pool_member_reference_model_json) + load_balancer_pool_member_reference_model = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json) assert load_balancer_pool_member_reference_model != False # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation - load_balancer_pool_member_reference_model_dict = LoadBalancerPoolMemberReference.from_dict( - load_balancer_pool_member_reference_model_json).__dict__ - load_balancer_pool_member_reference_model2 = LoadBalancerPoolMemberReference( - **load_balancer_pool_member_reference_model_dict) + load_balancer_pool_member_reference_model_dict = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json).__dict__ + load_balancer_pool_member_reference_model2 = LoadBalancerPoolMemberReference(**load_balancer_pool_member_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_reference_model == load_balancer_pool_member_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_reference_model_json2 = load_balancer_pool_member_reference_model.to_dict( - ) + load_balancer_pool_member_reference_model_json2 = load_balancer_pool_member_reference_model.to_dict() assert load_balancer_pool_member_reference_model_json2 == load_balancer_pool_member_reference_model_json - class TestLoadBalancerPoolMemberReferenceDeleted(): """ Test Class for LoadBalancerPoolMemberReferenceDeleted @@ -30678,29 +31025,23 @@ def test_load_balancer_pool_member_reference_deleted_serialization(self): # Construct a json representation of a LoadBalancerPoolMemberReferenceDeleted model load_balancer_pool_member_reference_deleted_model_json = {} - load_balancer_pool_member_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_member_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation - load_balancer_pool_member_reference_deleted_model = LoadBalancerPoolMemberReferenceDeleted.from_dict( - load_balancer_pool_member_reference_deleted_model_json) + load_balancer_pool_member_reference_deleted_model = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json) assert load_balancer_pool_member_reference_deleted_model != False # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation - load_balancer_pool_member_reference_deleted_model_dict = LoadBalancerPoolMemberReferenceDeleted.from_dict( - load_balancer_pool_member_reference_deleted_model_json).__dict__ - load_balancer_pool_member_reference_deleted_model2 = LoadBalancerPoolMemberReferenceDeleted( - **load_balancer_pool_member_reference_deleted_model_dict) + load_balancer_pool_member_reference_deleted_model_dict = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json).__dict__ + load_balancer_pool_member_reference_deleted_model2 = LoadBalancerPoolMemberReferenceDeleted(**load_balancer_pool_member_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_reference_deleted_model == load_balancer_pool_member_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_reference_deleted_model_json2 = load_balancer_pool_member_reference_deleted_model.to_dict( - ) + load_balancer_pool_member_reference_deleted_model_json2 = load_balancer_pool_member_reference_deleted_model.to_dict() assert load_balancer_pool_member_reference_deleted_model_json2 == load_balancer_pool_member_reference_deleted_model_json - class TestLoadBalancerPoolPatch(): """ Test Class for LoadBalancerPoolPatch @@ -30713,8 +31054,7 @@ def test_load_balancer_pool_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_health_monitor_patch_model = { - } # LoadBalancerPoolHealthMonitorPatch + load_balancer_pool_health_monitor_patch_model = {} # LoadBalancerPoolHealthMonitorPatch load_balancer_pool_health_monitor_patch_model['delay'] = 5 load_balancer_pool_health_monitor_patch_model['max_retries'] = 2 load_balancer_pool_health_monitor_patch_model['port'] = 22 @@ -30722,41 +31062,33 @@ def test_load_balancer_pool_patch_serialization(self): load_balancer_pool_health_monitor_patch_model['type'] = 'http' load_balancer_pool_health_monitor_patch_model['url_path'] = '/' - load_balancer_pool_session_persistence_patch_model = { - } # LoadBalancerPoolSessionPersistencePatch + load_balancer_pool_session_persistence_patch_model = {} # LoadBalancerPoolSessionPersistencePatch load_balancer_pool_session_persistence_patch_model['type'] = 'source_ip' # Construct a json representation of a LoadBalancerPoolPatch model load_balancer_pool_patch_model_json = {} load_balancer_pool_patch_model_json['algorithm'] = 'least_connections' - load_balancer_pool_patch_model_json[ - 'health_monitor'] = load_balancer_pool_health_monitor_patch_model + load_balancer_pool_patch_model_json['health_monitor'] = load_balancer_pool_health_monitor_patch_model load_balancer_pool_patch_model_json['name'] = 'my-load-balancer-pool' load_balancer_pool_patch_model_json['protocol'] = 'http' load_balancer_pool_patch_model_json['proxy_protocol'] = 'disabled' - load_balancer_pool_patch_model_json[ - 'session_persistence'] = load_balancer_pool_session_persistence_patch_model + load_balancer_pool_patch_model_json['session_persistence'] = load_balancer_pool_session_persistence_patch_model # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation - load_balancer_pool_patch_model = LoadBalancerPoolPatch.from_dict( - load_balancer_pool_patch_model_json) + load_balancer_pool_patch_model = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json) assert load_balancer_pool_patch_model != False # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation - load_balancer_pool_patch_model_dict = LoadBalancerPoolPatch.from_dict( - load_balancer_pool_patch_model_json).__dict__ - load_balancer_pool_patch_model2 = LoadBalancerPoolPatch( - **load_balancer_pool_patch_model_dict) + load_balancer_pool_patch_model_dict = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json).__dict__ + load_balancer_pool_patch_model2 = LoadBalancerPoolPatch(**load_balancer_pool_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_patch_model == load_balancer_pool_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_patch_model_json2 = load_balancer_pool_patch_model.to_dict( - ) + load_balancer_pool_patch_model_json2 = load_balancer_pool_patch_model.to_dict() assert load_balancer_pool_patch_model_json2 == load_balancer_pool_patch_model_json - class TestLoadBalancerPoolPrototype(): """ Test Class for LoadBalancerPoolPrototype @@ -30769,8 +31101,7 @@ def test_load_balancer_pool_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_health_monitor_prototype_model = { - } # LoadBalancerPoolHealthMonitorPrototype + load_balancer_pool_health_monitor_prototype_model = {} # LoadBalancerPoolHealthMonitorPrototype load_balancer_pool_health_monitor_prototype_model['delay'] = 5 load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2 load_balancer_pool_health_monitor_prototype_model['port'] = 22 @@ -30778,59 +31109,42 @@ def test_load_balancer_pool_prototype_serialization(self): load_balancer_pool_health_monitor_prototype_model['type'] = 'http' load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' - load_balancer_pool_member_target_prototype_model = { - } # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById + load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_prototype_model = { - } # LoadBalancerPoolMemberPrototype + load_balancer_pool_member_prototype_model = {} # LoadBalancerPoolMemberPrototype load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model[ - 'target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model load_balancer_pool_member_prototype_model['weight'] = 50 - load_balancer_pool_session_persistence_prototype_model = { - } # LoadBalancerPoolSessionPersistencePrototype - load_balancer_pool_session_persistence_prototype_model[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model = {} # LoadBalancerPoolSessionPersistencePrototype + load_balancer_pool_session_persistence_prototype_model['type'] = 'source_ip' # Construct a json representation of a LoadBalancerPoolPrototype model load_balancer_pool_prototype_model_json = {} - load_balancer_pool_prototype_model_json[ - 'algorithm'] = 'least_connections' - load_balancer_pool_prototype_model_json[ - 'health_monitor'] = load_balancer_pool_health_monitor_prototype_model - load_balancer_pool_prototype_model_json['members'] = [ - load_balancer_pool_member_prototype_model - ] - load_balancer_pool_prototype_model_json[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_prototype_model_json['algorithm'] = 'least_connections' + load_balancer_pool_prototype_model_json['health_monitor'] = load_balancer_pool_health_monitor_prototype_model + load_balancer_pool_prototype_model_json['members'] = [load_balancer_pool_member_prototype_model] + load_balancer_pool_prototype_model_json['name'] = 'my-load-balancer-pool' load_balancer_pool_prototype_model_json['protocol'] = 'http' load_balancer_pool_prototype_model_json['proxy_protocol'] = 'disabled' - load_balancer_pool_prototype_model_json[ - 'session_persistence'] = load_balancer_pool_session_persistence_prototype_model + load_balancer_pool_prototype_model_json['session_persistence'] = load_balancer_pool_session_persistence_prototype_model # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation - load_balancer_pool_prototype_model = LoadBalancerPoolPrototype.from_dict( - load_balancer_pool_prototype_model_json) + load_balancer_pool_prototype_model = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json) assert load_balancer_pool_prototype_model != False # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation - load_balancer_pool_prototype_model_dict = LoadBalancerPoolPrototype.from_dict( - load_balancer_pool_prototype_model_json).__dict__ - load_balancer_pool_prototype_model2 = LoadBalancerPoolPrototype( - **load_balancer_pool_prototype_model_dict) + load_balancer_pool_prototype_model_dict = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json).__dict__ + load_balancer_pool_prototype_model2 = LoadBalancerPoolPrototype(**load_balancer_pool_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_prototype_model == load_balancer_pool_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_prototype_model_json2 = load_balancer_pool_prototype_model.to_dict( - ) + load_balancer_pool_prototype_model_json2 = load_balancer_pool_prototype_model.to_dict() assert load_balancer_pool_prototype_model_json2 == load_balancer_pool_prototype_model_json - class TestLoadBalancerPoolReference(): """ Test Class for LoadBalancerPoolReference @@ -30843,42 +31157,31 @@ def test_load_balancer_pool_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerPoolReference model load_balancer_pool_reference_model_json = {} - load_balancer_pool_reference_model_json[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_pool_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_pool_reference_model_json[ - 'name'] = 'my-load-balancer-pool' + load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_pool_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool' # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation - load_balancer_pool_reference_model = LoadBalancerPoolReference.from_dict( - load_balancer_pool_reference_model_json) + load_balancer_pool_reference_model = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json) assert load_balancer_pool_reference_model != False # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation - load_balancer_pool_reference_model_dict = LoadBalancerPoolReference.from_dict( - load_balancer_pool_reference_model_json).__dict__ - load_balancer_pool_reference_model2 = LoadBalancerPoolReference( - **load_balancer_pool_reference_model_dict) + load_balancer_pool_reference_model_dict = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json).__dict__ + load_balancer_pool_reference_model2 = LoadBalancerPoolReference(**load_balancer_pool_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_reference_model == load_balancer_pool_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_reference_model_json2 = load_balancer_pool_reference_model.to_dict( - ) + load_balancer_pool_reference_model_json2 = load_balancer_pool_reference_model.to_dict() assert load_balancer_pool_reference_model_json2 == load_balancer_pool_reference_model_json - class TestLoadBalancerPoolReferenceDeleted(): """ Test Class for LoadBalancerPoolReferenceDeleted @@ -30891,29 +31194,23 @@ def test_load_balancer_pool_reference_deleted_serialization(self): # Construct a json representation of a LoadBalancerPoolReferenceDeleted model load_balancer_pool_reference_deleted_model_json = {} - load_balancer_pool_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation - load_balancer_pool_reference_deleted_model = LoadBalancerPoolReferenceDeleted.from_dict( - load_balancer_pool_reference_deleted_model_json) + load_balancer_pool_reference_deleted_model = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json) assert load_balancer_pool_reference_deleted_model != False # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation - load_balancer_pool_reference_deleted_model_dict = LoadBalancerPoolReferenceDeleted.from_dict( - load_balancer_pool_reference_deleted_model_json).__dict__ - load_balancer_pool_reference_deleted_model2 = LoadBalancerPoolReferenceDeleted( - **load_balancer_pool_reference_deleted_model_dict) + load_balancer_pool_reference_deleted_model_dict = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json).__dict__ + load_balancer_pool_reference_deleted_model2 = LoadBalancerPoolReferenceDeleted(**load_balancer_pool_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_reference_deleted_model == load_balancer_pool_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_reference_deleted_model_json2 = load_balancer_pool_reference_deleted_model.to_dict( - ) + load_balancer_pool_reference_deleted_model_json2 = load_balancer_pool_reference_deleted_model.to_dict() assert load_balancer_pool_reference_deleted_model_json2 == load_balancer_pool_reference_deleted_model_json - class TestLoadBalancerPoolSessionPersistence(): """ Test Class for LoadBalancerPoolSessionPersistence @@ -30929,25 +31226,20 @@ def test_load_balancer_pool_session_persistence_serialization(self): load_balancer_pool_session_persistence_model_json['type'] = 'source_ip' # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation - load_balancer_pool_session_persistence_model = LoadBalancerPoolSessionPersistence.from_dict( - load_balancer_pool_session_persistence_model_json) + load_balancer_pool_session_persistence_model = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json) assert load_balancer_pool_session_persistence_model != False # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation - load_balancer_pool_session_persistence_model_dict = LoadBalancerPoolSessionPersistence.from_dict( - load_balancer_pool_session_persistence_model_json).__dict__ - load_balancer_pool_session_persistence_model2 = LoadBalancerPoolSessionPersistence( - **load_balancer_pool_session_persistence_model_dict) + load_balancer_pool_session_persistence_model_dict = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json).__dict__ + load_balancer_pool_session_persistence_model2 = LoadBalancerPoolSessionPersistence(**load_balancer_pool_session_persistence_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_session_persistence_model == load_balancer_pool_session_persistence_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_session_persistence_model_json2 = load_balancer_pool_session_persistence_model.to_dict( - ) + load_balancer_pool_session_persistence_model_json2 = load_balancer_pool_session_persistence_model.to_dict() assert load_balancer_pool_session_persistence_model_json2 == load_balancer_pool_session_persistence_model_json - class TestLoadBalancerPoolSessionPersistencePatch(): """ Test Class for LoadBalancerPoolSessionPersistencePatch @@ -30960,66 +31252,52 @@ def test_load_balancer_pool_session_persistence_patch_serialization(self): # Construct a json representation of a LoadBalancerPoolSessionPersistencePatch model load_balancer_pool_session_persistence_patch_model_json = {} - load_balancer_pool_session_persistence_patch_model_json[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_patch_model_json['type'] = 'source_ip' # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation - load_balancer_pool_session_persistence_patch_model = LoadBalancerPoolSessionPersistencePatch.from_dict( - load_balancer_pool_session_persistence_patch_model_json) + load_balancer_pool_session_persistence_patch_model = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json) assert load_balancer_pool_session_persistence_patch_model != False # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation - load_balancer_pool_session_persistence_patch_model_dict = LoadBalancerPoolSessionPersistencePatch.from_dict( - load_balancer_pool_session_persistence_patch_model_json).__dict__ - load_balancer_pool_session_persistence_patch_model2 = LoadBalancerPoolSessionPersistencePatch( - **load_balancer_pool_session_persistence_patch_model_dict) + load_balancer_pool_session_persistence_patch_model_dict = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json).__dict__ + load_balancer_pool_session_persistence_patch_model2 = LoadBalancerPoolSessionPersistencePatch(**load_balancer_pool_session_persistence_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_session_persistence_patch_model == load_balancer_pool_session_persistence_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_session_persistence_patch_model_json2 = load_balancer_pool_session_persistence_patch_model.to_dict( - ) + load_balancer_pool_session_persistence_patch_model_json2 = load_balancer_pool_session_persistence_patch_model.to_dict() assert load_balancer_pool_session_persistence_patch_model_json2 == load_balancer_pool_session_persistence_patch_model_json - class TestLoadBalancerPoolSessionPersistencePrototype(): """ Test Class for LoadBalancerPoolSessionPersistencePrototype """ - def test_load_balancer_pool_session_persistence_prototype_serialization( - self): + def test_load_balancer_pool_session_persistence_prototype_serialization(self): """ Test serialization/deserialization for LoadBalancerPoolSessionPersistencePrototype """ # Construct a json representation of a LoadBalancerPoolSessionPersistencePrototype model load_balancer_pool_session_persistence_prototype_model_json = {} - load_balancer_pool_session_persistence_prototype_model_json[ - 'type'] = 'source_ip' + load_balancer_pool_session_persistence_prototype_model_json['type'] = 'source_ip' # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation - load_balancer_pool_session_persistence_prototype_model = LoadBalancerPoolSessionPersistencePrototype.from_dict( - load_balancer_pool_session_persistence_prototype_model_json) + load_balancer_pool_session_persistence_prototype_model = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json) assert load_balancer_pool_session_persistence_prototype_model != False # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation - load_balancer_pool_session_persistence_prototype_model_dict = LoadBalancerPoolSessionPersistencePrototype.from_dict( - load_balancer_pool_session_persistence_prototype_model_json - ).__dict__ - load_balancer_pool_session_persistence_prototype_model2 = LoadBalancerPoolSessionPersistencePrototype( - **load_balancer_pool_session_persistence_prototype_model_dict) + load_balancer_pool_session_persistence_prototype_model_dict = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json).__dict__ + load_balancer_pool_session_persistence_prototype_model2 = LoadBalancerPoolSessionPersistencePrototype(**load_balancer_pool_session_persistence_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_session_persistence_prototype_model == load_balancer_pool_session_persistence_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_session_persistence_prototype_model_json2 = load_balancer_pool_session_persistence_prototype_model.to_dict( - ) + load_balancer_pool_session_persistence_prototype_model_json2 = load_balancer_pool_session_persistence_prototype_model.to_dict() assert load_balancer_pool_session_persistence_prototype_model_json2 == load_balancer_pool_session_persistence_prototype_model_json - class TestLoadBalancerProfile(): """ Test Class for LoadBalancerProfile @@ -31032,47 +31310,37 @@ def test_load_balancer_profile_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_profile_logging_supported_model = { - } # LoadBalancerProfileLoggingSupported + load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported load_balancer_profile_logging_supported_model['type'] = 'fixed' load_balancer_profile_logging_supported_model['value'] = ['datapath'] - load_balancer_profile_security_groups_supported_model = { - } # LoadBalancerProfileSecurityGroupsSupportedFixed + load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed load_balancer_profile_security_groups_supported_model['type'] = 'fixed' load_balancer_profile_security_groups_supported_model['value'] = True # Construct a json representation of a LoadBalancerProfile model load_balancer_profile_model_json = {} load_balancer_profile_model_json['family'] = 'network' - load_balancer_profile_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' - load_balancer_profile_model_json[ - 'logging_supported'] = load_balancer_profile_logging_supported_model + load_balancer_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_model_json['logging_supported'] = load_balancer_profile_logging_supported_model load_balancer_profile_model_json['name'] = 'network-fixed' - load_balancer_profile_model_json[ - 'security_groups_supported'] = load_balancer_profile_security_groups_supported_model + load_balancer_profile_model_json['security_groups_supported'] = load_balancer_profile_security_groups_supported_model # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation - load_balancer_profile_model = LoadBalancerProfile.from_dict( - load_balancer_profile_model_json) + load_balancer_profile_model = LoadBalancerProfile.from_dict(load_balancer_profile_model_json) assert load_balancer_profile_model != False # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation - load_balancer_profile_model_dict = LoadBalancerProfile.from_dict( - load_balancer_profile_model_json).__dict__ - load_balancer_profile_model2 = LoadBalancerProfile( - **load_balancer_profile_model_dict) + load_balancer_profile_model_dict = LoadBalancerProfile.from_dict(load_balancer_profile_model_json).__dict__ + load_balancer_profile_model2 = LoadBalancerProfile(**load_balancer_profile_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_model == load_balancer_profile_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_model_json2 = load_balancer_profile_model.to_dict( - ) + load_balancer_profile_model_json2 = load_balancer_profile_model.to_dict() assert load_balancer_profile_model_json2 == load_balancer_profile_model_json - class TestLoadBalancerProfileCollection(): """ Test Class for LoadBalancerProfileCollection @@ -31085,68 +31353,50 @@ def test_load_balancer_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_profile_collection_first_model = { - } # LoadBalancerProfileCollectionFirst - load_balancer_profile_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' + load_balancer_profile_collection_first_model = {} # LoadBalancerProfileCollectionFirst + load_balancer_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' - load_balancer_profile_collection_next_model = { - } # LoadBalancerProfileCollectionNext - load_balancer_profile_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + load_balancer_profile_collection_next_model = {} # LoadBalancerProfileCollectionNext + load_balancer_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - load_balancer_profile_logging_supported_model = { - } # LoadBalancerProfileLoggingSupported + load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported load_balancer_profile_logging_supported_model['type'] = 'fixed' load_balancer_profile_logging_supported_model['value'] = ['datapath'] - load_balancer_profile_security_groups_supported_model = { - } # LoadBalancerProfileSecurityGroupsSupportedFixed + load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed load_balancer_profile_security_groups_supported_model['type'] = 'fixed' load_balancer_profile_security_groups_supported_model['value'] = True - load_balancer_profile_model = {} # LoadBalancerProfile + load_balancer_profile_model = {} # LoadBalancerProfile load_balancer_profile_model['family'] = 'network' - load_balancer_profile_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' - load_balancer_profile_model[ - 'logging_supported'] = load_balancer_profile_logging_supported_model + load_balancer_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_model['logging_supported'] = load_balancer_profile_logging_supported_model load_balancer_profile_model['name'] = 'network-fixed' - load_balancer_profile_model[ - 'security_groups_supported'] = load_balancer_profile_security_groups_supported_model + load_balancer_profile_model['security_groups_supported'] = load_balancer_profile_security_groups_supported_model # Construct a json representation of a LoadBalancerProfileCollection model load_balancer_profile_collection_model_json = {} - load_balancer_profile_collection_model_json[ - 'first'] = load_balancer_profile_collection_first_model + load_balancer_profile_collection_model_json['first'] = load_balancer_profile_collection_first_model load_balancer_profile_collection_model_json['limit'] = 20 - load_balancer_profile_collection_model_json[ - 'next'] = load_balancer_profile_collection_next_model - load_balancer_profile_collection_model_json['profiles'] = [ - load_balancer_profile_model - ] + load_balancer_profile_collection_model_json['next'] = load_balancer_profile_collection_next_model + load_balancer_profile_collection_model_json['profiles'] = [load_balancer_profile_model] load_balancer_profile_collection_model_json['total_count'] = 132 # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation - load_balancer_profile_collection_model = LoadBalancerProfileCollection.from_dict( - load_balancer_profile_collection_model_json) + load_balancer_profile_collection_model = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json) assert load_balancer_profile_collection_model != False # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation - load_balancer_profile_collection_model_dict = LoadBalancerProfileCollection.from_dict( - load_balancer_profile_collection_model_json).__dict__ - load_balancer_profile_collection_model2 = LoadBalancerProfileCollection( - **load_balancer_profile_collection_model_dict) + load_balancer_profile_collection_model_dict = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json).__dict__ + load_balancer_profile_collection_model2 = LoadBalancerProfileCollection(**load_balancer_profile_collection_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_collection_model == load_balancer_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_collection_model_json2 = load_balancer_profile_collection_model.to_dict( - ) + load_balancer_profile_collection_model_json2 = load_balancer_profile_collection_model.to_dict() assert load_balancer_profile_collection_model_json2 == load_balancer_profile_collection_model_json - class TestLoadBalancerProfileCollectionFirst(): """ Test Class for LoadBalancerProfileCollectionFirst @@ -31159,29 +31409,23 @@ def test_load_balancer_profile_collection_first_serialization(self): # Construct a json representation of a LoadBalancerProfileCollectionFirst model load_balancer_profile_collection_first_model_json = {} - load_balancer_profile_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' + load_balancer_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation - load_balancer_profile_collection_first_model = LoadBalancerProfileCollectionFirst.from_dict( - load_balancer_profile_collection_first_model_json) + load_balancer_profile_collection_first_model = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json) assert load_balancer_profile_collection_first_model != False # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation - load_balancer_profile_collection_first_model_dict = LoadBalancerProfileCollectionFirst.from_dict( - load_balancer_profile_collection_first_model_json).__dict__ - load_balancer_profile_collection_first_model2 = LoadBalancerProfileCollectionFirst( - **load_balancer_profile_collection_first_model_dict) + load_balancer_profile_collection_first_model_dict = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json).__dict__ + load_balancer_profile_collection_first_model2 = LoadBalancerProfileCollectionFirst(**load_balancer_profile_collection_first_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_collection_first_model == load_balancer_profile_collection_first_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_collection_first_model_json2 = load_balancer_profile_collection_first_model.to_dict( - ) + load_balancer_profile_collection_first_model_json2 = load_balancer_profile_collection_first_model.to_dict() assert load_balancer_profile_collection_first_model_json2 == load_balancer_profile_collection_first_model_json - class TestLoadBalancerProfileCollectionNext(): """ Test Class for LoadBalancerProfileCollectionNext @@ -31194,29 +31438,23 @@ def test_load_balancer_profile_collection_next_serialization(self): # Construct a json representation of a LoadBalancerProfileCollectionNext model load_balancer_profile_collection_next_model_json = {} - load_balancer_profile_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + load_balancer_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation - load_balancer_profile_collection_next_model = LoadBalancerProfileCollectionNext.from_dict( - load_balancer_profile_collection_next_model_json) + load_balancer_profile_collection_next_model = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json) assert load_balancer_profile_collection_next_model != False # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation - load_balancer_profile_collection_next_model_dict = LoadBalancerProfileCollectionNext.from_dict( - load_balancer_profile_collection_next_model_json).__dict__ - load_balancer_profile_collection_next_model2 = LoadBalancerProfileCollectionNext( - **load_balancer_profile_collection_next_model_dict) + load_balancer_profile_collection_next_model_dict = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json).__dict__ + load_balancer_profile_collection_next_model2 = LoadBalancerProfileCollectionNext(**load_balancer_profile_collection_next_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_collection_next_model == load_balancer_profile_collection_next_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_collection_next_model_json2 = load_balancer_profile_collection_next_model.to_dict( - ) + load_balancer_profile_collection_next_model_json2 = load_balancer_profile_collection_next_model.to_dict() assert load_balancer_profile_collection_next_model_json2 == load_balancer_profile_collection_next_model_json - class TestLoadBalancerProfileLoggingSupported(): """ Test Class for LoadBalancerProfileLoggingSupported @@ -31230,30 +31468,23 @@ def test_load_balancer_profile_logging_supported_serialization(self): # Construct a json representation of a LoadBalancerProfileLoggingSupported model load_balancer_profile_logging_supported_model_json = {} load_balancer_profile_logging_supported_model_json['type'] = 'fixed' - load_balancer_profile_logging_supported_model_json['value'] = [ - 'datapath' - ] + load_balancer_profile_logging_supported_model_json['value'] = ['datapath'] # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation - load_balancer_profile_logging_supported_model = LoadBalancerProfileLoggingSupported.from_dict( - load_balancer_profile_logging_supported_model_json) + load_balancer_profile_logging_supported_model = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json) assert load_balancer_profile_logging_supported_model != False # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation - load_balancer_profile_logging_supported_model_dict = LoadBalancerProfileLoggingSupported.from_dict( - load_balancer_profile_logging_supported_model_json).__dict__ - load_balancer_profile_logging_supported_model2 = LoadBalancerProfileLoggingSupported( - **load_balancer_profile_logging_supported_model_dict) + load_balancer_profile_logging_supported_model_dict = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json).__dict__ + load_balancer_profile_logging_supported_model2 = LoadBalancerProfileLoggingSupported(**load_balancer_profile_logging_supported_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_logging_supported_model == load_balancer_profile_logging_supported_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_logging_supported_model_json2 = load_balancer_profile_logging_supported_model.to_dict( - ) + load_balancer_profile_logging_supported_model_json2 = load_balancer_profile_logging_supported_model.to_dict() assert load_balancer_profile_logging_supported_model_json2 == load_balancer_profile_logging_supported_model_json - class TestLoadBalancerProfileReference(): """ Test Class for LoadBalancerProfileReference @@ -31267,30 +31498,24 @@ def test_load_balancer_profile_reference_serialization(self): # Construct a json representation of a LoadBalancerProfileReference model load_balancer_profile_reference_model_json = {} load_balancer_profile_reference_model_json['family'] = 'network' - load_balancer_profile_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' load_balancer_profile_reference_model_json['name'] = 'network-fixed' # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation - load_balancer_profile_reference_model = LoadBalancerProfileReference.from_dict( - load_balancer_profile_reference_model_json) + load_balancer_profile_reference_model = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json) assert load_balancer_profile_reference_model != False # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation - load_balancer_profile_reference_model_dict = LoadBalancerProfileReference.from_dict( - load_balancer_profile_reference_model_json).__dict__ - load_balancer_profile_reference_model2 = LoadBalancerProfileReference( - **load_balancer_profile_reference_model_dict) + load_balancer_profile_reference_model_dict = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json).__dict__ + load_balancer_profile_reference_model2 = LoadBalancerProfileReference(**load_balancer_profile_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_reference_model == load_balancer_profile_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_reference_model_json2 = load_balancer_profile_reference_model.to_dict( - ) + load_balancer_profile_reference_model_json2 = load_balancer_profile_reference_model.to_dict() assert load_balancer_profile_reference_model_json2 == load_balancer_profile_reference_model_json - class TestLoadBalancerReferenceDeleted(): """ Test Class for LoadBalancerReferenceDeleted @@ -31303,29 +31528,23 @@ def test_load_balancer_reference_deleted_serialization(self): # Construct a json representation of a LoadBalancerReferenceDeleted model load_balancer_reference_deleted_model_json = {} - load_balancer_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation - load_balancer_reference_deleted_model = LoadBalancerReferenceDeleted.from_dict( - load_balancer_reference_deleted_model_json) + load_balancer_reference_deleted_model = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json) assert load_balancer_reference_deleted_model != False # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation - load_balancer_reference_deleted_model_dict = LoadBalancerReferenceDeleted.from_dict( - load_balancer_reference_deleted_model_json).__dict__ - load_balancer_reference_deleted_model2 = LoadBalancerReferenceDeleted( - **load_balancer_reference_deleted_model_dict) + load_balancer_reference_deleted_model_dict = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json).__dict__ + load_balancer_reference_deleted_model2 = LoadBalancerReferenceDeleted(**load_balancer_reference_deleted_model_dict) # Verify the model instances are equivalent assert load_balancer_reference_deleted_model == load_balancer_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_reference_deleted_model_json2 = load_balancer_reference_deleted_model.to_dict( - ) + load_balancer_reference_deleted_model_json2 = load_balancer_reference_deleted_model.to_dict() assert load_balancer_reference_deleted_model_json2 == load_balancer_reference_deleted_model_json - class TestLoadBalancerStatistics(): """ Test Class for LoadBalancerStatistics @@ -31340,30 +31559,24 @@ def test_load_balancer_statistics_serialization(self): load_balancer_statistics_model_json = {} load_balancer_statistics_model_json['active_connections'] = 797 load_balancer_statistics_model_json['connection_rate'] = 91.121 - load_balancer_statistics_model_json[ - 'data_processed_this_month'] = 10093173145 + load_balancer_statistics_model_json['data_processed_this_month'] = 10093173145 load_balancer_statistics_model_json['throughput'] = 167.278 # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation - load_balancer_statistics_model = LoadBalancerStatistics.from_dict( - load_balancer_statistics_model_json) + load_balancer_statistics_model = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json) assert load_balancer_statistics_model != False # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation - load_balancer_statistics_model_dict = LoadBalancerStatistics.from_dict( - load_balancer_statistics_model_json).__dict__ - load_balancer_statistics_model2 = LoadBalancerStatistics( - **load_balancer_statistics_model_dict) + load_balancer_statistics_model_dict = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json).__dict__ + load_balancer_statistics_model2 = LoadBalancerStatistics(**load_balancer_statistics_model_dict) # Verify the model instances are equivalent assert load_balancer_statistics_model == load_balancer_statistics_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_statistics_model_json2 = load_balancer_statistics_model.to_dict( - ) + load_balancer_statistics_model_json2 = load_balancer_statistics_model.to_dict() assert load_balancer_statistics_model_json2 == load_balancer_statistics_model_json - class TestNetworkACL(): """ Test Class for NetworkACL @@ -31376,39 +31589,28 @@ def test_network_acl_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = { - } # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model - network_acl_rule_item_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + network_acl_rule_item_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_acl_rule_item_model['destination'] = '192.168.3.0/24' network_acl_rule_item_model['direction'] = 'inbound' - network_acl_rule_item_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' network_acl_rule_item_model['name'] = 'my-rule-2' network_acl_rule_item_model['source'] = '192.168.3.0/24' @@ -31418,43 +31620,34 @@ def test_network_acl_serialization(self): network_acl_rule_item_model['source_port_max'] = 65535 network_acl_rule_item_model['source_port_min'] = 49152 - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a NetworkACL model network_acl_model_json = {} - network_acl_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_model_json['name'] = 'my-network-acl' - network_acl_model_json[ - 'resource_group'] = resource_group_reference_model + network_acl_model_json['resource_group'] = resource_group_reference_model network_acl_model_json['rules'] = [network_acl_rule_item_model] network_acl_model_json['subnets'] = [subnet_reference_model] network_acl_model_json['vpc'] = vpc_reference_model @@ -31464,8 +31657,7 @@ def test_network_acl_serialization(self): assert network_acl_model != False # Construct a model instance of NetworkACL by calling from_dict on the json representation - network_acl_model_dict = NetworkACL.from_dict( - network_acl_model_json).__dict__ + network_acl_model_dict = NetworkACL.from_dict(network_acl_model_json).__dict__ network_acl_model2 = NetworkACL(**network_acl_model_dict) # Verify the model instances are equivalent @@ -31475,7 +31667,6 @@ def test_network_acl_serialization(self): network_acl_model_json2 = network_acl_model.to_dict() assert network_acl_model_json2 == network_acl_model_json - class TestNetworkACLCollection(): """ Test Class for NetworkACLCollection @@ -31488,43 +31679,31 @@ def test_network_acl_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_collection_first_model = {} # NetworkACLCollectionFirst - network_acl_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' + network_acl_collection_first_model = {} # NetworkACLCollectionFirst + network_acl_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = { - } # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model - network_acl_rule_item_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + network_acl_rule_item_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_acl_rule_item_model['destination'] = '192.168.3.0/24' network_acl_rule_item_model['direction'] = 'inbound' - network_acl_rule_item_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' network_acl_rule_item_model['name'] = 'my-rule-2' network_acl_rule_item_model['source'] = '192.168.3.0/24' @@ -31534,38 +31713,30 @@ def test_network_acl_collection_serialization(self): network_acl_rule_item_model['source_port_max'] = 65535 network_acl_rule_item_model['source_port_min'] = 49152 - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - network_acl_model = {} # NetworkACL - network_acl_model['created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model = {} # NetworkACL + network_acl_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_model['name'] = 'my-network-acl' network_acl_model['resource_group'] = resource_group_reference_model @@ -31573,40 +31744,32 @@ def test_network_acl_collection_serialization(self): network_acl_model['subnets'] = [subnet_reference_model] network_acl_model['vpc'] = vpc_reference_model - network_acl_collection_next_model = {} # NetworkACLCollectionNext - network_acl_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + network_acl_collection_next_model = {} # NetworkACLCollectionNext + network_acl_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a json representation of a NetworkACLCollection model network_acl_collection_model_json = {} - network_acl_collection_model_json[ - 'first'] = network_acl_collection_first_model + network_acl_collection_model_json['first'] = network_acl_collection_first_model network_acl_collection_model_json['limit'] = 20 network_acl_collection_model_json['network_acls'] = [network_acl_model] - network_acl_collection_model_json[ - 'next'] = network_acl_collection_next_model + network_acl_collection_model_json['next'] = network_acl_collection_next_model network_acl_collection_model_json['total_count'] = 132 # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation - network_acl_collection_model = NetworkACLCollection.from_dict( - network_acl_collection_model_json) + network_acl_collection_model = NetworkACLCollection.from_dict(network_acl_collection_model_json) assert network_acl_collection_model != False # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation - network_acl_collection_model_dict = NetworkACLCollection.from_dict( - network_acl_collection_model_json).__dict__ - network_acl_collection_model2 = NetworkACLCollection( - **network_acl_collection_model_dict) + network_acl_collection_model_dict = NetworkACLCollection.from_dict(network_acl_collection_model_json).__dict__ + network_acl_collection_model2 = NetworkACLCollection(**network_acl_collection_model_dict) # Verify the model instances are equivalent assert network_acl_collection_model == network_acl_collection_model2 # Convert model instance back to dict and verify no loss of data - network_acl_collection_model_json2 = network_acl_collection_model.to_dict( - ) + network_acl_collection_model_json2 = network_acl_collection_model.to_dict() assert network_acl_collection_model_json2 == network_acl_collection_model_json - class TestNetworkACLCollectionFirst(): """ Test Class for NetworkACLCollectionFirst @@ -31619,29 +31782,23 @@ def test_network_acl_collection_first_serialization(self): # Construct a json representation of a NetworkACLCollectionFirst model network_acl_collection_first_model_json = {} - network_acl_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' + network_acl_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation - network_acl_collection_first_model = NetworkACLCollectionFirst.from_dict( - network_acl_collection_first_model_json) + network_acl_collection_first_model = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json) assert network_acl_collection_first_model != False # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation - network_acl_collection_first_model_dict = NetworkACLCollectionFirst.from_dict( - network_acl_collection_first_model_json).__dict__ - network_acl_collection_first_model2 = NetworkACLCollectionFirst( - **network_acl_collection_first_model_dict) + network_acl_collection_first_model_dict = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json).__dict__ + network_acl_collection_first_model2 = NetworkACLCollectionFirst(**network_acl_collection_first_model_dict) # Verify the model instances are equivalent assert network_acl_collection_first_model == network_acl_collection_first_model2 # Convert model instance back to dict and verify no loss of data - network_acl_collection_first_model_json2 = network_acl_collection_first_model.to_dict( - ) + network_acl_collection_first_model_json2 = network_acl_collection_first_model.to_dict() assert network_acl_collection_first_model_json2 == network_acl_collection_first_model_json - class TestNetworkACLCollectionNext(): """ Test Class for NetworkACLCollectionNext @@ -31654,29 +31811,23 @@ def test_network_acl_collection_next_serialization(self): # Construct a json representation of a NetworkACLCollectionNext model network_acl_collection_next_model_json = {} - network_acl_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + network_acl_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation - network_acl_collection_next_model = NetworkACLCollectionNext.from_dict( - network_acl_collection_next_model_json) + network_acl_collection_next_model = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json) assert network_acl_collection_next_model != False # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation - network_acl_collection_next_model_dict = NetworkACLCollectionNext.from_dict( - network_acl_collection_next_model_json).__dict__ - network_acl_collection_next_model2 = NetworkACLCollectionNext( - **network_acl_collection_next_model_dict) + network_acl_collection_next_model_dict = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json).__dict__ + network_acl_collection_next_model2 = NetworkACLCollectionNext(**network_acl_collection_next_model_dict) # Verify the model instances are equivalent assert network_acl_collection_next_model == network_acl_collection_next_model2 # Convert model instance back to dict and verify no loss of data - network_acl_collection_next_model_json2 = network_acl_collection_next_model.to_dict( - ) + network_acl_collection_next_model_json2 = network_acl_collection_next_model.to_dict() assert network_acl_collection_next_model_json2 == network_acl_collection_next_model_json - class TestNetworkACLPatch(): """ Test Class for NetworkACLPatch @@ -31692,15 +31843,12 @@ def test_network_acl_patch_serialization(self): network_acl_patch_model_json['name'] = 'my-network-acl' # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation - network_acl_patch_model = NetworkACLPatch.from_dict( - network_acl_patch_model_json) + network_acl_patch_model = NetworkACLPatch.from_dict(network_acl_patch_model_json) assert network_acl_patch_model != False # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation - network_acl_patch_model_dict = NetworkACLPatch.from_dict( - network_acl_patch_model_json).__dict__ - network_acl_patch_model2 = NetworkACLPatch( - **network_acl_patch_model_dict) + network_acl_patch_model_dict = NetworkACLPatch.from_dict(network_acl_patch_model_json).__dict__ + network_acl_patch_model2 = NetworkACLPatch(**network_acl_patch_model_dict) # Verify the model instances are equivalent assert network_acl_patch_model == network_acl_patch_model2 @@ -31709,7 +31857,6 @@ def test_network_acl_patch_serialization(self): network_acl_patch_model_json2 = network_acl_patch_model.to_dict() assert network_acl_patch_model_json2 == network_acl_patch_model_json - class TestNetworkACLReference(): """ Test Class for NetworkACLReference @@ -31722,42 +31869,32 @@ def test_network_acl_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted - network_acl_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted + network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a NetworkACLReference model network_acl_reference_model_json = {} - network_acl_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model_json[ - 'deleted'] = network_acl_reference_deleted_model - network_acl_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model_json[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['deleted'] = network_acl_reference_deleted_model + network_acl_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_reference_model_json['name'] = 'my-network-acl' # Construct a model instance of NetworkACLReference by calling from_dict on the json representation - network_acl_reference_model = NetworkACLReference.from_dict( - network_acl_reference_model_json) + network_acl_reference_model = NetworkACLReference.from_dict(network_acl_reference_model_json) assert network_acl_reference_model != False # Construct a model instance of NetworkACLReference by calling from_dict on the json representation - network_acl_reference_model_dict = NetworkACLReference.from_dict( - network_acl_reference_model_json).__dict__ - network_acl_reference_model2 = NetworkACLReference( - **network_acl_reference_model_dict) + network_acl_reference_model_dict = NetworkACLReference.from_dict(network_acl_reference_model_json).__dict__ + network_acl_reference_model2 = NetworkACLReference(**network_acl_reference_model_dict) # Verify the model instances are equivalent assert network_acl_reference_model == network_acl_reference_model2 # Convert model instance back to dict and verify no loss of data - network_acl_reference_model_json2 = network_acl_reference_model.to_dict( - ) + network_acl_reference_model_json2 = network_acl_reference_model.to_dict() assert network_acl_reference_model_json2 == network_acl_reference_model_json - class TestNetworkACLReferenceDeleted(): """ Test Class for NetworkACLReferenceDeleted @@ -31770,29 +31907,23 @@ def test_network_acl_reference_deleted_serialization(self): # Construct a json representation of a NetworkACLReferenceDeleted model network_acl_reference_deleted_model_json = {} - network_acl_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_acl_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation - network_acl_reference_deleted_model = NetworkACLReferenceDeleted.from_dict( - network_acl_reference_deleted_model_json) + network_acl_reference_deleted_model = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json) assert network_acl_reference_deleted_model != False # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation - network_acl_reference_deleted_model_dict = NetworkACLReferenceDeleted.from_dict( - network_acl_reference_deleted_model_json).__dict__ - network_acl_reference_deleted_model2 = NetworkACLReferenceDeleted( - **network_acl_reference_deleted_model_dict) + network_acl_reference_deleted_model_dict = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json).__dict__ + network_acl_reference_deleted_model2 = NetworkACLReferenceDeleted(**network_acl_reference_deleted_model_dict) # Verify the model instances are equivalent assert network_acl_reference_deleted_model == network_acl_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - network_acl_reference_deleted_model_json2 = network_acl_reference_deleted_model.to_dict( - ) + network_acl_reference_deleted_model_json2 = network_acl_reference_deleted_model.to_dict() assert network_acl_reference_deleted_model_json2 == network_acl_reference_deleted_model_json - class TestNetworkACLRuleCollection(): """ Test Class for NetworkACLRuleCollection @@ -31805,42 +31936,29 @@ def test_network_acl_rule_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_collection_first_model = { - } # NetworkACLRuleCollectionFirst - network_acl_rule_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' - - network_acl_rule_collection_next_model = { - } # NetworkACLRuleCollectionNext - network_acl_rule_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_collection_first_model = {} # NetworkACLRuleCollectionFirst + network_acl_rule_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' + + network_acl_rule_collection_next_model = {} # NetworkACLRuleCollectionNext + network_acl_rule_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = { - } # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model - network_acl_rule_item_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + network_acl_rule_item_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_acl_rule_item_model['destination'] = '192.168.3.0/24' network_acl_rule_item_model['direction'] = 'inbound' - network_acl_rule_item_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' network_acl_rule_item_model['name'] = 'my-rule-2' network_acl_rule_item_model['source'] = '192.168.3.0/24' @@ -31852,36 +31970,27 @@ def test_network_acl_rule_collection_serialization(self): # Construct a json representation of a NetworkACLRuleCollection model network_acl_rule_collection_model_json = {} - network_acl_rule_collection_model_json[ - 'first'] = network_acl_rule_collection_first_model + network_acl_rule_collection_model_json['first'] = network_acl_rule_collection_first_model network_acl_rule_collection_model_json['limit'] = 20 - network_acl_rule_collection_model_json[ - 'next'] = network_acl_rule_collection_next_model - network_acl_rule_collection_model_json['rules'] = [ - network_acl_rule_item_model - ] + network_acl_rule_collection_model_json['next'] = network_acl_rule_collection_next_model + network_acl_rule_collection_model_json['rules'] = [network_acl_rule_item_model] network_acl_rule_collection_model_json['total_count'] = 132 # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation - network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict( - network_acl_rule_collection_model_json) + network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json) assert network_acl_rule_collection_model != False # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation - network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict( - network_acl_rule_collection_model_json).__dict__ - network_acl_rule_collection_model2 = NetworkACLRuleCollection( - **network_acl_rule_collection_model_dict) + network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json).__dict__ + network_acl_rule_collection_model2 = NetworkACLRuleCollection(**network_acl_rule_collection_model_dict) # Verify the model instances are equivalent assert network_acl_rule_collection_model == network_acl_rule_collection_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict( - ) + network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict() assert network_acl_rule_collection_model_json2 == network_acl_rule_collection_model_json - class TestNetworkACLRuleCollectionFirst(): """ Test Class for NetworkACLRuleCollectionFirst @@ -31894,29 +32003,23 @@ def test_network_acl_rule_collection_first_serialization(self): # Construct a json representation of a NetworkACLRuleCollectionFirst model network_acl_rule_collection_first_model_json = {} - network_acl_rule_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' + network_acl_rule_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation - network_acl_rule_collection_first_model = NetworkACLRuleCollectionFirst.from_dict( - network_acl_rule_collection_first_model_json) + network_acl_rule_collection_first_model = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json) assert network_acl_rule_collection_first_model != False # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation - network_acl_rule_collection_first_model_dict = NetworkACLRuleCollectionFirst.from_dict( - network_acl_rule_collection_first_model_json).__dict__ - network_acl_rule_collection_first_model2 = NetworkACLRuleCollectionFirst( - **network_acl_rule_collection_first_model_dict) + network_acl_rule_collection_first_model_dict = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json).__dict__ + network_acl_rule_collection_first_model2 = NetworkACLRuleCollectionFirst(**network_acl_rule_collection_first_model_dict) # Verify the model instances are equivalent assert network_acl_rule_collection_first_model == network_acl_rule_collection_first_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_first_model_json2 = network_acl_rule_collection_first_model.to_dict( - ) + network_acl_rule_collection_first_model_json2 = network_acl_rule_collection_first_model.to_dict() assert network_acl_rule_collection_first_model_json2 == network_acl_rule_collection_first_model_json - class TestNetworkACLRuleCollectionNext(): """ Test Class for NetworkACLRuleCollectionNext @@ -31929,29 +32032,23 @@ def test_network_acl_rule_collection_next_serialization(self): # Construct a json representation of a NetworkACLRuleCollectionNext model network_acl_rule_collection_next_model_json = {} - network_acl_rule_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + network_acl_rule_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation - network_acl_rule_collection_next_model = NetworkACLRuleCollectionNext.from_dict( - network_acl_rule_collection_next_model_json) + network_acl_rule_collection_next_model = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json) assert network_acl_rule_collection_next_model != False # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation - network_acl_rule_collection_next_model_dict = NetworkACLRuleCollectionNext.from_dict( - network_acl_rule_collection_next_model_json).__dict__ - network_acl_rule_collection_next_model2 = NetworkACLRuleCollectionNext( - **network_acl_rule_collection_next_model_dict) + network_acl_rule_collection_next_model_dict = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json).__dict__ + network_acl_rule_collection_next_model2 = NetworkACLRuleCollectionNext(**network_acl_rule_collection_next_model_dict) # Verify the model instances are equivalent assert network_acl_rule_collection_next_model == network_acl_rule_collection_next_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_next_model_json2 = network_acl_rule_collection_next_model.to_dict( - ) + network_acl_rule_collection_next_model_json2 = network_acl_rule_collection_next_model.to_dict() assert network_acl_rule_collection_next_model_json2 == network_acl_rule_collection_next_model_json - class TestNetworkACLRulePatch(): """ Test Class for NetworkACLRulePatch @@ -31964,16 +32061,13 @@ def test_network_acl_rule_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_before_patch_model = { - } # NetworkACLRuleBeforePatchNetworkACLRuleIdentityById - network_acl_rule_before_patch_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_patch_model = {} # NetworkACLRuleBeforePatchNetworkACLRuleIdentityById + network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a json representation of a NetworkACLRulePatch model network_acl_rule_patch_model_json = {} network_acl_rule_patch_model_json['action'] = 'allow' - network_acl_rule_patch_model_json[ - 'before'] = network_acl_rule_before_patch_model + network_acl_rule_patch_model_json['before'] = network_acl_rule_before_patch_model network_acl_rule_patch_model_json['code'] = 0 network_acl_rule_patch_model_json['destination'] = '192.168.3.2/32' network_acl_rule_patch_model_json['destination_port_max'] = 22 @@ -31986,25 +32080,20 @@ def test_network_acl_rule_patch_serialization(self): network_acl_rule_patch_model_json['type'] = 8 # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation - network_acl_rule_patch_model = NetworkACLRulePatch.from_dict( - network_acl_rule_patch_model_json) + network_acl_rule_patch_model = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json) assert network_acl_rule_patch_model != False # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation - network_acl_rule_patch_model_dict = NetworkACLRulePatch.from_dict( - network_acl_rule_patch_model_json).__dict__ - network_acl_rule_patch_model2 = NetworkACLRulePatch( - **network_acl_rule_patch_model_dict) + network_acl_rule_patch_model_dict = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json).__dict__ + network_acl_rule_patch_model2 = NetworkACLRulePatch(**network_acl_rule_patch_model_dict) # Verify the model instances are equivalent assert network_acl_rule_patch_model == network_acl_rule_patch_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_patch_model_json2 = network_acl_rule_patch_model.to_dict( - ) + network_acl_rule_patch_model_json2 = network_acl_rule_patch_model.to_dict() assert network_acl_rule_patch_model_json2 == network_acl_rule_patch_model_json - class TestNetworkACLRuleReference(): """ Test Class for NetworkACLRuleReference @@ -32017,41 +32106,31 @@ def test_network_acl_rule_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a NetworkACLRuleReference model network_acl_rule_reference_model_json = {} - network_acl_rule_reference_model_json[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model_json['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model_json['name'] = 'my-rule-1' # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation - network_acl_rule_reference_model = NetworkACLRuleReference.from_dict( - network_acl_rule_reference_model_json) + network_acl_rule_reference_model = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json) assert network_acl_rule_reference_model != False # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation - network_acl_rule_reference_model_dict = NetworkACLRuleReference.from_dict( - network_acl_rule_reference_model_json).__dict__ - network_acl_rule_reference_model2 = NetworkACLRuleReference( - **network_acl_rule_reference_model_dict) + network_acl_rule_reference_model_dict = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json).__dict__ + network_acl_rule_reference_model2 = NetworkACLRuleReference(**network_acl_rule_reference_model_dict) # Verify the model instances are equivalent assert network_acl_rule_reference_model == network_acl_rule_reference_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_reference_model_json2 = network_acl_rule_reference_model.to_dict( - ) + network_acl_rule_reference_model_json2 = network_acl_rule_reference_model.to_dict() assert network_acl_rule_reference_model_json2 == network_acl_rule_reference_model_json - class TestNetworkACLRuleReferenceDeleted(): """ Test Class for NetworkACLRuleReferenceDeleted @@ -32064,29 +32143,23 @@ def test_network_acl_rule_reference_deleted_serialization(self): # Construct a json representation of a NetworkACLRuleReferenceDeleted model network_acl_rule_reference_deleted_model_json = {} - network_acl_rule_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_acl_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation - network_acl_rule_reference_deleted_model = NetworkACLRuleReferenceDeleted.from_dict( - network_acl_rule_reference_deleted_model_json) + network_acl_rule_reference_deleted_model = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json) assert network_acl_rule_reference_deleted_model != False # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation - network_acl_rule_reference_deleted_model_dict = NetworkACLRuleReferenceDeleted.from_dict( - network_acl_rule_reference_deleted_model_json).__dict__ - network_acl_rule_reference_deleted_model2 = NetworkACLRuleReferenceDeleted( - **network_acl_rule_reference_deleted_model_dict) + network_acl_rule_reference_deleted_model_dict = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json).__dict__ + network_acl_rule_reference_deleted_model2 = NetworkACLRuleReferenceDeleted(**network_acl_rule_reference_deleted_model_dict) # Verify the model instances are equivalent assert network_acl_rule_reference_deleted_model == network_acl_rule_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_reference_deleted_model_json2 = network_acl_rule_reference_deleted_model.to_dict( - ) + network_acl_rule_reference_deleted_model_json2 = network_acl_rule_reference_deleted_model.to_dict() assert network_acl_rule_reference_deleted_model_json2 == network_acl_rule_reference_deleted_model_json - class TestNetworkInterface(): """ Test Class for NetworkInterface @@ -32099,84 +32172,60 @@ def test_network_interface_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - floating_ip_reference_model = {} # FloatingIPReference + floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'deleted'] = floating_ip_reference_deleted_model - floating_ip_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a NetworkInterface model network_interface_model_json = {} network_interface_model_json['allow_ip_spoofing'] = True - network_interface_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_interface_model_json['floating_ips'] = [ - floating_ip_reference_model - ] - network_interface_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_interface_model_json['floating_ips'] = [floating_ip_reference_model] + network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model_json['name'] = 'my-network-interface' network_interface_model_json['port_speed'] = 1000 network_interface_model_json['primary_ipv4_address'] = '192.168.3.4' network_interface_model_json['resource_type'] = 'network_interface' - network_interface_model_json['security_groups'] = [ - security_group_reference_model - ] + network_interface_model_json['security_groups'] = [security_group_reference_model] network_interface_model_json['status'] = 'available' network_interface_model_json['subnet'] = subnet_reference_model network_interface_model_json['type'] = 'primary' # Construct a model instance of NetworkInterface by calling from_dict on the json representation - network_interface_model = NetworkInterface.from_dict( - network_interface_model_json) + network_interface_model = NetworkInterface.from_dict(network_interface_model_json) assert network_interface_model != False # Construct a model instance of NetworkInterface by calling from_dict on the json representation - network_interface_model_dict = NetworkInterface.from_dict( - network_interface_model_json).__dict__ - network_interface_model2 = NetworkInterface( - **network_interface_model_dict) + network_interface_model_dict = NetworkInterface.from_dict(network_interface_model_json).__dict__ + network_interface_model2 = NetworkInterface(**network_interface_model_dict) # Verify the model instances are equivalent assert network_interface_model == network_interface_model2 @@ -32185,7 +32234,6 @@ def test_network_interface_serialization(self): network_interface_model_json2 = network_interface_model.to_dict() assert network_interface_model_json2 == network_interface_model_json - class TestNetworkInterfaceCollection(): """ Test Class for NetworkInterfaceCollection @@ -32198,111 +32246,81 @@ def test_network_interface_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_collection_first_model = { - } # NetworkInterfaceCollectionFirst - network_interface_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' + network_interface_collection_first_model = {} # NetworkInterfaceCollectionFirst + network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - floating_ip_reference_model = {} # FloatingIPReference + floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'deleted'] = floating_ip_reference_deleted_model - floating_ip_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - network_interface_model = {} # NetworkInterface + network_interface_model = {} # NetworkInterface network_interface_model['allow_ip_spoofing'] = True - network_interface_model['created_at'] = '2020-01-28T18:40:40.123456Z' + network_interface_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_interface_model['floating_ips'] = [floating_ip_reference_model] - network_interface_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model['name'] = 'my-network-interface' network_interface_model['port_speed'] = 1000 network_interface_model['primary_ipv4_address'] = '192.168.3.4' network_interface_model['resource_type'] = 'network_interface' - network_interface_model['security_groups'] = [ - security_group_reference_model - ] + network_interface_model['security_groups'] = [security_group_reference_model] network_interface_model['status'] = 'available' network_interface_model['subnet'] = subnet_reference_model network_interface_model['type'] = 'primary' - network_interface_collection_next_model = { - } # NetworkInterfaceCollectionNext - network_interface_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + network_interface_collection_next_model = {} # NetworkInterfaceCollectionNext + network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' # Construct a json representation of a NetworkInterfaceCollection model network_interface_collection_model_json = {} - network_interface_collection_model_json[ - 'first'] = network_interface_collection_first_model + network_interface_collection_model_json['first'] = network_interface_collection_first_model network_interface_collection_model_json['limit'] = 20 - network_interface_collection_model_json['network_interfaces'] = [ - network_interface_model - ] - network_interface_collection_model_json[ - 'next'] = network_interface_collection_next_model + network_interface_collection_model_json['network_interfaces'] = [network_interface_model] + network_interface_collection_model_json['next'] = network_interface_collection_next_model network_interface_collection_model_json['total_count'] = 132 # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation - network_interface_collection_model = NetworkInterfaceCollection.from_dict( - network_interface_collection_model_json) + network_interface_collection_model = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json) assert network_interface_collection_model != False # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation - network_interface_collection_model_dict = NetworkInterfaceCollection.from_dict( - network_interface_collection_model_json).__dict__ - network_interface_collection_model2 = NetworkInterfaceCollection( - **network_interface_collection_model_dict) + network_interface_collection_model_dict = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json).__dict__ + network_interface_collection_model2 = NetworkInterfaceCollection(**network_interface_collection_model_dict) # Verify the model instances are equivalent assert network_interface_collection_model == network_interface_collection_model2 # Convert model instance back to dict and verify no loss of data - network_interface_collection_model_json2 = network_interface_collection_model.to_dict( - ) + network_interface_collection_model_json2 = network_interface_collection_model.to_dict() assert network_interface_collection_model_json2 == network_interface_collection_model_json - class TestNetworkInterfaceCollectionFirst(): """ Test Class for NetworkInterfaceCollectionFirst @@ -32315,29 +32333,23 @@ def test_network_interface_collection_first_serialization(self): # Construct a json representation of a NetworkInterfaceCollectionFirst model network_interface_collection_first_model_json = {} - network_interface_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' + network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation - network_interface_collection_first_model = NetworkInterfaceCollectionFirst.from_dict( - network_interface_collection_first_model_json) + network_interface_collection_first_model = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json) assert network_interface_collection_first_model != False # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation - network_interface_collection_first_model_dict = NetworkInterfaceCollectionFirst.from_dict( - network_interface_collection_first_model_json).__dict__ - network_interface_collection_first_model2 = NetworkInterfaceCollectionFirst( - **network_interface_collection_first_model_dict) + network_interface_collection_first_model_dict = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json).__dict__ + network_interface_collection_first_model2 = NetworkInterfaceCollectionFirst(**network_interface_collection_first_model_dict) # Verify the model instances are equivalent assert network_interface_collection_first_model == network_interface_collection_first_model2 # Convert model instance back to dict and verify no loss of data - network_interface_collection_first_model_json2 = network_interface_collection_first_model.to_dict( - ) + network_interface_collection_first_model_json2 = network_interface_collection_first_model.to_dict() assert network_interface_collection_first_model_json2 == network_interface_collection_first_model_json - class TestNetworkInterfaceCollectionNext(): """ Test Class for NetworkInterfaceCollectionNext @@ -32350,29 +32362,23 @@ def test_network_interface_collection_next_serialization(self): # Construct a json representation of a NetworkInterfaceCollectionNext model network_interface_collection_next_model_json = {} - network_interface_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation - network_interface_collection_next_model = NetworkInterfaceCollectionNext.from_dict( - network_interface_collection_next_model_json) + network_interface_collection_next_model = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json) assert network_interface_collection_next_model != False # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation - network_interface_collection_next_model_dict = NetworkInterfaceCollectionNext.from_dict( - network_interface_collection_next_model_json).__dict__ - network_interface_collection_next_model2 = NetworkInterfaceCollectionNext( - **network_interface_collection_next_model_dict) + network_interface_collection_next_model_dict = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json).__dict__ + network_interface_collection_next_model2 = NetworkInterfaceCollectionNext(**network_interface_collection_next_model_dict) # Verify the model instances are equivalent assert network_interface_collection_next_model == network_interface_collection_next_model2 # Convert model instance back to dict and verify no loss of data - network_interface_collection_next_model_json2 = network_interface_collection_next_model.to_dict( - ) + network_interface_collection_next_model_json2 = network_interface_collection_next_model.to_dict() assert network_interface_collection_next_model_json2 == network_interface_collection_next_model_json - class TestNetworkInterfaceInstanceContextReference(): """ Test Class for NetworkInterfaceInstanceContextReference @@ -32385,98 +32391,73 @@ def test_network_interface_instance_context_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_instance_context_reference_deleted_model = { - } # NetworkInterfaceInstanceContextReferenceDeleted - network_interface_instance_context_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted + network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a NetworkInterfaceInstanceContextReference model network_interface_instance_context_reference_model_json = {} - network_interface_instance_context_reference_model_json[ - 'deleted'] = network_interface_instance_context_reference_deleted_model - network_interface_instance_context_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model_json[ - 'name'] = 'my-network-interface' - network_interface_instance_context_reference_model_json[ - 'primary_ipv4_address'] = '192.168.3.4' - network_interface_instance_context_reference_model_json[ - 'resource_type'] = 'network_interface' - network_interface_instance_context_reference_model_json[ - 'subnet'] = subnet_reference_model + network_interface_instance_context_reference_model_json['deleted'] = network_interface_instance_context_reference_deleted_model + network_interface_instance_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model_json['name'] = 'my-network-interface' + network_interface_instance_context_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface' + network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation - network_interface_instance_context_reference_model = NetworkInterfaceInstanceContextReference.from_dict( - network_interface_instance_context_reference_model_json) + network_interface_instance_context_reference_model = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json) assert network_interface_instance_context_reference_model != False # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation - network_interface_instance_context_reference_model_dict = NetworkInterfaceInstanceContextReference.from_dict( - network_interface_instance_context_reference_model_json).__dict__ - network_interface_instance_context_reference_model2 = NetworkInterfaceInstanceContextReference( - **network_interface_instance_context_reference_model_dict) + network_interface_instance_context_reference_model_dict = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json).__dict__ + network_interface_instance_context_reference_model2 = NetworkInterfaceInstanceContextReference(**network_interface_instance_context_reference_model_dict) # Verify the model instances are equivalent assert network_interface_instance_context_reference_model == network_interface_instance_context_reference_model2 # Convert model instance back to dict and verify no loss of data - network_interface_instance_context_reference_model_json2 = network_interface_instance_context_reference_model.to_dict( - ) + network_interface_instance_context_reference_model_json2 = network_interface_instance_context_reference_model.to_dict() assert network_interface_instance_context_reference_model_json2 == network_interface_instance_context_reference_model_json - class TestNetworkInterfaceInstanceContextReferenceDeleted(): """ Test Class for NetworkInterfaceInstanceContextReferenceDeleted """ - def test_network_interface_instance_context_reference_deleted_serialization( - self): + def test_network_interface_instance_context_reference_deleted_serialization(self): """ Test serialization/deserialization for NetworkInterfaceInstanceContextReferenceDeleted """ # Construct a json representation of a NetworkInterfaceInstanceContextReferenceDeleted model network_interface_instance_context_reference_deleted_model_json = {} - network_interface_instance_context_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_instance_context_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation - network_interface_instance_context_reference_deleted_model = NetworkInterfaceInstanceContextReferenceDeleted.from_dict( - network_interface_instance_context_reference_deleted_model_json) + network_interface_instance_context_reference_deleted_model = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json) assert network_interface_instance_context_reference_deleted_model != False # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation - network_interface_instance_context_reference_deleted_model_dict = NetworkInterfaceInstanceContextReferenceDeleted.from_dict( - network_interface_instance_context_reference_deleted_model_json - ).__dict__ - network_interface_instance_context_reference_deleted_model2 = NetworkInterfaceInstanceContextReferenceDeleted( - **network_interface_instance_context_reference_deleted_model_dict) + network_interface_instance_context_reference_deleted_model_dict = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json).__dict__ + network_interface_instance_context_reference_deleted_model2 = NetworkInterfaceInstanceContextReferenceDeleted(**network_interface_instance_context_reference_deleted_model_dict) # Verify the model instances are equivalent assert network_interface_instance_context_reference_deleted_model == network_interface_instance_context_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - network_interface_instance_context_reference_deleted_model_json2 = network_interface_instance_context_reference_deleted_model.to_dict( - ) + network_interface_instance_context_reference_deleted_model_json2 = network_interface_instance_context_reference_deleted_model.to_dict() assert network_interface_instance_context_reference_deleted_model_json2 == network_interface_instance_context_reference_deleted_model_json - class TestNetworkInterfacePatch(): """ Test Class for NetworkInterfacePatch @@ -32493,25 +32474,20 @@ def test_network_interface_patch_serialization(self): network_interface_patch_model_json['name'] = 'my-network-interface' # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation - network_interface_patch_model = NetworkInterfacePatch.from_dict( - network_interface_patch_model_json) + network_interface_patch_model = NetworkInterfacePatch.from_dict(network_interface_patch_model_json) assert network_interface_patch_model != False # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation - network_interface_patch_model_dict = NetworkInterfacePatch.from_dict( - network_interface_patch_model_json).__dict__ - network_interface_patch_model2 = NetworkInterfacePatch( - **network_interface_patch_model_dict) + network_interface_patch_model_dict = NetworkInterfacePatch.from_dict(network_interface_patch_model_json).__dict__ + network_interface_patch_model2 = NetworkInterfacePatch(**network_interface_patch_model_dict) # Verify the model instances are equivalent assert network_interface_patch_model == network_interface_patch_model2 # Convert model instance back to dict and verify no loss of data - network_interface_patch_model_json2 = network_interface_patch_model.to_dict( - ) + network_interface_patch_model_json2 = network_interface_patch_model.to_dict() assert network_interface_patch_model_json2 == network_interface_patch_model_json - class TestNetworkInterfacePrototype(): """ Test Class for NetworkInterfacePrototype @@ -32524,44 +32500,35 @@ def test_network_interface_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a json representation of a NetworkInterfacePrototype model network_interface_prototype_model_json = {} network_interface_prototype_model_json['allow_ip_spoofing'] = True network_interface_prototype_model_json['name'] = 'my-network-interface' - network_interface_prototype_model_json[ - 'primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model_json['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model_json['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] network_interface_prototype_model_json['subnet'] = subnet_identity_model # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation - network_interface_prototype_model = NetworkInterfacePrototype.from_dict( - network_interface_prototype_model_json) + network_interface_prototype_model = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json) assert network_interface_prototype_model != False # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation - network_interface_prototype_model_dict = NetworkInterfacePrototype.from_dict( - network_interface_prototype_model_json).__dict__ - network_interface_prototype_model2 = NetworkInterfacePrototype( - **network_interface_prototype_model_dict) + network_interface_prototype_model_dict = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json).__dict__ + network_interface_prototype_model2 = NetworkInterfacePrototype(**network_interface_prototype_model_dict) # Verify the model instances are equivalent assert network_interface_prototype_model == network_interface_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict( - ) + network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict() assert network_interface_prototype_model_json2 == network_interface_prototype_model_json - class TestNetworkInterfaceReference(): """ Test Class for NetworkInterfaceReference @@ -32574,45 +32541,33 @@ def test_network_interface_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a NetworkInterfaceReference model network_interface_reference_model_json = {} - network_interface_reference_model_json[ - 'deleted'] = network_interface_reference_deleted_model - network_interface_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model + network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_reference_model_json['name'] = 'my-network-interface' - network_interface_reference_model_json[ - 'primary_ipv4_address'] = '192.168.3.4' - network_interface_reference_model_json[ - 'resource_type'] = 'network_interface' + network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + network_interface_reference_model_json['resource_type'] = 'network_interface' # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation - network_interface_reference_model = NetworkInterfaceReference.from_dict( - network_interface_reference_model_json) + network_interface_reference_model = NetworkInterfaceReference.from_dict(network_interface_reference_model_json) assert network_interface_reference_model != False # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation - network_interface_reference_model_dict = NetworkInterfaceReference.from_dict( - network_interface_reference_model_json).__dict__ - network_interface_reference_model2 = NetworkInterfaceReference( - **network_interface_reference_model_dict) + network_interface_reference_model_dict = NetworkInterfaceReference.from_dict(network_interface_reference_model_json).__dict__ + network_interface_reference_model2 = NetworkInterfaceReference(**network_interface_reference_model_dict) # Verify the model instances are equivalent assert network_interface_reference_model == network_interface_reference_model2 # Convert model instance back to dict and verify no loss of data - network_interface_reference_model_json2 = network_interface_reference_model.to_dict( - ) + network_interface_reference_model_json2 = network_interface_reference_model.to_dict() assert network_interface_reference_model_json2 == network_interface_reference_model_json - class TestNetworkInterfaceReferenceDeleted(): """ Test Class for NetworkInterfaceReferenceDeleted @@ -32625,66 +32580,52 @@ def test_network_interface_reference_deleted_serialization(self): # Construct a json representation of a NetworkInterfaceReferenceDeleted model network_interface_reference_deleted_model_json = {} - network_interface_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation - network_interface_reference_deleted_model = NetworkInterfaceReferenceDeleted.from_dict( - network_interface_reference_deleted_model_json) + network_interface_reference_deleted_model = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json) assert network_interface_reference_deleted_model != False # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation - network_interface_reference_deleted_model_dict = NetworkInterfaceReferenceDeleted.from_dict( - network_interface_reference_deleted_model_json).__dict__ - network_interface_reference_deleted_model2 = NetworkInterfaceReferenceDeleted( - **network_interface_reference_deleted_model_dict) + network_interface_reference_deleted_model_dict = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json).__dict__ + network_interface_reference_deleted_model2 = NetworkInterfaceReferenceDeleted(**network_interface_reference_deleted_model_dict) # Verify the model instances are equivalent assert network_interface_reference_deleted_model == network_interface_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - network_interface_reference_deleted_model_json2 = network_interface_reference_deleted_model.to_dict( - ) + network_interface_reference_deleted_model_json2 = network_interface_reference_deleted_model.to_dict() assert network_interface_reference_deleted_model_json2 == network_interface_reference_deleted_model_json - class TestNetworkInterfaceReferenceTargetContextDeleted(): """ Test Class for NetworkInterfaceReferenceTargetContextDeleted """ - def test_network_interface_reference_target_context_deleted_serialization( - self): + def test_network_interface_reference_target_context_deleted_serialization(self): """ Test serialization/deserialization for NetworkInterfaceReferenceTargetContextDeleted """ # Construct a json representation of a NetworkInterfaceReferenceTargetContextDeleted model network_interface_reference_target_context_deleted_model_json = {} - network_interface_reference_target_context_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation - network_interface_reference_target_context_deleted_model = NetworkInterfaceReferenceTargetContextDeleted.from_dict( - network_interface_reference_target_context_deleted_model_json) + network_interface_reference_target_context_deleted_model = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json) assert network_interface_reference_target_context_deleted_model != False # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation - network_interface_reference_target_context_deleted_model_dict = NetworkInterfaceReferenceTargetContextDeleted.from_dict( - network_interface_reference_target_context_deleted_model_json - ).__dict__ - network_interface_reference_target_context_deleted_model2 = NetworkInterfaceReferenceTargetContextDeleted( - **network_interface_reference_target_context_deleted_model_dict) + network_interface_reference_target_context_deleted_model_dict = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json).__dict__ + network_interface_reference_target_context_deleted_model2 = NetworkInterfaceReferenceTargetContextDeleted(**network_interface_reference_target_context_deleted_model_dict) # Verify the model instances are equivalent assert network_interface_reference_target_context_deleted_model == network_interface_reference_target_context_deleted_model2 # Convert model instance back to dict and verify no loss of data - network_interface_reference_target_context_deleted_model_json2 = network_interface_reference_target_context_deleted_model.to_dict( - ) + network_interface_reference_target_context_deleted_model_json2 = network_interface_reference_target_context_deleted_model.to_dict() assert network_interface_reference_target_context_deleted_model_json2 == network_interface_reference_target_context_deleted_model_json - class TestNetworkInterfaceUnpaginatedCollection(): """ Test Class for NetworkInterfaceUnpaginatedCollection @@ -32697,94 +32638,71 @@ def test_network_interface_unpaginated_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - floating_ip_reference_model = {} # FloatingIPReference + floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'deleted'] = floating_ip_reference_deleted_model - floating_ip_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - network_interface_model = {} # NetworkInterface + network_interface_model = {} # NetworkInterface network_interface_model['allow_ip_spoofing'] = True - network_interface_model['created_at'] = '2020-01-28T18:40:40.123456Z' + network_interface_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) network_interface_model['floating_ips'] = [floating_ip_reference_model] - network_interface_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model['name'] = 'my-network-interface' network_interface_model['port_speed'] = 1000 network_interface_model['primary_ipv4_address'] = '192.168.3.4' network_interface_model['resource_type'] = 'network_interface' - network_interface_model['security_groups'] = [ - security_group_reference_model - ] + network_interface_model['security_groups'] = [security_group_reference_model] network_interface_model['status'] = 'available' network_interface_model['subnet'] = subnet_reference_model network_interface_model['type'] = 'primary' # Construct a json representation of a NetworkInterfaceUnpaginatedCollection model network_interface_unpaginated_collection_model_json = {} - network_interface_unpaginated_collection_model_json[ - 'network_interfaces'] = [network_interface_model] + network_interface_unpaginated_collection_model_json['network_interfaces'] = [network_interface_model] # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation - network_interface_unpaginated_collection_model = NetworkInterfaceUnpaginatedCollection.from_dict( - network_interface_unpaginated_collection_model_json) + network_interface_unpaginated_collection_model = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json) assert network_interface_unpaginated_collection_model != False # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation - network_interface_unpaginated_collection_model_dict = NetworkInterfaceUnpaginatedCollection.from_dict( - network_interface_unpaginated_collection_model_json).__dict__ - network_interface_unpaginated_collection_model2 = NetworkInterfaceUnpaginatedCollection( - **network_interface_unpaginated_collection_model_dict) + network_interface_unpaginated_collection_model_dict = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json).__dict__ + network_interface_unpaginated_collection_model2 = NetworkInterfaceUnpaginatedCollection(**network_interface_unpaginated_collection_model_dict) # Verify the model instances are equivalent assert network_interface_unpaginated_collection_model == network_interface_unpaginated_collection_model2 # Convert model instance back to dict and verify no loss of data - network_interface_unpaginated_collection_model_json2 = network_interface_unpaginated_collection_model.to_dict( - ) + network_interface_unpaginated_collection_model_json2 = network_interface_unpaginated_collection_model.to_dict() assert network_interface_unpaginated_collection_model_json2 == network_interface_unpaginated_collection_model_json - class TestOperatingSystem(): """ Test Class for OperatingSystem @@ -32798,23 +32716,20 @@ def test_operating_system_serialization(self): # Construct a json representation of a OperatingSystem model operating_system_model_json = {} operating_system_model_json['architecture'] = 'amd64' - operating_system_model_json[ - 'display_name'] = 'Ubuntu Server 16.04 LTS amd64' + operating_system_model_json['dedicated_host_only'] = False + operating_system_model_json['display_name'] = 'Ubuntu Server 16.04 LTS amd64' operating_system_model_json['family'] = 'Ubuntu Server' - operating_system_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' + operating_system_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_model_json['name'] = 'ubuntu-16-amd64' operating_system_model_json['vendor'] = 'Canonical' operating_system_model_json['version'] = '16.04 LTS' # Construct a model instance of OperatingSystem by calling from_dict on the json representation - operating_system_model = OperatingSystem.from_dict( - operating_system_model_json) + operating_system_model = OperatingSystem.from_dict(operating_system_model_json) assert operating_system_model != False # Construct a model instance of OperatingSystem by calling from_dict on the json representation - operating_system_model_dict = OperatingSystem.from_dict( - operating_system_model_json).__dict__ + operating_system_model_dict = OperatingSystem.from_dict(operating_system_model_json).__dict__ operating_system_model2 = OperatingSystem(**operating_system_model_dict) # Verify the model instances are equivalent @@ -32824,7 +32739,6 @@ def test_operating_system_serialization(self): operating_system_model_json2 = operating_system_model.to_dict() assert operating_system_model_json2 == operating_system_model_json - class TestOperatingSystemCollection(): """ Test Class for OperatingSystemCollection @@ -32837,57 +32751,44 @@ def test_operating_system_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - operating_system_collection_first_model = { - } # OperatingSystemCollectionFirst - operating_system_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' + operating_system_collection_first_model = {} # OperatingSystemCollectionFirst + operating_system_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' - operating_system_collection_next_model = { - } # OperatingSystemCollectionNext - operating_system_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + operating_system_collection_next_model = {} # OperatingSystemCollectionNext + operating_system_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - operating_system_model = {} # OperatingSystem + operating_system_model = {} # OperatingSystem operating_system_model['architecture'] = 'amd64' + operating_system_model['dedicated_host_only'] = False operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64' operating_system_model['family'] = 'Ubuntu Server' - operating_system_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' + operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_model['name'] = 'ubuntu-16-amd64' operating_system_model['vendor'] = 'Canonical' operating_system_model['version'] = '16.04 LTS' # Construct a json representation of a OperatingSystemCollection model operating_system_collection_model_json = {} - operating_system_collection_model_json[ - 'first'] = operating_system_collection_first_model + operating_system_collection_model_json['first'] = operating_system_collection_first_model operating_system_collection_model_json['limit'] = 20 - operating_system_collection_model_json[ - 'next'] = operating_system_collection_next_model - operating_system_collection_model_json['operating_systems'] = [ - operating_system_model - ] + operating_system_collection_model_json['next'] = operating_system_collection_next_model + operating_system_collection_model_json['operating_systems'] = [operating_system_model] # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation - operating_system_collection_model = OperatingSystemCollection.from_dict( - operating_system_collection_model_json) + operating_system_collection_model = OperatingSystemCollection.from_dict(operating_system_collection_model_json) assert operating_system_collection_model != False # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation - operating_system_collection_model_dict = OperatingSystemCollection.from_dict( - operating_system_collection_model_json).__dict__ - operating_system_collection_model2 = OperatingSystemCollection( - **operating_system_collection_model_dict) + operating_system_collection_model_dict = OperatingSystemCollection.from_dict(operating_system_collection_model_json).__dict__ + operating_system_collection_model2 = OperatingSystemCollection(**operating_system_collection_model_dict) # Verify the model instances are equivalent assert operating_system_collection_model == operating_system_collection_model2 # Convert model instance back to dict and verify no loss of data - operating_system_collection_model_json2 = operating_system_collection_model.to_dict( - ) + operating_system_collection_model_json2 = operating_system_collection_model.to_dict() assert operating_system_collection_model_json2 == operating_system_collection_model_json - class TestOperatingSystemCollectionFirst(): """ Test Class for OperatingSystemCollectionFirst @@ -32900,29 +32801,23 @@ def test_operating_system_collection_first_serialization(self): # Construct a json representation of a OperatingSystemCollectionFirst model operating_system_collection_first_model_json = {} - operating_system_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' + operating_system_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation - operating_system_collection_first_model = OperatingSystemCollectionFirst.from_dict( - operating_system_collection_first_model_json) + operating_system_collection_first_model = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json) assert operating_system_collection_first_model != False # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation - operating_system_collection_first_model_dict = OperatingSystemCollectionFirst.from_dict( - operating_system_collection_first_model_json).__dict__ - operating_system_collection_first_model2 = OperatingSystemCollectionFirst( - **operating_system_collection_first_model_dict) + operating_system_collection_first_model_dict = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json).__dict__ + operating_system_collection_first_model2 = OperatingSystemCollectionFirst(**operating_system_collection_first_model_dict) # Verify the model instances are equivalent assert operating_system_collection_first_model == operating_system_collection_first_model2 # Convert model instance back to dict and verify no loss of data - operating_system_collection_first_model_json2 = operating_system_collection_first_model.to_dict( - ) + operating_system_collection_first_model_json2 = operating_system_collection_first_model.to_dict() assert operating_system_collection_first_model_json2 == operating_system_collection_first_model_json - class TestOperatingSystemCollectionNext(): """ Test Class for OperatingSystemCollectionNext @@ -32935,29 +32830,23 @@ def test_operating_system_collection_next_serialization(self): # Construct a json representation of a OperatingSystemCollectionNext model operating_system_collection_next_model_json = {} - operating_system_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + operating_system_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation - operating_system_collection_next_model = OperatingSystemCollectionNext.from_dict( - operating_system_collection_next_model_json) + operating_system_collection_next_model = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json) assert operating_system_collection_next_model != False # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation - operating_system_collection_next_model_dict = OperatingSystemCollectionNext.from_dict( - operating_system_collection_next_model_json).__dict__ - operating_system_collection_next_model2 = OperatingSystemCollectionNext( - **operating_system_collection_next_model_dict) + operating_system_collection_next_model_dict = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json).__dict__ + operating_system_collection_next_model2 = OperatingSystemCollectionNext(**operating_system_collection_next_model_dict) # Verify the model instances are equivalent assert operating_system_collection_next_model == operating_system_collection_next_model2 # Convert model instance back to dict and verify no loss of data - operating_system_collection_next_model_json2 = operating_system_collection_next_model.to_dict( - ) + operating_system_collection_next_model_json2 = operating_system_collection_next_model.to_dict() assert operating_system_collection_next_model_json2 == operating_system_collection_next_model_json - class TestPublicGateway(): """ Test Class for PublicGateway @@ -32970,73 +32859,56 @@ def test_public_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp + public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp public_gateway_floating_ip_model['address'] = '203.0.113.1' - public_gateway_floating_ip_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model[ - 'deleted'] = floating_ip_reference_deleted_model - public_gateway_floating_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model + public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' public_gateway_floating_ip_model['name'] = 'my-floating-ip' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a PublicGateway model public_gateway_model_json = {} - public_gateway_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - public_gateway_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_model_json[ - 'floating_ip'] = public_gateway_floating_ip_model - public_gateway_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + public_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_model_json['floating_ip'] = public_gateway_floating_ip_model + public_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_model_json['name'] = 'my-public-gateway' - public_gateway_model_json[ - 'resource_group'] = resource_group_reference_model + public_gateway_model_json['resource_group'] = resource_group_reference_model public_gateway_model_json['resource_type'] = 'public_gateway' public_gateway_model_json['status'] = 'available' public_gateway_model_json['vpc'] = vpc_reference_model public_gateway_model_json['zone'] = zone_reference_model # Construct a model instance of PublicGateway by calling from_dict on the json representation - public_gateway_model = PublicGateway.from_dict( - public_gateway_model_json) + public_gateway_model = PublicGateway.from_dict(public_gateway_model_json) assert public_gateway_model != False # Construct a model instance of PublicGateway by calling from_dict on the json representation - public_gateway_model_dict = PublicGateway.from_dict( - public_gateway_model_json).__dict__ + public_gateway_model_dict = PublicGateway.from_dict(public_gateway_model_json).__dict__ public_gateway_model2 = PublicGateway(**public_gateway_model_dict) # Verify the model instances are equivalent @@ -33046,7 +32918,6 @@ def test_public_gateway_serialization(self): public_gateway_model_json2 = public_gateway_model.to_dict() assert public_gateway_model_json2 == public_gateway_model_json - class TestPublicGatewayCollection(): """ Test Class for PublicGatewayCollection @@ -33059,63 +32930,47 @@ def test_public_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - public_gateway_collection_first_model = { - } # PublicGatewayCollectionFirst - public_gateway_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' + public_gateway_collection_first_model = {} # PublicGatewayCollectionFirst + public_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' - public_gateway_collection_next_model = {} # PublicGatewayCollectionNext - public_gateway_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + public_gateway_collection_next_model = {} # PublicGatewayCollectionNext + public_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp + public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp public_gateway_floating_ip_model['address'] = '203.0.113.1' - public_gateway_floating_ip_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model[ - 'deleted'] = floating_ip_reference_deleted_model - public_gateway_floating_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model + public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' public_gateway_floating_ip_model['name'] = 'my-floating-ip' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - public_gateway_model = {} # PublicGateway - public_gateway_model['created_at'] = '2020-01-28T18:40:40.123456Z' - public_gateway_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_model = {} # PublicGateway + public_gateway_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + public_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_model['floating_ip'] = public_gateway_floating_ip_model - public_gateway_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_model['name'] = 'my-public-gateway' public_gateway_model['resource_group'] = resource_group_reference_model @@ -33126,36 +32981,27 @@ def test_public_gateway_collection_serialization(self): # Construct a json representation of a PublicGatewayCollection model public_gateway_collection_model_json = {} - public_gateway_collection_model_json[ - 'first'] = public_gateway_collection_first_model + public_gateway_collection_model_json['first'] = public_gateway_collection_first_model public_gateway_collection_model_json['limit'] = 20 - public_gateway_collection_model_json[ - 'next'] = public_gateway_collection_next_model - public_gateway_collection_model_json['public_gateways'] = [ - public_gateway_model - ] + public_gateway_collection_model_json['next'] = public_gateway_collection_next_model + public_gateway_collection_model_json['public_gateways'] = [public_gateway_model] public_gateway_collection_model_json['total_count'] = 132 # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation - public_gateway_collection_model = PublicGatewayCollection.from_dict( - public_gateway_collection_model_json) + public_gateway_collection_model = PublicGatewayCollection.from_dict(public_gateway_collection_model_json) assert public_gateway_collection_model != False # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation - public_gateway_collection_model_dict = PublicGatewayCollection.from_dict( - public_gateway_collection_model_json).__dict__ - public_gateway_collection_model2 = PublicGatewayCollection( - **public_gateway_collection_model_dict) + public_gateway_collection_model_dict = PublicGatewayCollection.from_dict(public_gateway_collection_model_json).__dict__ + public_gateway_collection_model2 = PublicGatewayCollection(**public_gateway_collection_model_dict) # Verify the model instances are equivalent assert public_gateway_collection_model == public_gateway_collection_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict( - ) + public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict() assert public_gateway_collection_model_json2 == public_gateway_collection_model_json - class TestPublicGatewayCollectionFirst(): """ Test Class for PublicGatewayCollectionFirst @@ -33168,29 +33014,23 @@ def test_public_gateway_collection_first_serialization(self): # Construct a json representation of a PublicGatewayCollectionFirst model public_gateway_collection_first_model_json = {} - public_gateway_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' + public_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation - public_gateway_collection_first_model = PublicGatewayCollectionFirst.from_dict( - public_gateway_collection_first_model_json) + public_gateway_collection_first_model = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json) assert public_gateway_collection_first_model != False # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation - public_gateway_collection_first_model_dict = PublicGatewayCollectionFirst.from_dict( - public_gateway_collection_first_model_json).__dict__ - public_gateway_collection_first_model2 = PublicGatewayCollectionFirst( - **public_gateway_collection_first_model_dict) + public_gateway_collection_first_model_dict = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json).__dict__ + public_gateway_collection_first_model2 = PublicGatewayCollectionFirst(**public_gateway_collection_first_model_dict) # Verify the model instances are equivalent assert public_gateway_collection_first_model == public_gateway_collection_first_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_collection_first_model_json2 = public_gateway_collection_first_model.to_dict( - ) + public_gateway_collection_first_model_json2 = public_gateway_collection_first_model.to_dict() assert public_gateway_collection_first_model_json2 == public_gateway_collection_first_model_json - class TestPublicGatewayCollectionNext(): """ Test Class for PublicGatewayCollectionNext @@ -33203,29 +33043,23 @@ def test_public_gateway_collection_next_serialization(self): # Construct a json representation of a PublicGatewayCollectionNext model public_gateway_collection_next_model_json = {} - public_gateway_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + public_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation - public_gateway_collection_next_model = PublicGatewayCollectionNext.from_dict( - public_gateway_collection_next_model_json) + public_gateway_collection_next_model = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json) assert public_gateway_collection_next_model != False # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation - public_gateway_collection_next_model_dict = PublicGatewayCollectionNext.from_dict( - public_gateway_collection_next_model_json).__dict__ - public_gateway_collection_next_model2 = PublicGatewayCollectionNext( - **public_gateway_collection_next_model_dict) + public_gateway_collection_next_model_dict = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json).__dict__ + public_gateway_collection_next_model2 = PublicGatewayCollectionNext(**public_gateway_collection_next_model_dict) # Verify the model instances are equivalent assert public_gateway_collection_next_model == public_gateway_collection_next_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_collection_next_model_json2 = public_gateway_collection_next_model.to_dict( - ) + public_gateway_collection_next_model_json2 = public_gateway_collection_next_model.to_dict() assert public_gateway_collection_next_model_json2 == public_gateway_collection_next_model_json - class TestPublicGatewayFloatingIp(): """ Test Class for PublicGatewayFloatingIp @@ -33238,43 +33072,33 @@ def test_public_gateway_floating_ip_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted + floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a PublicGatewayFloatingIp model public_gateway_floating_ip_model_json = {} public_gateway_floating_ip_model_json['address'] = '203.0.113.1' - public_gateway_floating_ip_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model_json[ - 'deleted'] = floating_ip_reference_deleted_model - public_gateway_floating_ip_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model_json[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model_json['deleted'] = floating_ip_reference_deleted_model + public_gateway_floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' public_gateway_floating_ip_model_json['name'] = 'my-floating-ip' # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation - public_gateway_floating_ip_model = PublicGatewayFloatingIp.from_dict( - public_gateway_floating_ip_model_json) + public_gateway_floating_ip_model = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json) assert public_gateway_floating_ip_model != False # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation - public_gateway_floating_ip_model_dict = PublicGatewayFloatingIp.from_dict( - public_gateway_floating_ip_model_json).__dict__ - public_gateway_floating_ip_model2 = PublicGatewayFloatingIp( - **public_gateway_floating_ip_model_dict) + public_gateway_floating_ip_model_dict = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json).__dict__ + public_gateway_floating_ip_model2 = PublicGatewayFloatingIp(**public_gateway_floating_ip_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_model == public_gateway_floating_ip_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_model_json2 = public_gateway_floating_ip_model.to_dict( - ) + public_gateway_floating_ip_model_json2 = public_gateway_floating_ip_model.to_dict() assert public_gateway_floating_ip_model_json2 == public_gateway_floating_ip_model_json - class TestPublicGatewayPatch(): """ Test Class for PublicGatewayPatch @@ -33290,15 +33114,12 @@ def test_public_gateway_patch_serialization(self): public_gateway_patch_model_json['name'] = 'my-public-gateway' # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation - public_gateway_patch_model = PublicGatewayPatch.from_dict( - public_gateway_patch_model_json) + public_gateway_patch_model = PublicGatewayPatch.from_dict(public_gateway_patch_model_json) assert public_gateway_patch_model != False # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation - public_gateway_patch_model_dict = PublicGatewayPatch.from_dict( - public_gateway_patch_model_json).__dict__ - public_gateway_patch_model2 = PublicGatewayPatch( - **public_gateway_patch_model_dict) + public_gateway_patch_model_dict = PublicGatewayPatch.from_dict(public_gateway_patch_model_json).__dict__ + public_gateway_patch_model2 = PublicGatewayPatch(**public_gateway_patch_model_dict) # Verify the model instances are equivalent assert public_gateway_patch_model == public_gateway_patch_model2 @@ -33307,7 +33128,6 @@ def test_public_gateway_patch_serialization(self): public_gateway_patch_model_json2 = public_gateway_patch_model.to_dict() assert public_gateway_patch_model_json2 == public_gateway_patch_model_json - class TestPublicGatewayReference(): """ Test Class for PublicGatewayReference @@ -33320,44 +33140,33 @@ def test_public_gateway_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - public_gateway_reference_deleted_model = { - } # PublicGatewayReferenceDeleted - public_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted + public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a PublicGatewayReference model public_gateway_reference_model_json = {} - public_gateway_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model_json[ - 'deleted'] = public_gateway_reference_deleted_model - public_gateway_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model_json[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model + public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_reference_model_json['name'] = 'my-public-gateway' public_gateway_reference_model_json['resource_type'] = 'public_gateway' # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation - public_gateway_reference_model = PublicGatewayReference.from_dict( - public_gateway_reference_model_json) + public_gateway_reference_model = PublicGatewayReference.from_dict(public_gateway_reference_model_json) assert public_gateway_reference_model != False # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation - public_gateway_reference_model_dict = PublicGatewayReference.from_dict( - public_gateway_reference_model_json).__dict__ - public_gateway_reference_model2 = PublicGatewayReference( - **public_gateway_reference_model_dict) + public_gateway_reference_model_dict = PublicGatewayReference.from_dict(public_gateway_reference_model_json).__dict__ + public_gateway_reference_model2 = PublicGatewayReference(**public_gateway_reference_model_dict) # Verify the model instances are equivalent assert public_gateway_reference_model == public_gateway_reference_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_reference_model_json2 = public_gateway_reference_model.to_dict( - ) + public_gateway_reference_model_json2 = public_gateway_reference_model.to_dict() assert public_gateway_reference_model_json2 == public_gateway_reference_model_json - class TestPublicGatewayReferenceDeleted(): """ Test Class for PublicGatewayReferenceDeleted @@ -33370,29 +33179,23 @@ def test_public_gateway_reference_deleted_serialization(self): # Construct a json representation of a PublicGatewayReferenceDeleted model public_gateway_reference_deleted_model_json = {} - public_gateway_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + public_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation - public_gateway_reference_deleted_model = PublicGatewayReferenceDeleted.from_dict( - public_gateway_reference_deleted_model_json) + public_gateway_reference_deleted_model = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json) assert public_gateway_reference_deleted_model != False # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation - public_gateway_reference_deleted_model_dict = PublicGatewayReferenceDeleted.from_dict( - public_gateway_reference_deleted_model_json).__dict__ - public_gateway_reference_deleted_model2 = PublicGatewayReferenceDeleted( - **public_gateway_reference_deleted_model_dict) + public_gateway_reference_deleted_model_dict = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json).__dict__ + public_gateway_reference_deleted_model2 = PublicGatewayReferenceDeleted(**public_gateway_reference_deleted_model_dict) # Verify the model instances are equivalent assert public_gateway_reference_deleted_model == public_gateway_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_reference_deleted_model_json2 = public_gateway_reference_deleted_model.to_dict( - ) + public_gateway_reference_deleted_model_json2 = public_gateway_reference_deleted_model.to_dict() assert public_gateway_reference_deleted_model_json2 == public_gateway_reference_deleted_model_json - class TestRegion(): """ Test Class for Region @@ -33406,8 +33209,7 @@ def test_region_serialization(self): # Construct a json representation of a Region model region_model_json = {} region_model_json['endpoint'] = 'testString' - region_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_model_json['name'] = 'us-south' region_model_json['status'] = 'available' @@ -33426,7 +33228,6 @@ def test_region_serialization(self): region_model_json2 = region_model.to_dict() assert region_model_json2 == region_model_json - class TestRegionCollection(): """ Test Class for RegionCollection @@ -33439,10 +33240,9 @@ def test_region_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - region_model = {} # Region + region_model = {} # Region region_model['endpoint'] = 'testString' - region_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_model['name'] = 'us-south' region_model['status'] = 'available' @@ -33451,15 +33251,12 @@ def test_region_collection_serialization(self): region_collection_model_json['regions'] = [region_model] # Construct a model instance of RegionCollection by calling from_dict on the json representation - region_collection_model = RegionCollection.from_dict( - region_collection_model_json) + region_collection_model = RegionCollection.from_dict(region_collection_model_json) assert region_collection_model != False # Construct a model instance of RegionCollection by calling from_dict on the json representation - region_collection_model_dict = RegionCollection.from_dict( - region_collection_model_json).__dict__ - region_collection_model2 = RegionCollection( - **region_collection_model_dict) + region_collection_model_dict = RegionCollection.from_dict(region_collection_model_json).__dict__ + region_collection_model2 = RegionCollection(**region_collection_model_dict) # Verify the model instances are equivalent assert region_collection_model == region_collection_model2 @@ -33468,7 +33265,6 @@ def test_region_collection_serialization(self): region_collection_model_json2 = region_collection_model.to_dict() assert region_collection_model_json2 == region_collection_model_json - class TestRegionReference(): """ Test Class for RegionReference @@ -33481,18 +33277,15 @@ def test_region_reference_serialization(self): # Construct a json representation of a RegionReference model region_reference_model_json = {} - region_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_reference_model_json['name'] = 'us-south' # Construct a model instance of RegionReference by calling from_dict on the json representation - region_reference_model = RegionReference.from_dict( - region_reference_model_json) + region_reference_model = RegionReference.from_dict(region_reference_model_json) assert region_reference_model != False # Construct a model instance of RegionReference by calling from_dict on the json representation - region_reference_model_dict = RegionReference.from_dict( - region_reference_model_json).__dict__ + region_reference_model_dict = RegionReference.from_dict(region_reference_model_json).__dict__ region_reference_model2 = RegionReference(**region_reference_model_dict) # Verify the model instances are equivalent @@ -33502,7 +33295,6 @@ def test_region_reference_serialization(self): region_reference_model_json2 = region_reference_model.to_dict() assert region_reference_model_json2 == region_reference_model_json - class TestReservedIP(): """ Test Class for ReservedIP @@ -33515,19 +33307,13 @@ def test_reserved_ip_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - endpoint_gateway_reference_deleted_model = { - } # EndpointGatewayReferenceDeleted - endpoint_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - reserved_ip_target_model = { - } # ReservedIPTargetEndpointGatewayReference - reserved_ip_target_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_model[ - 'deleted'] = endpoint_gateway_reference_deleted_model - reserved_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference + reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['name'] = 'my-endpoint-gateway' reserved_ip_target_model['resource_type'] = 'endpoint_gateway' @@ -33536,9 +33322,8 @@ def test_reserved_ip_serialization(self): reserved_ip_model_json = {} reserved_ip_model_json['address'] = '192.168.3.4' reserved_ip_model_json['auto_delete'] = True - reserved_ip_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - reserved_ip_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + reserved_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model_json['name'] = 'my-reserved-ip' reserved_ip_model_json['owner'] = 'user' @@ -33550,8 +33335,7 @@ def test_reserved_ip_serialization(self): assert reserved_ip_model != False # Construct a model instance of ReservedIP by calling from_dict on the json representation - reserved_ip_model_dict = ReservedIP.from_dict( - reserved_ip_model_json).__dict__ + reserved_ip_model_dict = ReservedIP.from_dict(reserved_ip_model_json).__dict__ reserved_ip_model2 = ReservedIP(**reserved_ip_model_dict) # Verify the model instances are equivalent @@ -33561,7 +33345,6 @@ def test_reserved_ip_serialization(self): reserved_ip_model_json2 = reserved_ip_model.to_dict() assert reserved_ip_model_json2 == reserved_ip_model_json - class TestReservedIPCollection(): """ Test Class for ReservedIPCollection @@ -33574,37 +33357,28 @@ def test_reserved_ip_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_first_model = {} # ReservedIPCollectionFirst - reserved_ip_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' - - reserved_ip_collection_next_model = {} # ReservedIPCollectionNext - reserved_ip_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - endpoint_gateway_reference_deleted_model = { - } # EndpointGatewayReferenceDeleted - endpoint_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - reserved_ip_target_model = { - } # ReservedIPTargetEndpointGatewayReference - reserved_ip_target_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_model[ - 'deleted'] = endpoint_gateway_reference_deleted_model - reserved_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_collection_first_model = {} # ReservedIPCollectionFirst + reserved_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' + + reserved_ip_collection_next_model = {} # ReservedIPCollectionNext + reserved_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference + reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['name'] = 'my-endpoint-gateway' reserved_ip_target_model['resource_type'] = 'endpoint_gateway' - reserved_ip_model = {} # ReservedIP + reserved_ip_model = {} # ReservedIP reserved_ip_model['address'] = '192.168.3.4' reserved_ip_model['auto_delete'] = True - reserved_ip_model['created_at'] = '2020-01-28T18:40:40.123456Z' - reserved_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['name'] = 'my-reserved-ip' reserved_ip_model['owner'] = 'user' @@ -33613,193 +33387,148 @@ def test_reserved_ip_collection_serialization(self): # Construct a json representation of a ReservedIPCollection model reserved_ip_collection_model_json = {} - reserved_ip_collection_model_json[ - 'first'] = reserved_ip_collection_first_model + reserved_ip_collection_model_json['first'] = reserved_ip_collection_first_model reserved_ip_collection_model_json['limit'] = 20 - reserved_ip_collection_model_json[ - 'next'] = reserved_ip_collection_next_model + reserved_ip_collection_model_json['next'] = reserved_ip_collection_next_model reserved_ip_collection_model_json['reserved_ips'] = [reserved_ip_model] reserved_ip_collection_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation - reserved_ip_collection_model = ReservedIPCollection.from_dict( - reserved_ip_collection_model_json) + reserved_ip_collection_model = ReservedIPCollection.from_dict(reserved_ip_collection_model_json) assert reserved_ip_collection_model != False # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation - reserved_ip_collection_model_dict = ReservedIPCollection.from_dict( - reserved_ip_collection_model_json).__dict__ - reserved_ip_collection_model2 = ReservedIPCollection( - **reserved_ip_collection_model_dict) + reserved_ip_collection_model_dict = ReservedIPCollection.from_dict(reserved_ip_collection_model_json).__dict__ + reserved_ip_collection_model2 = ReservedIPCollection(**reserved_ip_collection_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_model == reserved_ip_collection_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_model_json2 = reserved_ip_collection_model.to_dict( - ) + reserved_ip_collection_model_json2 = reserved_ip_collection_model.to_dict() assert reserved_ip_collection_model_json2 == reserved_ip_collection_model_json - class TestReservedIPCollectionEndpointGatewayContext(): """ Test Class for ReservedIPCollectionEndpointGatewayContext """ - def test_reserved_ip_collection_endpoint_gateway_context_serialization( - self): + def test_reserved_ip_collection_endpoint_gateway_context_serialization(self): """ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContext """ # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_endpoint_gateway_context_first_model = { - } # ReservedIPCollectionEndpointGatewayContextFirst - reserved_ip_collection_endpoint_gateway_context_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' - - endpoint_gateway_reference_deleted_model = { - } # EndpointGatewayReferenceDeleted - endpoint_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - reserved_ip_target_model = { - } # ReservedIPTargetEndpointGatewayReference - reserved_ip_target_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_model[ - 'deleted'] = endpoint_gateway_reference_deleted_model - reserved_ip_target_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_collection_endpoint_gateway_context_first_model = {} # ReservedIPCollectionEndpointGatewayContextFirst + reserved_ip_collection_endpoint_gateway_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' + + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference + reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['name'] = 'my-endpoint-gateway' reserved_ip_target_model['resource_type'] = 'endpoint_gateway' - reserved_ip_model = {} # ReservedIP + reserved_ip_model = {} # ReservedIP reserved_ip_model['address'] = '192.168.3.4' reserved_ip_model['auto_delete'] = True - reserved_ip_model['created_at'] = '2020-01-28T18:40:40.123456Z' - reserved_ip_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['name'] = 'my-reserved-ip' reserved_ip_model['owner'] = 'user' reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model - reserved_ip_collection_endpoint_gateway_context_next_model = { - } # ReservedIPCollectionEndpointGatewayContextNext - reserved_ip_collection_endpoint_gateway_context_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' + reserved_ip_collection_endpoint_gateway_context_next_model = {} # ReservedIPCollectionEndpointGatewayContextNext + reserved_ip_collection_endpoint_gateway_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' # Construct a json representation of a ReservedIPCollectionEndpointGatewayContext model reserved_ip_collection_endpoint_gateway_context_model_json = {} - reserved_ip_collection_endpoint_gateway_context_model_json[ - 'first'] = reserved_ip_collection_endpoint_gateway_context_first_model - reserved_ip_collection_endpoint_gateway_context_model_json['ips'] = [ - reserved_ip_model - ] + reserved_ip_collection_endpoint_gateway_context_model_json['first'] = reserved_ip_collection_endpoint_gateway_context_first_model + reserved_ip_collection_endpoint_gateway_context_model_json['ips'] = [reserved_ip_model] reserved_ip_collection_endpoint_gateway_context_model_json['limit'] = 20 - reserved_ip_collection_endpoint_gateway_context_model_json[ - 'next'] = reserved_ip_collection_endpoint_gateway_context_next_model - reserved_ip_collection_endpoint_gateway_context_model_json[ - 'total_count'] = 132 + reserved_ip_collection_endpoint_gateway_context_model_json['next'] = reserved_ip_collection_endpoint_gateway_context_next_model + reserved_ip_collection_endpoint_gateway_context_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_model = ReservedIPCollectionEndpointGatewayContext.from_dict( - reserved_ip_collection_endpoint_gateway_context_model_json) + reserved_ip_collection_endpoint_gateway_context_model = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json) assert reserved_ip_collection_endpoint_gateway_context_model != False # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_model_dict = ReservedIPCollectionEndpointGatewayContext.from_dict( - reserved_ip_collection_endpoint_gateway_context_model_json).__dict__ - reserved_ip_collection_endpoint_gateway_context_model2 = ReservedIPCollectionEndpointGatewayContext( - **reserved_ip_collection_endpoint_gateway_context_model_dict) + reserved_ip_collection_endpoint_gateway_context_model_dict = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json).__dict__ + reserved_ip_collection_endpoint_gateway_context_model2 = ReservedIPCollectionEndpointGatewayContext(**reserved_ip_collection_endpoint_gateway_context_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_endpoint_gateway_context_model == reserved_ip_collection_endpoint_gateway_context_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_endpoint_gateway_context_model_json2 = reserved_ip_collection_endpoint_gateway_context_model.to_dict( - ) + reserved_ip_collection_endpoint_gateway_context_model_json2 = reserved_ip_collection_endpoint_gateway_context_model.to_dict() assert reserved_ip_collection_endpoint_gateway_context_model_json2 == reserved_ip_collection_endpoint_gateway_context_model_json - class TestReservedIPCollectionEndpointGatewayContextFirst(): """ Test Class for ReservedIPCollectionEndpointGatewayContextFirst """ - def test_reserved_ip_collection_endpoint_gateway_context_first_serialization( - self): + def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self): """ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst """ # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextFirst model reserved_ip_collection_endpoint_gateway_context_first_model_json = {} - reserved_ip_collection_endpoint_gateway_context_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' + reserved_ip_collection_endpoint_gateway_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_first_model = ReservedIPCollectionEndpointGatewayContextFirst.from_dict( - reserved_ip_collection_endpoint_gateway_context_first_model_json) + reserved_ip_collection_endpoint_gateway_context_first_model = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json) assert reserved_ip_collection_endpoint_gateway_context_first_model != False # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_first_model_dict = ReservedIPCollectionEndpointGatewayContextFirst.from_dict( - reserved_ip_collection_endpoint_gateway_context_first_model_json - ).__dict__ - reserved_ip_collection_endpoint_gateway_context_first_model2 = ReservedIPCollectionEndpointGatewayContextFirst( - **reserved_ip_collection_endpoint_gateway_context_first_model_dict) + reserved_ip_collection_endpoint_gateway_context_first_model_dict = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json).__dict__ + reserved_ip_collection_endpoint_gateway_context_first_model2 = ReservedIPCollectionEndpointGatewayContextFirst(**reserved_ip_collection_endpoint_gateway_context_first_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_endpoint_gateway_context_first_model == reserved_ip_collection_endpoint_gateway_context_first_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_endpoint_gateway_context_first_model_json2 = reserved_ip_collection_endpoint_gateway_context_first_model.to_dict( - ) + reserved_ip_collection_endpoint_gateway_context_first_model_json2 = reserved_ip_collection_endpoint_gateway_context_first_model.to_dict() assert reserved_ip_collection_endpoint_gateway_context_first_model_json2 == reserved_ip_collection_endpoint_gateway_context_first_model_json - class TestReservedIPCollectionEndpointGatewayContextNext(): """ Test Class for ReservedIPCollectionEndpointGatewayContextNext """ - def test_reserved_ip_collection_endpoint_gateway_context_next_serialization( - self): + def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self): """ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext """ # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextNext model reserved_ip_collection_endpoint_gateway_context_next_model_json = {} - reserved_ip_collection_endpoint_gateway_context_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' + reserved_ip_collection_endpoint_gateway_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_next_model = ReservedIPCollectionEndpointGatewayContextNext.from_dict( - reserved_ip_collection_endpoint_gateway_context_next_model_json) + reserved_ip_collection_endpoint_gateway_context_next_model = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json) assert reserved_ip_collection_endpoint_gateway_context_next_model != False # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_next_model_dict = ReservedIPCollectionEndpointGatewayContextNext.from_dict( - reserved_ip_collection_endpoint_gateway_context_next_model_json - ).__dict__ - reserved_ip_collection_endpoint_gateway_context_next_model2 = ReservedIPCollectionEndpointGatewayContextNext( - **reserved_ip_collection_endpoint_gateway_context_next_model_dict) + reserved_ip_collection_endpoint_gateway_context_next_model_dict = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json).__dict__ + reserved_ip_collection_endpoint_gateway_context_next_model2 = ReservedIPCollectionEndpointGatewayContextNext(**reserved_ip_collection_endpoint_gateway_context_next_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_endpoint_gateway_context_next_model == reserved_ip_collection_endpoint_gateway_context_next_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_endpoint_gateway_context_next_model_json2 = reserved_ip_collection_endpoint_gateway_context_next_model.to_dict( - ) + reserved_ip_collection_endpoint_gateway_context_next_model_json2 = reserved_ip_collection_endpoint_gateway_context_next_model.to_dict() assert reserved_ip_collection_endpoint_gateway_context_next_model_json2 == reserved_ip_collection_endpoint_gateway_context_next_model_json - class TestReservedIPCollectionFirst(): """ Test Class for ReservedIPCollectionFirst @@ -33812,29 +33541,23 @@ def test_reserved_ip_collection_first_serialization(self): # Construct a json representation of a ReservedIPCollectionFirst model reserved_ip_collection_first_model_json = {} - reserved_ip_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' + reserved_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation - reserved_ip_collection_first_model = ReservedIPCollectionFirst.from_dict( - reserved_ip_collection_first_model_json) + reserved_ip_collection_first_model = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json) assert reserved_ip_collection_first_model != False # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation - reserved_ip_collection_first_model_dict = ReservedIPCollectionFirst.from_dict( - reserved_ip_collection_first_model_json).__dict__ - reserved_ip_collection_first_model2 = ReservedIPCollectionFirst( - **reserved_ip_collection_first_model_dict) + reserved_ip_collection_first_model_dict = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json).__dict__ + reserved_ip_collection_first_model2 = ReservedIPCollectionFirst(**reserved_ip_collection_first_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_first_model == reserved_ip_collection_first_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_first_model_json2 = reserved_ip_collection_first_model.to_dict( - ) + reserved_ip_collection_first_model_json2 = reserved_ip_collection_first_model.to_dict() assert reserved_ip_collection_first_model_json2 == reserved_ip_collection_first_model_json - class TestReservedIPCollectionNext(): """ Test Class for ReservedIPCollectionNext @@ -33847,29 +33570,23 @@ def test_reserved_ip_collection_next_serialization(self): # Construct a json representation of a ReservedIPCollectionNext model reserved_ip_collection_next_model_json = {} - reserved_ip_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + reserved_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation - reserved_ip_collection_next_model = ReservedIPCollectionNext.from_dict( - reserved_ip_collection_next_model_json) + reserved_ip_collection_next_model = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json) assert reserved_ip_collection_next_model != False # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation - reserved_ip_collection_next_model_dict = ReservedIPCollectionNext.from_dict( - reserved_ip_collection_next_model_json).__dict__ - reserved_ip_collection_next_model2 = ReservedIPCollectionNext( - **reserved_ip_collection_next_model_dict) + reserved_ip_collection_next_model_dict = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json).__dict__ + reserved_ip_collection_next_model2 = ReservedIPCollectionNext(**reserved_ip_collection_next_model_dict) # Verify the model instances are equivalent assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict( - ) + reserved_ip_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict() assert reserved_ip_collection_next_model_json2 == reserved_ip_collection_next_model_json - class TestReservedIPPatch(): """ Test Class for ReservedIPPatch @@ -33886,15 +33603,12 @@ def test_reserved_ip_patch_serialization(self): reserved_ip_patch_model_json['name'] = 'my-reserved-ip' # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation - reserved_ip_patch_model = ReservedIPPatch.from_dict( - reserved_ip_patch_model_json) + reserved_ip_patch_model = ReservedIPPatch.from_dict(reserved_ip_patch_model_json) assert reserved_ip_patch_model != False # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation - reserved_ip_patch_model_dict = ReservedIPPatch.from_dict( - reserved_ip_patch_model_json).__dict__ - reserved_ip_patch_model2 = ReservedIPPatch( - **reserved_ip_patch_model_dict) + reserved_ip_patch_model_dict = ReservedIPPatch.from_dict(reserved_ip_patch_model_json).__dict__ + reserved_ip_patch_model2 = ReservedIPPatch(**reserved_ip_patch_model_dict) # Verify the model instances are equivalent assert reserved_ip_patch_model == reserved_ip_patch_model2 @@ -33903,7 +33617,6 @@ def test_reserved_ip_patch_serialization(self): reserved_ip_patch_model_json2 = reserved_ip_patch_model.to_dict() assert reserved_ip_patch_model_json2 == reserved_ip_patch_model_json - class TestReservedIPReference(): """ Test Class for ReservedIPReference @@ -33916,41 +33629,33 @@ def test_reserved_ip_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted - reserved_ip_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a ReservedIPReference model reserved_ip_reference_model_json = {} - reserved_ip_reference_model_json[ - 'deleted'] = reserved_ip_reference_deleted_model - reserved_ip_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model_json[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model_json['address'] = '192.168.3.4' + reserved_ip_reference_model_json['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model_json['name'] = 'my-reserved-ip' reserved_ip_reference_model_json['resource_type'] = 'subnet_reserved_ip' # Construct a model instance of ReservedIPReference by calling from_dict on the json representation - reserved_ip_reference_model = ReservedIPReference.from_dict( - reserved_ip_reference_model_json) + reserved_ip_reference_model = ReservedIPReference.from_dict(reserved_ip_reference_model_json) assert reserved_ip_reference_model != False # Construct a model instance of ReservedIPReference by calling from_dict on the json representation - reserved_ip_reference_model_dict = ReservedIPReference.from_dict( - reserved_ip_reference_model_json).__dict__ - reserved_ip_reference_model2 = ReservedIPReference( - **reserved_ip_reference_model_dict) + reserved_ip_reference_model_dict = ReservedIPReference.from_dict(reserved_ip_reference_model_json).__dict__ + reserved_ip_reference_model2 = ReservedIPReference(**reserved_ip_reference_model_dict) # Verify the model instances are equivalent assert reserved_ip_reference_model == reserved_ip_reference_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_reference_model_json2 = reserved_ip_reference_model.to_dict( - ) + reserved_ip_reference_model_json2 = reserved_ip_reference_model.to_dict() assert reserved_ip_reference_model_json2 == reserved_ip_reference_model_json - class TestReservedIPReferenceDeleted(): """ Test Class for ReservedIPReferenceDeleted @@ -33963,29 +33668,23 @@ def test_reserved_ip_reference_deleted_serialization(self): # Construct a json representation of a ReservedIPReferenceDeleted model reserved_ip_reference_deleted_model_json = {} - reserved_ip_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation - reserved_ip_reference_deleted_model = ReservedIPReferenceDeleted.from_dict( - reserved_ip_reference_deleted_model_json) + reserved_ip_reference_deleted_model = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json) assert reserved_ip_reference_deleted_model != False # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation - reserved_ip_reference_deleted_model_dict = ReservedIPReferenceDeleted.from_dict( - reserved_ip_reference_deleted_model_json).__dict__ - reserved_ip_reference_deleted_model2 = ReservedIPReferenceDeleted( - **reserved_ip_reference_deleted_model_dict) + reserved_ip_reference_deleted_model_dict = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json).__dict__ + reserved_ip_reference_deleted_model2 = ReservedIPReferenceDeleted(**reserved_ip_reference_deleted_model_dict) # Verify the model instances are equivalent assert reserved_ip_reference_deleted_model == reserved_ip_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_reference_deleted_model_json2 = reserved_ip_reference_deleted_model.to_dict( - ) + reserved_ip_reference_deleted_model_json2 = reserved_ip_reference_deleted_model.to_dict() assert reserved_ip_reference_deleted_model_json2 == reserved_ip_reference_deleted_model_json - class TestResourceGroupReference(): """ Test Class for ResourceGroupReference @@ -33998,32 +33697,25 @@ def test_resource_group_reference_serialization(self): # Construct a json representation of a ResourceGroupReference model resource_group_reference_model_json = {} - resource_group_reference_model_json[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model_json[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model_json['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model_json['name'] = 'my-resource-group' # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation - resource_group_reference_model = ResourceGroupReference.from_dict( - resource_group_reference_model_json) + resource_group_reference_model = ResourceGroupReference.from_dict(resource_group_reference_model_json) assert resource_group_reference_model != False # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation - resource_group_reference_model_dict = ResourceGroupReference.from_dict( - resource_group_reference_model_json).__dict__ - resource_group_reference_model2 = ResourceGroupReference( - **resource_group_reference_model_dict) + resource_group_reference_model_dict = ResourceGroupReference.from_dict(resource_group_reference_model_json).__dict__ + resource_group_reference_model2 = ResourceGroupReference(**resource_group_reference_model_dict) # Verify the model instances are equivalent assert resource_group_reference_model == resource_group_reference_model2 # Convert model instance back to dict and verify no loss of data - resource_group_reference_model_json2 = resource_group_reference_model.to_dict( - ) + resource_group_reference_model_json2 = resource_group_reference_model.to_dict() assert resource_group_reference_model_json2 == resource_group_reference_model_json - class TestRoute(): """ Test Class for Route @@ -34036,20 +33728,18 @@ def test_route_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_next_hop_model = {} # RouteNextHopIP + route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a Route model route_model_json = {} - route_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' + route_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) route_model_json['destination'] = '192.168.3.0/24' - route_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model_json['lifecycle_state'] = 'stable' route_model_json['name'] = 'my-route-1' @@ -34071,7 +33761,6 @@ def test_route_serialization(self): route_model_json2 = route_model.to_dict() assert route_model_json2 == route_model_json - class TestRouteCollection(): """ Test Class for RouteCollection @@ -34084,27 +33773,23 @@ def test_route_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_collection_first_model = {} # RouteCollectionFirst - route_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' + route_collection_first_model = {} # RouteCollectionFirst + route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' - route_collection_next_model = {} # RouteCollectionNext - route_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + route_collection_next_model = {} # RouteCollectionNext + route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - route_next_hop_model = {} # RouteNextHopIP + route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - route_model = {} # Route - route_model['created_at'] = '2020-01-28T18:40:40.123456Z' + route_model = {} # Route + route_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) route_model['destination'] = '192.168.3.0/24' - route_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model['lifecycle_state'] = 'stable' route_model['name'] = 'my-route-1' @@ -34120,13 +33805,11 @@ def test_route_collection_serialization(self): route_collection_model_json['total_count'] = 132 # Construct a model instance of RouteCollection by calling from_dict on the json representation - route_collection_model = RouteCollection.from_dict( - route_collection_model_json) + route_collection_model = RouteCollection.from_dict(route_collection_model_json) assert route_collection_model != False # Construct a model instance of RouteCollection by calling from_dict on the json representation - route_collection_model_dict = RouteCollection.from_dict( - route_collection_model_json).__dict__ + route_collection_model_dict = RouteCollection.from_dict(route_collection_model_json).__dict__ route_collection_model2 = RouteCollection(**route_collection_model_dict) # Verify the model instances are equivalent @@ -34136,7 +33819,6 @@ def test_route_collection_serialization(self): route_collection_model_json2 = route_collection_model.to_dict() assert route_collection_model_json2 == route_collection_model_json - class TestRouteCollectionFirst(): """ Test Class for RouteCollectionFirst @@ -34149,29 +33831,23 @@ def test_route_collection_first_serialization(self): # Construct a json representation of a RouteCollectionFirst model route_collection_first_model_json = {} - route_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' + route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation - route_collection_first_model = RouteCollectionFirst.from_dict( - route_collection_first_model_json) + route_collection_first_model = RouteCollectionFirst.from_dict(route_collection_first_model_json) assert route_collection_first_model != False # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation - route_collection_first_model_dict = RouteCollectionFirst.from_dict( - route_collection_first_model_json).__dict__ - route_collection_first_model2 = RouteCollectionFirst( - **route_collection_first_model_dict) + route_collection_first_model_dict = RouteCollectionFirst.from_dict(route_collection_first_model_json).__dict__ + route_collection_first_model2 = RouteCollectionFirst(**route_collection_first_model_dict) # Verify the model instances are equivalent assert route_collection_first_model == route_collection_first_model2 # Convert model instance back to dict and verify no loss of data - route_collection_first_model_json2 = route_collection_first_model.to_dict( - ) + route_collection_first_model_json2 = route_collection_first_model.to_dict() assert route_collection_first_model_json2 == route_collection_first_model_json - class TestRouteCollectionNext(): """ Test Class for RouteCollectionNext @@ -34184,29 +33860,23 @@ def test_route_collection_next_serialization(self): # Construct a json representation of a RouteCollectionNext model route_collection_next_model_json = {} - route_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation - route_collection_next_model = RouteCollectionNext.from_dict( - route_collection_next_model_json) + route_collection_next_model = RouteCollectionNext.from_dict(route_collection_next_model_json) assert route_collection_next_model != False # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation - route_collection_next_model_dict = RouteCollectionNext.from_dict( - route_collection_next_model_json).__dict__ - route_collection_next_model2 = RouteCollectionNext( - **route_collection_next_model_dict) + route_collection_next_model_dict = RouteCollectionNext.from_dict(route_collection_next_model_json).__dict__ + route_collection_next_model2 = RouteCollectionNext(**route_collection_next_model_dict) # Verify the model instances are equivalent assert route_collection_next_model == route_collection_next_model2 # Convert model instance back to dict and verify no loss of data - route_collection_next_model_json2 = route_collection_next_model.to_dict( - ) + route_collection_next_model_json2 = route_collection_next_model.to_dict() assert route_collection_next_model_json2 == route_collection_next_model_json - class TestRoutePatch(): """ Test Class for RoutePatch @@ -34226,8 +33896,7 @@ def test_route_patch_serialization(self): assert route_patch_model != False # Construct a model instance of RoutePatch by calling from_dict on the json representation - route_patch_model_dict = RoutePatch.from_dict( - route_patch_model_json).__dict__ + route_patch_model_dict = RoutePatch.from_dict(route_patch_model_json).__dict__ route_patch_model2 = RoutePatch(**route_patch_model_dict) # Verify the model instances are equivalent @@ -34237,7 +33906,6 @@ def test_route_patch_serialization(self): route_patch_model_json2 = route_patch_model.to_dict() assert route_patch_model_json2 == route_patch_model_json - class TestRoutePrototype(): """ Test Class for RoutePrototype @@ -34250,11 +33918,10 @@ def test_route_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_next_hop_prototype_model = { - } # RouteNextHopPrototypeRouteNextHopIP + route_next_hop_prototype_model = {} # RouteNextHopPrototypeRouteNextHopIP route_next_hop_prototype_model['address'] = '192.168.3.4' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a RoutePrototype model @@ -34266,13 +33933,11 @@ def test_route_prototype_serialization(self): route_prototype_model_json['zone'] = zone_identity_model # Construct a model instance of RoutePrototype by calling from_dict on the json representation - route_prototype_model = RoutePrototype.from_dict( - route_prototype_model_json) + route_prototype_model = RoutePrototype.from_dict(route_prototype_model_json) assert route_prototype_model != False # Construct a model instance of RoutePrototype by calling from_dict on the json representation - route_prototype_model_dict = RoutePrototype.from_dict( - route_prototype_model_json).__dict__ + route_prototype_model_dict = RoutePrototype.from_dict(route_prototype_model_json).__dict__ route_prototype_model2 = RoutePrototype(**route_prototype_model_dict) # Verify the model instances are equivalent @@ -34282,7 +33947,6 @@ def test_route_prototype_serialization(self): route_prototype_model_json2 = route_prototype_model.to_dict() assert route_prototype_model_json2 == route_prototype_model_json - class TestRouteReference(): """ Test Class for RouteReference @@ -34295,27 +33959,22 @@ def test_route_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_reference_deleted_model = {} # RouteReferenceDeleted - route_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + route_reference_deleted_model = {} # RouteReferenceDeleted + route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a RouteReference model route_reference_model_json = {} route_reference_model_json['deleted'] = route_reference_deleted_model - route_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - route_reference_model_json[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model_json['name'] = 'my-route-1' # Construct a model instance of RouteReference by calling from_dict on the json representation - route_reference_model = RouteReference.from_dict( - route_reference_model_json) + route_reference_model = RouteReference.from_dict(route_reference_model_json) assert route_reference_model != False # Construct a model instance of RouteReference by calling from_dict on the json representation - route_reference_model_dict = RouteReference.from_dict( - route_reference_model_json).__dict__ + route_reference_model_dict = RouteReference.from_dict(route_reference_model_json).__dict__ route_reference_model2 = RouteReference(**route_reference_model_dict) # Verify the model instances are equivalent @@ -34325,7 +33984,6 @@ def test_route_reference_serialization(self): route_reference_model_json2 = route_reference_model.to_dict() assert route_reference_model_json2 == route_reference_model_json - class TestRouteReferenceDeleted(): """ Test Class for RouteReferenceDeleted @@ -34338,29 +33996,23 @@ def test_route_reference_deleted_serialization(self): # Construct a json representation of a RouteReferenceDeleted model route_reference_deleted_model_json = {} - route_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + route_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation - route_reference_deleted_model = RouteReferenceDeleted.from_dict( - route_reference_deleted_model_json) + route_reference_deleted_model = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json) assert route_reference_deleted_model != False # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation - route_reference_deleted_model_dict = RouteReferenceDeleted.from_dict( - route_reference_deleted_model_json).__dict__ - route_reference_deleted_model2 = RouteReferenceDeleted( - **route_reference_deleted_model_dict) + route_reference_deleted_model_dict = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json).__dict__ + route_reference_deleted_model2 = RouteReferenceDeleted(**route_reference_deleted_model_dict) # Verify the model instances are equivalent assert route_reference_deleted_model == route_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - route_reference_deleted_model_json2 = route_reference_deleted_model.to_dict( - ) + route_reference_deleted_model_json2 = route_reference_deleted_model.to_dict() assert route_reference_deleted_model_json2 == route_reference_deleted_model_json - class TestRoutingTable(): """ Test Class for RoutingTable @@ -34373,35 +34025,29 @@ def test_routing_table_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_reference_deleted_model = {} # RouteReferenceDeleted - route_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + route_reference_deleted_model = {} # RouteReferenceDeleted + route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - route_reference_model = {} # RouteReference + route_reference_model = {} # RouteReference route_reference_model['deleted'] = route_reference_deleted_model - route_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['name'] = 'my-route-1' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a RoutingTable model routing_table_model_json = {} - routing_table_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - routing_table_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_model_json['is_default'] = True routing_table_model_json['lifecycle_state'] = 'stable' @@ -34418,8 +34064,7 @@ def test_routing_table_serialization(self): assert routing_table_model != False # Construct a model instance of RoutingTable by calling from_dict on the json representation - routing_table_model_dict = RoutingTable.from_dict( - routing_table_model_json).__dict__ + routing_table_model_dict = RoutingTable.from_dict(routing_table_model_json).__dict__ routing_table_model2 = RoutingTable(**routing_table_model_dict) # Verify the model instances are equivalent @@ -34429,7 +34074,6 @@ def test_routing_table_serialization(self): routing_table_model_json2 = routing_table_model.to_dict() assert routing_table_model_json2 == routing_table_model_json - class TestRoutingTableCollection(): """ Test Class for RoutingTableCollection @@ -34442,42 +34086,34 @@ def test_routing_table_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - routing_table_collection_first_model = {} # RoutingTableCollectionFirst - routing_table_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20' + routing_table_collection_first_model = {} # RoutingTableCollectionFirst + routing_table_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20' - routing_table_collection_next_model = {} # RoutingTableCollectionNext - routing_table_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + routing_table_collection_next_model = {} # RoutingTableCollectionNext + routing_table_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - route_reference_deleted_model = {} # RouteReferenceDeleted - route_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + route_reference_deleted_model = {} # RouteReferenceDeleted + route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - route_reference_model = {} # RouteReference + route_reference_model = {} # RouteReference route_reference_model['deleted'] = route_reference_deleted_model - route_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_reference_model['name'] = 'my-route-1' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - routing_table_model = {} # RoutingTable - routing_table_model['created_at'] = '2020-01-28T18:40:40.123456Z' - routing_table_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_model = {} # RoutingTable + routing_table_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + routing_table_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' routing_table_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_model['is_default'] = True routing_table_model['lifecycle_state'] = 'stable' @@ -34491,36 +34127,27 @@ def test_routing_table_collection_serialization(self): # Construct a json representation of a RoutingTableCollection model routing_table_collection_model_json = {} - routing_table_collection_model_json[ - 'first'] = routing_table_collection_first_model + routing_table_collection_model_json['first'] = routing_table_collection_first_model routing_table_collection_model_json['limit'] = 20 - routing_table_collection_model_json[ - 'next'] = routing_table_collection_next_model - routing_table_collection_model_json['routing_tables'] = [ - routing_table_model - ] + routing_table_collection_model_json['next'] = routing_table_collection_next_model + routing_table_collection_model_json['routing_tables'] = [routing_table_model] routing_table_collection_model_json['total_count'] = 132 # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation - routing_table_collection_model = RoutingTableCollection.from_dict( - routing_table_collection_model_json) + routing_table_collection_model = RoutingTableCollection.from_dict(routing_table_collection_model_json) assert routing_table_collection_model != False # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation - routing_table_collection_model_dict = RoutingTableCollection.from_dict( - routing_table_collection_model_json).__dict__ - routing_table_collection_model2 = RoutingTableCollection( - **routing_table_collection_model_dict) + routing_table_collection_model_dict = RoutingTableCollection.from_dict(routing_table_collection_model_json).__dict__ + routing_table_collection_model2 = RoutingTableCollection(**routing_table_collection_model_dict) # Verify the model instances are equivalent assert routing_table_collection_model == routing_table_collection_model2 # Convert model instance back to dict and verify no loss of data - routing_table_collection_model_json2 = routing_table_collection_model.to_dict( - ) + routing_table_collection_model_json2 = routing_table_collection_model.to_dict() assert routing_table_collection_model_json2 == routing_table_collection_model_json - class TestRoutingTableCollectionFirst(): """ Test Class for RoutingTableCollectionFirst @@ -34533,29 +34160,23 @@ def test_routing_table_collection_first_serialization(self): # Construct a json representation of a RoutingTableCollectionFirst model routing_table_collection_first_model_json = {} - routing_table_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20' + routing_table_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20' # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation - routing_table_collection_first_model = RoutingTableCollectionFirst.from_dict( - routing_table_collection_first_model_json) + routing_table_collection_first_model = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json) assert routing_table_collection_first_model != False # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation - routing_table_collection_first_model_dict = RoutingTableCollectionFirst.from_dict( - routing_table_collection_first_model_json).__dict__ - routing_table_collection_first_model2 = RoutingTableCollectionFirst( - **routing_table_collection_first_model_dict) + routing_table_collection_first_model_dict = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json).__dict__ + routing_table_collection_first_model2 = RoutingTableCollectionFirst(**routing_table_collection_first_model_dict) # Verify the model instances are equivalent assert routing_table_collection_first_model == routing_table_collection_first_model2 # Convert model instance back to dict and verify no loss of data - routing_table_collection_first_model_json2 = routing_table_collection_first_model.to_dict( - ) + routing_table_collection_first_model_json2 = routing_table_collection_first_model.to_dict() assert routing_table_collection_first_model_json2 == routing_table_collection_first_model_json - class TestRoutingTableCollectionNext(): """ Test Class for RoutingTableCollectionNext @@ -34568,29 +34189,23 @@ def test_routing_table_collection_next_serialization(self): # Construct a json representation of a RoutingTableCollectionNext model routing_table_collection_next_model_json = {} - routing_table_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + routing_table_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation - routing_table_collection_next_model = RoutingTableCollectionNext.from_dict( - routing_table_collection_next_model_json) + routing_table_collection_next_model = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json) assert routing_table_collection_next_model != False # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation - routing_table_collection_next_model_dict = RoutingTableCollectionNext.from_dict( - routing_table_collection_next_model_json).__dict__ - routing_table_collection_next_model2 = RoutingTableCollectionNext( - **routing_table_collection_next_model_dict) + routing_table_collection_next_model_dict = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json).__dict__ + routing_table_collection_next_model2 = RoutingTableCollectionNext(**routing_table_collection_next_model_dict) # Verify the model instances are equivalent assert routing_table_collection_next_model == routing_table_collection_next_model2 # Convert model instance back to dict and verify no loss of data - routing_table_collection_next_model_json2 = routing_table_collection_next_model.to_dict( - ) + routing_table_collection_next_model_json2 = routing_table_collection_next_model.to_dict() assert routing_table_collection_next_model_json2 == routing_table_collection_next_model_json - class TestRoutingTablePatch(): """ Test Class for RoutingTablePatch @@ -34609,15 +34224,12 @@ def test_routing_table_patch_serialization(self): routing_table_patch_model_json['route_vpc_zone_ingress'] = True # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation - routing_table_patch_model = RoutingTablePatch.from_dict( - routing_table_patch_model_json) + routing_table_patch_model = RoutingTablePatch.from_dict(routing_table_patch_model_json) assert routing_table_patch_model != False # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation - routing_table_patch_model_dict = RoutingTablePatch.from_dict( - routing_table_patch_model_json).__dict__ - routing_table_patch_model2 = RoutingTablePatch( - **routing_table_patch_model_dict) + routing_table_patch_model_dict = RoutingTablePatch.from_dict(routing_table_patch_model_json).__dict__ + routing_table_patch_model2 = RoutingTablePatch(**routing_table_patch_model_dict) # Verify the model instances are equivalent assert routing_table_patch_model == routing_table_patch_model2 @@ -34626,7 +34238,6 @@ def test_routing_table_patch_serialization(self): routing_table_patch_model_json2 = routing_table_patch_model.to_dict() assert routing_table_patch_model_json2 == routing_table_patch_model_json - class TestRoutingTableReference(): """ Test Class for RoutingTableReference @@ -34639,42 +34250,32 @@ def test_routing_table_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - routing_table_reference_deleted_model = { - } # RoutingTableReferenceDeleted - routing_table_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted + routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a RoutingTableReference model routing_table_reference_model_json = {} - routing_table_reference_model_json[ - 'deleted'] = routing_table_reference_deleted_model - routing_table_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - routing_table_reference_model_json[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_reference_model_json['deleted'] = routing_table_reference_deleted_model + routing_table_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_reference_model_json['name'] = 'my-routing-table-1' routing_table_reference_model_json['resource_type'] = 'routing_table' # Construct a model instance of RoutingTableReference by calling from_dict on the json representation - routing_table_reference_model = RoutingTableReference.from_dict( - routing_table_reference_model_json) + routing_table_reference_model = RoutingTableReference.from_dict(routing_table_reference_model_json) assert routing_table_reference_model != False # Construct a model instance of RoutingTableReference by calling from_dict on the json representation - routing_table_reference_model_dict = RoutingTableReference.from_dict( - routing_table_reference_model_json).__dict__ - routing_table_reference_model2 = RoutingTableReference( - **routing_table_reference_model_dict) + routing_table_reference_model_dict = RoutingTableReference.from_dict(routing_table_reference_model_json).__dict__ + routing_table_reference_model2 = RoutingTableReference(**routing_table_reference_model_dict) # Verify the model instances are equivalent assert routing_table_reference_model == routing_table_reference_model2 # Convert model instance back to dict and verify no loss of data - routing_table_reference_model_json2 = routing_table_reference_model.to_dict( - ) + routing_table_reference_model_json2 = routing_table_reference_model.to_dict() assert routing_table_reference_model_json2 == routing_table_reference_model_json - class TestRoutingTableReferenceDeleted(): """ Test Class for RoutingTableReferenceDeleted @@ -34687,29 +34288,23 @@ def test_routing_table_reference_deleted_serialization(self): # Construct a json representation of a RoutingTableReferenceDeleted model routing_table_reference_deleted_model_json = {} - routing_table_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + routing_table_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation - routing_table_reference_deleted_model = RoutingTableReferenceDeleted.from_dict( - routing_table_reference_deleted_model_json) + routing_table_reference_deleted_model = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json) assert routing_table_reference_deleted_model != False # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation - routing_table_reference_deleted_model_dict = RoutingTableReferenceDeleted.from_dict( - routing_table_reference_deleted_model_json).__dict__ - routing_table_reference_deleted_model2 = RoutingTableReferenceDeleted( - **routing_table_reference_deleted_model_dict) + routing_table_reference_deleted_model_dict = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json).__dict__ + routing_table_reference_deleted_model2 = RoutingTableReferenceDeleted(**routing_table_reference_deleted_model_dict) # Verify the model instances are equivalent assert routing_table_reference_deleted_model == routing_table_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - routing_table_reference_deleted_model_json2 = routing_table_reference_deleted_model.to_dict( - ) + routing_table_reference_deleted_model_json2 = routing_table_reference_deleted_model.to_dict() assert routing_table_reference_deleted_model_json2 == routing_table_reference_deleted_model_json - class TestSecurityGroup(): """ Test Class for SecurityGroup @@ -34722,38 +34317,28 @@ def test_security_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_interface_reference_model = {} # NetworkInterfaceReference - network_interface_reference_model[ - 'deleted'] = network_interface_reference_deleted_model - network_interface_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_interface_reference_model = {} # NetworkInterfaceReference + network_interface_reference_model['deleted'] = network_interface_reference_deleted_model + network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_reference_model['name'] = 'my-network-interface' - network_interface_reference_model[ - 'primary_ipv4_address'] = '192.168.3.4' + network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4' network_interface_reference_model['resource_type'] = 'network_interface' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' - security_group_rule_model = { - } # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['remote'] = security_group_rule_remote_model @@ -34761,64 +34346,45 @@ def test_security_group_serialization(self): security_group_rule_model['port_min'] = 22 security_group_rule_model['protocol'] = 'udp' - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_target_reference_model = { - } # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext - security_group_target_reference_model[ - 'deleted'] = network_interface_reference_target_context_deleted_model - security_group_target_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext + security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['name'] = 'my-network-interface' - security_group_target_reference_model[ - 'resource_type'] = 'network_interface' + security_group_target_reference_model['resource_type'] = 'network_interface' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' # Construct a json representation of a SecurityGroup model security_group_model_json = {} - security_group_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - security_group_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model_json['name'] = 'my-security-group' - security_group_model_json['network_interfaces'] = [ - network_interface_reference_model - ] - security_group_model_json[ - 'resource_group'] = resource_group_reference_model + security_group_model_json['network_interfaces'] = [network_interface_reference_model] + security_group_model_json['resource_group'] = resource_group_reference_model security_group_model_json['rules'] = [security_group_rule_model] - security_group_model_json['targets'] = [ - security_group_target_reference_model - ] + security_group_model_json['targets'] = [security_group_target_reference_model] security_group_model_json['vpc'] = vpc_reference_model # Construct a model instance of SecurityGroup by calling from_dict on the json representation - security_group_model = SecurityGroup.from_dict( - security_group_model_json) + security_group_model = SecurityGroup.from_dict(security_group_model_json) assert security_group_model != False # Construct a model instance of SecurityGroup by calling from_dict on the json representation - security_group_model_dict = SecurityGroup.from_dict( - security_group_model_json).__dict__ + security_group_model_dict = SecurityGroup.from_dict(security_group_model_json).__dict__ security_group_model2 = SecurityGroup(**security_group_model_dict) # Verify the model instances are equivalent @@ -34828,7 +34394,6 @@ def test_security_group_serialization(self): security_group_model_json2 = security_group_model.to_dict() assert security_group_model_json2 == security_group_model_json - class TestSecurityGroupCollection(): """ Test Class for SecurityGroupCollection @@ -34841,47 +34406,34 @@ def test_security_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_collection_first_model = { - } # SecurityGroupCollectionFirst - security_group_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' - - security_group_collection_next_model = {} # SecurityGroupCollectionNext - security_group_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_interface_reference_model = {} # NetworkInterfaceReference - network_interface_reference_model[ - 'deleted'] = network_interface_reference_deleted_model - network_interface_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_collection_first_model = {} # SecurityGroupCollectionFirst + security_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' + + security_group_collection_next_model = {} # SecurityGroupCollectionNext + security_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_interface_reference_model = {} # NetworkInterfaceReference + network_interface_reference_model['deleted'] = network_interface_reference_deleted_model + network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_reference_model['name'] = 'my-network-interface' - network_interface_reference_model[ - 'primary_ipv4_address'] = '192.168.3.4' + network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4' network_interface_reference_model['resource_type'] = 'network_interface' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' - security_group_rule_model = { - } # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['remote'] = security_group_rule_remote_model @@ -34889,86 +34441,61 @@ def test_security_group_collection_serialization(self): security_group_rule_model['port_min'] = 22 security_group_rule_model['protocol'] = 'udp' - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_target_reference_model = { - } # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext - security_group_target_reference_model[ - 'deleted'] = network_interface_reference_target_context_deleted_model - security_group_target_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext + security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['name'] = 'my-network-interface' - security_group_target_reference_model[ - 'resource_type'] = 'network_interface' + security_group_target_reference_model['resource_type'] = 'network_interface' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - security_group_model = {} # SecurityGroup - security_group_model['created_at'] = '2020-01-28T18:40:40.123456Z' - security_group_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_model = {} # SecurityGroup + security_group_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + security_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['name'] = 'my-security-group' - security_group_model['network_interfaces'] = [ - network_interface_reference_model - ] + security_group_model['network_interfaces'] = [network_interface_reference_model] security_group_model['resource_group'] = resource_group_reference_model security_group_model['rules'] = [security_group_rule_model] - security_group_model['targets'] = [ - security_group_target_reference_model - ] + security_group_model['targets'] = [security_group_target_reference_model] security_group_model['vpc'] = vpc_reference_model # Construct a json representation of a SecurityGroupCollection model security_group_collection_model_json = {} - security_group_collection_model_json[ - 'first'] = security_group_collection_first_model + security_group_collection_model_json['first'] = security_group_collection_first_model security_group_collection_model_json['limit'] = 20 - security_group_collection_model_json[ - 'next'] = security_group_collection_next_model - security_group_collection_model_json['security_groups'] = [ - security_group_model - ] + security_group_collection_model_json['next'] = security_group_collection_next_model + security_group_collection_model_json['security_groups'] = [security_group_model] security_group_collection_model_json['total_count'] = 132 # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation - security_group_collection_model = SecurityGroupCollection.from_dict( - security_group_collection_model_json) + security_group_collection_model = SecurityGroupCollection.from_dict(security_group_collection_model_json) assert security_group_collection_model != False # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation - security_group_collection_model_dict = SecurityGroupCollection.from_dict( - security_group_collection_model_json).__dict__ - security_group_collection_model2 = SecurityGroupCollection( - **security_group_collection_model_dict) + security_group_collection_model_dict = SecurityGroupCollection.from_dict(security_group_collection_model_json).__dict__ + security_group_collection_model2 = SecurityGroupCollection(**security_group_collection_model_dict) # Verify the model instances are equivalent assert security_group_collection_model == security_group_collection_model2 # Convert model instance back to dict and verify no loss of data - security_group_collection_model_json2 = security_group_collection_model.to_dict( - ) + security_group_collection_model_json2 = security_group_collection_model.to_dict() assert security_group_collection_model_json2 == security_group_collection_model_json - class TestSecurityGroupCollectionFirst(): """ Test Class for SecurityGroupCollectionFirst @@ -34981,29 +34508,23 @@ def test_security_group_collection_first_serialization(self): # Construct a json representation of a SecurityGroupCollectionFirst model security_group_collection_first_model_json = {} - security_group_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' + security_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation - security_group_collection_first_model = SecurityGroupCollectionFirst.from_dict( - security_group_collection_first_model_json) + security_group_collection_first_model = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json) assert security_group_collection_first_model != False # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation - security_group_collection_first_model_dict = SecurityGroupCollectionFirst.from_dict( - security_group_collection_first_model_json).__dict__ - security_group_collection_first_model2 = SecurityGroupCollectionFirst( - **security_group_collection_first_model_dict) + security_group_collection_first_model_dict = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json).__dict__ + security_group_collection_first_model2 = SecurityGroupCollectionFirst(**security_group_collection_first_model_dict) # Verify the model instances are equivalent assert security_group_collection_first_model == security_group_collection_first_model2 # Convert model instance back to dict and verify no loss of data - security_group_collection_first_model_json2 = security_group_collection_first_model.to_dict( - ) + security_group_collection_first_model_json2 = security_group_collection_first_model.to_dict() assert security_group_collection_first_model_json2 == security_group_collection_first_model_json - class TestSecurityGroupCollectionNext(): """ Test Class for SecurityGroupCollectionNext @@ -35016,29 +34537,23 @@ def test_security_group_collection_next_serialization(self): # Construct a json representation of a SecurityGroupCollectionNext model security_group_collection_next_model_json = {} - security_group_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + security_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation - security_group_collection_next_model = SecurityGroupCollectionNext.from_dict( - security_group_collection_next_model_json) + security_group_collection_next_model = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json) assert security_group_collection_next_model != False # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation - security_group_collection_next_model_dict = SecurityGroupCollectionNext.from_dict( - security_group_collection_next_model_json).__dict__ - security_group_collection_next_model2 = SecurityGroupCollectionNext( - **security_group_collection_next_model_dict) + security_group_collection_next_model_dict = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json).__dict__ + security_group_collection_next_model2 = SecurityGroupCollectionNext(**security_group_collection_next_model_dict) # Verify the model instances are equivalent assert security_group_collection_next_model == security_group_collection_next_model2 # Convert model instance back to dict and verify no loss of data - security_group_collection_next_model_json2 = security_group_collection_next_model.to_dict( - ) + security_group_collection_next_model_json2 = security_group_collection_next_model.to_dict() assert security_group_collection_next_model_json2 == security_group_collection_next_model_json - class TestSecurityGroupPatch(): """ Test Class for SecurityGroupPatch @@ -35054,15 +34569,12 @@ def test_security_group_patch_serialization(self): security_group_patch_model_json['name'] = 'my-security-group' # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation - security_group_patch_model = SecurityGroupPatch.from_dict( - security_group_patch_model_json) + security_group_patch_model = SecurityGroupPatch.from_dict(security_group_patch_model_json) assert security_group_patch_model != False # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation - security_group_patch_model_dict = SecurityGroupPatch.from_dict( - security_group_patch_model_json).__dict__ - security_group_patch_model2 = SecurityGroupPatch( - **security_group_patch_model_dict) + security_group_patch_model_dict = SecurityGroupPatch.from_dict(security_group_patch_model_json).__dict__ + security_group_patch_model2 = SecurityGroupPatch(**security_group_patch_model_dict) # Verify the model instances are equivalent assert security_group_patch_model == security_group_patch_model2 @@ -35071,7 +34583,6 @@ def test_security_group_patch_serialization(self): security_group_patch_model_json2 = security_group_patch_model.to_dict() assert security_group_patch_model_json2 == security_group_patch_model_json - class TestSecurityGroupReference(): """ Test Class for SecurityGroupReference @@ -35084,43 +34595,32 @@ def test_security_group_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a SecurityGroupReference model security_group_reference_model_json = {} - security_group_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model_json[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model_json['deleted'] = security_group_reference_deleted_model + security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model_json['name'] = 'my-security-group' # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation - security_group_reference_model = SecurityGroupReference.from_dict( - security_group_reference_model_json) + security_group_reference_model = SecurityGroupReference.from_dict(security_group_reference_model_json) assert security_group_reference_model != False # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation - security_group_reference_model_dict = SecurityGroupReference.from_dict( - security_group_reference_model_json).__dict__ - security_group_reference_model2 = SecurityGroupReference( - **security_group_reference_model_dict) + security_group_reference_model_dict = SecurityGroupReference.from_dict(security_group_reference_model_json).__dict__ + security_group_reference_model2 = SecurityGroupReference(**security_group_reference_model_dict) # Verify the model instances are equivalent assert security_group_reference_model == security_group_reference_model2 # Convert model instance back to dict and verify no loss of data - security_group_reference_model_json2 = security_group_reference_model.to_dict( - ) + security_group_reference_model_json2 = security_group_reference_model.to_dict() assert security_group_reference_model_json2 == security_group_reference_model_json - class TestSecurityGroupReferenceDeleted(): """ Test Class for SecurityGroupReferenceDeleted @@ -35133,29 +34633,23 @@ def test_security_group_reference_deleted_serialization(self): # Construct a json representation of a SecurityGroupReferenceDeleted model security_group_reference_deleted_model_json = {} - security_group_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + security_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation - security_group_reference_deleted_model = SecurityGroupReferenceDeleted.from_dict( - security_group_reference_deleted_model_json) + security_group_reference_deleted_model = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json) assert security_group_reference_deleted_model != False # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation - security_group_reference_deleted_model_dict = SecurityGroupReferenceDeleted.from_dict( - security_group_reference_deleted_model_json).__dict__ - security_group_reference_deleted_model2 = SecurityGroupReferenceDeleted( - **security_group_reference_deleted_model_dict) + security_group_reference_deleted_model_dict = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json).__dict__ + security_group_reference_deleted_model2 = SecurityGroupReferenceDeleted(**security_group_reference_deleted_model_dict) # Verify the model instances are equivalent assert security_group_reference_deleted_model == security_group_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - security_group_reference_deleted_model_json2 = security_group_reference_deleted_model.to_dict( - ) + security_group_reference_deleted_model_json2 = security_group_reference_deleted_model.to_dict() assert security_group_reference_deleted_model_json2 == security_group_reference_deleted_model_json - class TestSecurityGroupRuleCollection(): """ Test Class for SecurityGroupRuleCollection @@ -35168,14 +34662,12 @@ def test_security_group_rule_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' - security_group_rule_model = { - } # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['remote'] = security_group_rule_remote_model @@ -35185,30 +34677,23 @@ def test_security_group_rule_collection_serialization(self): # Construct a json representation of a SecurityGroupRuleCollection model security_group_rule_collection_model_json = {} - security_group_rule_collection_model_json['rules'] = [ - security_group_rule_model - ] + security_group_rule_collection_model_json['rules'] = [security_group_rule_model] # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation - security_group_rule_collection_model = SecurityGroupRuleCollection.from_dict( - security_group_rule_collection_model_json) + security_group_rule_collection_model = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json) assert security_group_rule_collection_model != False # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation - security_group_rule_collection_model_dict = SecurityGroupRuleCollection.from_dict( - security_group_rule_collection_model_json).__dict__ - security_group_rule_collection_model2 = SecurityGroupRuleCollection( - **security_group_rule_collection_model_dict) + security_group_rule_collection_model_dict = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json).__dict__ + security_group_rule_collection_model2 = SecurityGroupRuleCollection(**security_group_rule_collection_model_dict) # Verify the model instances are equivalent assert security_group_rule_collection_model == security_group_rule_collection_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_collection_model_json2 = security_group_rule_collection_model.to_dict( - ) + security_group_rule_collection_model_json2 = security_group_rule_collection_model.to_dict() assert security_group_rule_collection_model_json2 == security_group_rule_collection_model_json - class TestSecurityGroupRulePatch(): """ Test Class for SecurityGroupRulePatch @@ -35221,8 +34706,7 @@ def test_security_group_rule_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_patch_model = { - } # SecurityGroupRuleRemotePatchCIDR + security_group_rule_remote_patch_model = {} # SecurityGroupRuleRemotePatchCIDR security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/16' # Construct a json representation of a SecurityGroupRulePatch model @@ -35232,30 +34716,24 @@ def test_security_group_rule_patch_serialization(self): security_group_rule_patch_model_json['ip_version'] = 'ipv4' security_group_rule_patch_model_json['port_max'] = 22 security_group_rule_patch_model_json['port_min'] = 22 - security_group_rule_patch_model_json[ - 'remote'] = security_group_rule_remote_patch_model + security_group_rule_patch_model_json['remote'] = security_group_rule_remote_patch_model security_group_rule_patch_model_json['type'] = 8 # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation - security_group_rule_patch_model = SecurityGroupRulePatch.from_dict( - security_group_rule_patch_model_json) + security_group_rule_patch_model = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json) assert security_group_rule_patch_model != False # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation - security_group_rule_patch_model_dict = SecurityGroupRulePatch.from_dict( - security_group_rule_patch_model_json).__dict__ - security_group_rule_patch_model2 = SecurityGroupRulePatch( - **security_group_rule_patch_model_dict) + security_group_rule_patch_model_dict = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json).__dict__ + security_group_rule_patch_model2 = SecurityGroupRulePatch(**security_group_rule_patch_model_dict) # Verify the model instances are equivalent assert security_group_rule_patch_model == security_group_rule_patch_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_patch_model_json2 = security_group_rule_patch_model.to_dict( - ) + security_group_rule_patch_model_json2 = security_group_rule_patch_model.to_dict() assert security_group_rule_patch_model_json2 == security_group_rule_patch_model_json - class TestSecurityGroupTargetCollection(): """ Test Class for SecurityGroupTargetCollection @@ -35268,65 +34746,45 @@ def test_security_group_target_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_target_collection_first_model = { - } # SecurityGroupTargetCollectionFirst - security_group_target_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' - - security_group_target_collection_next_model = { - } # SecurityGroupTargetCollectionNext - security_group_target_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_target_reference_model = { - } # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext - security_group_target_reference_model[ - 'deleted'] = network_interface_reference_target_context_deleted_model - security_group_target_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_collection_first_model = {} # SecurityGroupTargetCollectionFirst + security_group_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' + + security_group_target_collection_next_model = {} # SecurityGroupTargetCollectionNext + security_group_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext + security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['name'] = 'my-network-interface' - security_group_target_reference_model[ - 'resource_type'] = 'network_interface' + security_group_target_reference_model['resource_type'] = 'network_interface' # Construct a json representation of a SecurityGroupTargetCollection model security_group_target_collection_model_json = {} - security_group_target_collection_model_json[ - 'first'] = security_group_target_collection_first_model + security_group_target_collection_model_json['first'] = security_group_target_collection_first_model security_group_target_collection_model_json['limit'] = 20 - security_group_target_collection_model_json[ - 'next'] = security_group_target_collection_next_model - security_group_target_collection_model_json['targets'] = [ - security_group_target_reference_model - ] + security_group_target_collection_model_json['next'] = security_group_target_collection_next_model + security_group_target_collection_model_json['targets'] = [security_group_target_reference_model] security_group_target_collection_model_json['total_count'] = 132 # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation - security_group_target_collection_model = SecurityGroupTargetCollection.from_dict( - security_group_target_collection_model_json) + security_group_target_collection_model = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json) assert security_group_target_collection_model != False # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation - security_group_target_collection_model_dict = SecurityGroupTargetCollection.from_dict( - security_group_target_collection_model_json).__dict__ - security_group_target_collection_model2 = SecurityGroupTargetCollection( - **security_group_target_collection_model_dict) + security_group_target_collection_model_dict = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json).__dict__ + security_group_target_collection_model2 = SecurityGroupTargetCollection(**security_group_target_collection_model_dict) # Verify the model instances are equivalent assert security_group_target_collection_model == security_group_target_collection_model2 # Convert model instance back to dict and verify no loss of data - security_group_target_collection_model_json2 = security_group_target_collection_model.to_dict( - ) + security_group_target_collection_model_json2 = security_group_target_collection_model.to_dict() assert security_group_target_collection_model_json2 == security_group_target_collection_model_json - class TestSecurityGroupTargetCollectionFirst(): """ Test Class for SecurityGroupTargetCollectionFirst @@ -35339,29 +34797,23 @@ def test_security_group_target_collection_first_serialization(self): # Construct a json representation of a SecurityGroupTargetCollectionFirst model security_group_target_collection_first_model_json = {} - security_group_target_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' + security_group_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation - security_group_target_collection_first_model = SecurityGroupTargetCollectionFirst.from_dict( - security_group_target_collection_first_model_json) + security_group_target_collection_first_model = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json) assert security_group_target_collection_first_model != False # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation - security_group_target_collection_first_model_dict = SecurityGroupTargetCollectionFirst.from_dict( - security_group_target_collection_first_model_json).__dict__ - security_group_target_collection_first_model2 = SecurityGroupTargetCollectionFirst( - **security_group_target_collection_first_model_dict) + security_group_target_collection_first_model_dict = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json).__dict__ + security_group_target_collection_first_model2 = SecurityGroupTargetCollectionFirst(**security_group_target_collection_first_model_dict) # Verify the model instances are equivalent assert security_group_target_collection_first_model == security_group_target_collection_first_model2 # Convert model instance back to dict and verify no loss of data - security_group_target_collection_first_model_json2 = security_group_target_collection_first_model.to_dict( - ) + security_group_target_collection_first_model_json2 = security_group_target_collection_first_model.to_dict() assert security_group_target_collection_first_model_json2 == security_group_target_collection_first_model_json - class TestSecurityGroupTargetCollectionNext(): """ Test Class for SecurityGroupTargetCollectionNext @@ -35374,29 +34826,23 @@ def test_security_group_target_collection_next_serialization(self): # Construct a json representation of a SecurityGroupTargetCollectionNext model security_group_target_collection_next_model_json = {} - security_group_target_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + security_group_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation - security_group_target_collection_next_model = SecurityGroupTargetCollectionNext.from_dict( - security_group_target_collection_next_model_json) + security_group_target_collection_next_model = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json) assert security_group_target_collection_next_model != False # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation - security_group_target_collection_next_model_dict = SecurityGroupTargetCollectionNext.from_dict( - security_group_target_collection_next_model_json).__dict__ - security_group_target_collection_next_model2 = SecurityGroupTargetCollectionNext( - **security_group_target_collection_next_model_dict) + security_group_target_collection_next_model_dict = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json).__dict__ + security_group_target_collection_next_model2 = SecurityGroupTargetCollectionNext(**security_group_target_collection_next_model_dict) # Verify the model instances are equivalent assert security_group_target_collection_next_model == security_group_target_collection_next_model2 # Convert model instance back to dict and verify no loss of data - security_group_target_collection_next_model_json2 = security_group_target_collection_next_model.to_dict( - ) + security_group_target_collection_next_model_json2 = security_group_target_collection_next_model.to_dict() assert security_group_target_collection_next_model_json2 == security_group_target_collection_next_model_json - class TestSubnet(): """ Test Class for Subnet @@ -35409,86 +34855,62 @@ def test_subnet_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted - network_acl_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_reference_model = {} # NetworkACLReference - network_acl_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'deleted'] = network_acl_reference_deleted_model - network_acl_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted + network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_reference_model = {} # NetworkACLReference + network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['deleted'] = network_acl_reference_deleted_model + network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_reference_model['name'] = 'my-network-acl' - public_gateway_reference_deleted_model = { - } # PublicGatewayReferenceDeleted - public_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - public_gateway_reference_model = {} # PublicGatewayReference - public_gateway_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model[ - 'deleted'] = public_gateway_reference_deleted_model - public_gateway_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted + public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + public_gateway_reference_model = {} # PublicGatewayReference + public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model + public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_reference_model['name'] = 'my-public-gateway' public_gateway_reference_model['resource_type'] = 'public_gateway' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - routing_table_reference_deleted_model = { - } # RoutingTableReferenceDeleted - routing_table_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - routing_table_reference_model = {} # RoutingTableReference - routing_table_reference_model[ - 'deleted'] = routing_table_reference_deleted_model - routing_table_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - routing_table_reference_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted + routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + routing_table_reference_model = {} # RoutingTableReference + routing_table_reference_model['deleted'] = routing_table_reference_deleted_model + routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_reference_model['name'] = 'my-routing-table-1' routing_table_reference_model['resource_type'] = 'routing_table' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a Subnet model subnet_model_json = {} subnet_model_json['available_ipv4_address_count'] = 15 - subnet_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - subnet_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + subnet_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_model_json['ip_version'] = 'ipv4' subnet_model_json['ipv4_cidr_block'] = '10.0.0.0/24' @@ -35517,7 +34939,6 @@ def test_subnet_serialization(self): subnet_model_json2 = subnet_model.to_dict() assert subnet_model_json2 == subnet_model_json - class TestSubnetCollection(): """ Test Class for SubnetCollection @@ -35530,93 +34951,67 @@ def test_subnet_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - subnet_collection_first_model = {} # SubnetCollectionFirst - subnet_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' - - subnet_collection_next_model = {} # SubnetCollectionNext - subnet_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted - network_acl_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_reference_model = {} # NetworkACLReference - network_acl_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'deleted'] = network_acl_reference_deleted_model - network_acl_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + subnet_collection_first_model = {} # SubnetCollectionFirst + subnet_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' + + subnet_collection_next_model = {} # SubnetCollectionNext + subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted + network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_reference_model = {} # NetworkACLReference + network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['deleted'] = network_acl_reference_deleted_model + network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_reference_model['name'] = 'my-network-acl' - public_gateway_reference_deleted_model = { - } # PublicGatewayReferenceDeleted - public_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - public_gateway_reference_model = {} # PublicGatewayReference - public_gateway_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model[ - 'deleted'] = public_gateway_reference_deleted_model - public_gateway_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' - public_gateway_reference_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted + public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + public_gateway_reference_model = {} # PublicGatewayReference + public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model + public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' public_gateway_reference_model['name'] = 'my-public-gateway' public_gateway_reference_model['resource_type'] = 'public_gateway' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - routing_table_reference_deleted_model = { - } # RoutingTableReferenceDeleted - routing_table_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - routing_table_reference_model = {} # RoutingTableReference - routing_table_reference_model[ - 'deleted'] = routing_table_reference_deleted_model - routing_table_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - routing_table_reference_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted + routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + routing_table_reference_model = {} # RoutingTableReference + routing_table_reference_model['deleted'] = routing_table_reference_deleted_model + routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_reference_model['name'] = 'my-routing-table-1' routing_table_reference_model['resource_type'] = 'routing_table' - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - vpc_reference_model = {} # VPCReference - vpc_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = vpc_reference_deleted_model - vpc_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - subnet_model = {} # Subnet + subnet_model = {} # Subnet subnet_model['available_ipv4_address_count'] = 15 - subnet_model['created_at'] = '2020-01-28T18:40:40.123456Z' - subnet_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + subnet_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_model['ip_version'] = 'ipv4' subnet_model['ipv4_cidr_block'] = '10.0.0.0/24' @@ -35639,15 +35034,12 @@ def test_subnet_collection_serialization(self): subnet_collection_model_json['total_count'] = 132 # Construct a model instance of SubnetCollection by calling from_dict on the json representation - subnet_collection_model = SubnetCollection.from_dict( - subnet_collection_model_json) + subnet_collection_model = SubnetCollection.from_dict(subnet_collection_model_json) assert subnet_collection_model != False # Construct a model instance of SubnetCollection by calling from_dict on the json representation - subnet_collection_model_dict = SubnetCollection.from_dict( - subnet_collection_model_json).__dict__ - subnet_collection_model2 = SubnetCollection( - **subnet_collection_model_dict) + subnet_collection_model_dict = SubnetCollection.from_dict(subnet_collection_model_json).__dict__ + subnet_collection_model2 = SubnetCollection(**subnet_collection_model_dict) # Verify the model instances are equivalent assert subnet_collection_model == subnet_collection_model2 @@ -35656,7 +35048,6 @@ def test_subnet_collection_serialization(self): subnet_collection_model_json2 = subnet_collection_model.to_dict() assert subnet_collection_model_json2 == subnet_collection_model_json - class TestSubnetCollectionFirst(): """ Test Class for SubnetCollectionFirst @@ -35669,29 +35060,23 @@ def test_subnet_collection_first_serialization(self): # Construct a json representation of a SubnetCollectionFirst model subnet_collection_first_model_json = {} - subnet_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' + subnet_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation - subnet_collection_first_model = SubnetCollectionFirst.from_dict( - subnet_collection_first_model_json) + subnet_collection_first_model = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json) assert subnet_collection_first_model != False # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation - subnet_collection_first_model_dict = SubnetCollectionFirst.from_dict( - subnet_collection_first_model_json).__dict__ - subnet_collection_first_model2 = SubnetCollectionFirst( - **subnet_collection_first_model_dict) + subnet_collection_first_model_dict = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json).__dict__ + subnet_collection_first_model2 = SubnetCollectionFirst(**subnet_collection_first_model_dict) # Verify the model instances are equivalent assert subnet_collection_first_model == subnet_collection_first_model2 # Convert model instance back to dict and verify no loss of data - subnet_collection_first_model_json2 = subnet_collection_first_model.to_dict( - ) + subnet_collection_first_model_json2 = subnet_collection_first_model.to_dict() assert subnet_collection_first_model_json2 == subnet_collection_first_model_json - class TestSubnetCollectionNext(): """ Test Class for SubnetCollectionNext @@ -35704,29 +35089,23 @@ def test_subnet_collection_next_serialization(self): # Construct a json representation of a SubnetCollectionNext model subnet_collection_next_model_json = {} - subnet_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + subnet_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation - subnet_collection_next_model = SubnetCollectionNext.from_dict( - subnet_collection_next_model_json) + subnet_collection_next_model = SubnetCollectionNext.from_dict(subnet_collection_next_model_json) assert subnet_collection_next_model != False # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation - subnet_collection_next_model_dict = SubnetCollectionNext.from_dict( - subnet_collection_next_model_json).__dict__ - subnet_collection_next_model2 = SubnetCollectionNext( - **subnet_collection_next_model_dict) + subnet_collection_next_model_dict = SubnetCollectionNext.from_dict(subnet_collection_next_model_json).__dict__ + subnet_collection_next_model2 = SubnetCollectionNext(**subnet_collection_next_model_dict) # Verify the model instances are equivalent assert subnet_collection_next_model == subnet_collection_next_model2 # Convert model instance back to dict and verify no loss of data - subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict( - ) + subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict() assert subnet_collection_next_model_json2 == subnet_collection_next_model_json - class TestSubnetPatch(): """ Test Class for SubnetPatch @@ -35739,24 +35118,20 @@ def test_subnet_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_identity_model = {} # NetworkACLIdentityById - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model = {} # NetworkACLIdentityById + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' - public_gateway_identity_model = {} # PublicGatewayIdentityById - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model = {} # PublicGatewayIdentityById + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' - routing_table_identity_model = {} # RoutingTableIdentityById - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model = {} # RoutingTableIdentityById + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a json representation of a SubnetPatch model subnet_patch_model_json = {} subnet_patch_model_json['name'] = 'my-subnet' subnet_patch_model_json['network_acl'] = network_acl_identity_model - subnet_patch_model_json[ - 'public_gateway'] = public_gateway_identity_model + subnet_patch_model_json['public_gateway'] = public_gateway_identity_model subnet_patch_model_json['routing_table'] = routing_table_identity_model # Construct a model instance of SubnetPatch by calling from_dict on the json representation @@ -35764,8 +35139,7 @@ def test_subnet_patch_serialization(self): assert subnet_patch_model != False # Construct a model instance of SubnetPatch by calling from_dict on the json representation - subnet_patch_model_dict = SubnetPatch.from_dict( - subnet_patch_model_json).__dict__ + subnet_patch_model_dict = SubnetPatch.from_dict(subnet_patch_model_json).__dict__ subnet_patch_model2 = SubnetPatch(**subnet_patch_model_dict) # Verify the model instances are equivalent @@ -35775,7 +35149,6 @@ def test_subnet_patch_serialization(self): subnet_patch_model_json2 = subnet_patch_model.to_dict() assert subnet_patch_model_json2 == subnet_patch_model_json - class TestSubnetReference(): """ Test Class for SubnetReference @@ -35788,29 +35161,23 @@ def test_subnet_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a SubnetReference model subnet_reference_model_json = {} - subnet_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model_json['deleted'] = subnet_reference_deleted_model - subnet_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model_json[ - 'id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model_json['name'] = 'my-subnet' # Construct a model instance of SubnetReference by calling from_dict on the json representation - subnet_reference_model = SubnetReference.from_dict( - subnet_reference_model_json) + subnet_reference_model = SubnetReference.from_dict(subnet_reference_model_json) assert subnet_reference_model != False # Construct a model instance of SubnetReference by calling from_dict on the json representation - subnet_reference_model_dict = SubnetReference.from_dict( - subnet_reference_model_json).__dict__ + subnet_reference_model_dict = SubnetReference.from_dict(subnet_reference_model_json).__dict__ subnet_reference_model2 = SubnetReference(**subnet_reference_model_dict) # Verify the model instances are equivalent @@ -35820,7 +35187,6 @@ def test_subnet_reference_serialization(self): subnet_reference_model_json2 = subnet_reference_model.to_dict() assert subnet_reference_model_json2 == subnet_reference_model_json - class TestSubnetReferenceDeleted(): """ Test Class for SubnetReferenceDeleted @@ -35833,29 +35199,23 @@ def test_subnet_reference_deleted_serialization(self): # Construct a json representation of a SubnetReferenceDeleted model subnet_reference_deleted_model_json = {} - subnet_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation - subnet_reference_deleted_model = SubnetReferenceDeleted.from_dict( - subnet_reference_deleted_model_json) + subnet_reference_deleted_model = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json) assert subnet_reference_deleted_model != False # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation - subnet_reference_deleted_model_dict = SubnetReferenceDeleted.from_dict( - subnet_reference_deleted_model_json).__dict__ - subnet_reference_deleted_model2 = SubnetReferenceDeleted( - **subnet_reference_deleted_model_dict) + subnet_reference_deleted_model_dict = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json).__dict__ + subnet_reference_deleted_model2 = SubnetReferenceDeleted(**subnet_reference_deleted_model_dict) # Verify the model instances are equivalent assert subnet_reference_deleted_model == subnet_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict( - ) + subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict() assert subnet_reference_deleted_model_json2 == subnet_reference_deleted_model_json - class TestVCPU(): """ Test Class for VCPU @@ -35886,7 +35246,6 @@ def test_vcpu_serialization(self): vcpu_model_json2 = vcpu_model.to_dict() assert vcpu_model_json2 == vcpu_model_json - class TestVPC(): """ Test Class for VPC @@ -35899,84 +35258,62 @@ def test_vpc_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - vpccse_source_ip_model = {} # VPCCSESourceIP + vpccse_source_ip_model = {} # VPCCSESourceIP vpccse_source_ip_model['ip'] = ip_model vpccse_source_ip_model['zone'] = zone_reference_model - network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted - network_acl_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_reference_model = {} # NetworkACLReference - network_acl_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'deleted'] = network_acl_reference_deleted_model - network_acl_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted + network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_reference_model = {} # NetworkACLReference + network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['deleted'] = network_acl_reference_deleted_model + network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_reference_model['name'] = 'my-network-acl' - routing_table_reference_deleted_model = { - } # RoutingTableReferenceDeleted - routing_table_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - routing_table_reference_model = {} # RoutingTableReference - routing_table_reference_model[ - 'deleted'] = routing_table_reference_deleted_model - routing_table_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - routing_table_reference_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted + routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + routing_table_reference_model = {} # RoutingTableReference + routing_table_reference_model['deleted'] = routing_table_reference_deleted_model + routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_reference_model['name'] = 'my-routing-table-1' routing_table_reference_model['resource_type'] = 'routing_table' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' # Construct a json representation of a VPC model vpc_model_json = {} vpc_model_json['classic_access'] = False - vpc_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - vpc_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpc_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model_json['cse_source_ips'] = [vpccse_source_ip_model] vpc_model_json['default_network_acl'] = network_acl_reference_model vpc_model_json['default_routing_table'] = routing_table_reference_model - vpc_model_json[ - 'default_security_group'] = security_group_reference_model - vpc_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_model_json['default_security_group'] = security_group_reference_model + vpc_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model_json['name'] = 'my-vpc' vpc_model_json['resource_group'] = resource_group_reference_model @@ -35997,7 +35334,6 @@ def test_vpc_serialization(self): vpc_model_json2 = vpc_model.to_dict() assert vpc_model_json2 == vpc_model_json - class TestVPCCSESourceIP(): """ Test Class for VPCCSESourceIP @@ -36010,12 +35346,11 @@ def test_vpccse_source_ip_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a VPCCSESourceIP model @@ -36024,13 +35359,11 @@ def test_vpccse_source_ip_serialization(self): vpccse_source_ip_model_json['zone'] = zone_reference_model # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation - vpccse_source_ip_model = VPCCSESourceIP.from_dict( - vpccse_source_ip_model_json) + vpccse_source_ip_model = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json) assert vpccse_source_ip_model != False # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation - vpccse_source_ip_model_dict = VPCCSESourceIP.from_dict( - vpccse_source_ip_model_json).__dict__ + vpccse_source_ip_model_dict = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json).__dict__ vpccse_source_ip_model2 = VPCCSESourceIP(**vpccse_source_ip_model_dict) # Verify the model instances are equivalent @@ -36040,7 +35373,6 @@ def test_vpccse_source_ip_serialization(self): vpccse_source_ip_model_json2 = vpccse_source_ip_model.to_dict() assert vpccse_source_ip_model_json2 == vpccse_source_ip_model_json - class TestVPCCollection(): """ Test Class for VPCCollection @@ -36053,90 +35385,67 @@ def test_vpc_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpc_collection_first_model = {} # VPCCollectionFirst - vpc_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' + vpc_collection_first_model = {} # VPCCollectionFirst + vpc_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' - vpc_collection_next_model = {} # VPCCollectionNext - vpc_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + vpc_collection_next_model = {} # VPCCollectionNext + vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - vpccse_source_ip_model = {} # VPCCSESourceIP + vpccse_source_ip_model = {} # VPCCSESourceIP vpccse_source_ip_model['ip'] = ip_model vpccse_source_ip_model['zone'] = zone_reference_model - network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted - network_acl_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_reference_model = {} # NetworkACLReference - network_acl_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'deleted'] = network_acl_reference_deleted_model - network_acl_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted + network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_reference_model = {} # NetworkACLReference + network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['deleted'] = network_acl_reference_deleted_model + network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' network_acl_reference_model['name'] = 'my-network-acl' - routing_table_reference_deleted_model = { - } # RoutingTableReferenceDeleted - routing_table_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - routing_table_reference_model = {} # RoutingTableReference - routing_table_reference_model[ - 'deleted'] = routing_table_reference_deleted_model - routing_table_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' - routing_table_reference_model[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted + routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + routing_table_reference_model = {} # RoutingTableReference + routing_table_reference_model['deleted'] = routing_table_reference_deleted_model + routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' routing_table_reference_model['name'] = 'my-routing-table-1' routing_table_reference_model['resource_type'] = 'routing_table' - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'deleted'] = security_group_reference_deleted_model - security_group_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - vpc_model = {} # VPC + vpc_model = {} # VPC vpc_model['classic_access'] = False - vpc_model['created_at'] = '2020-01-28T18:40:40.123456Z' - vpc_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpc_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model['cse_source_ips'] = [vpccse_source_ip_model] vpc_model['default_network_acl'] = network_acl_reference_model vpc_model['default_routing_table'] = routing_table_reference_model vpc_model['default_security_group'] = security_group_reference_model - vpc_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_model['name'] = 'my-vpc' vpc_model['resource_group'] = resource_group_reference_model @@ -36151,13 +35460,11 @@ def test_vpc_collection_serialization(self): vpc_collection_model_json['vpcs'] = [vpc_model] # Construct a model instance of VPCCollection by calling from_dict on the json representation - vpc_collection_model = VPCCollection.from_dict( - vpc_collection_model_json) + vpc_collection_model = VPCCollection.from_dict(vpc_collection_model_json) assert vpc_collection_model != False # Construct a model instance of VPCCollection by calling from_dict on the json representation - vpc_collection_model_dict = VPCCollection.from_dict( - vpc_collection_model_json).__dict__ + vpc_collection_model_dict = VPCCollection.from_dict(vpc_collection_model_json).__dict__ vpc_collection_model2 = VPCCollection(**vpc_collection_model_dict) # Verify the model instances are equivalent @@ -36167,7 +35474,6 @@ def test_vpc_collection_serialization(self): vpc_collection_model_json2 = vpc_collection_model.to_dict() assert vpc_collection_model_json2 == vpc_collection_model_json - class TestVPCCollectionFirst(): """ Test Class for VPCCollectionFirst @@ -36180,19 +35486,15 @@ def test_vpc_collection_first_serialization(self): # Construct a json representation of a VPCCollectionFirst model vpc_collection_first_model_json = {} - vpc_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' + vpc_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation - vpc_collection_first_model = VPCCollectionFirst.from_dict( - vpc_collection_first_model_json) + vpc_collection_first_model = VPCCollectionFirst.from_dict(vpc_collection_first_model_json) assert vpc_collection_first_model != False # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation - vpc_collection_first_model_dict = VPCCollectionFirst.from_dict( - vpc_collection_first_model_json).__dict__ - vpc_collection_first_model2 = VPCCollectionFirst( - **vpc_collection_first_model_dict) + vpc_collection_first_model_dict = VPCCollectionFirst.from_dict(vpc_collection_first_model_json).__dict__ + vpc_collection_first_model2 = VPCCollectionFirst(**vpc_collection_first_model_dict) # Verify the model instances are equivalent assert vpc_collection_first_model == vpc_collection_first_model2 @@ -36201,7 +35503,6 @@ def test_vpc_collection_first_serialization(self): vpc_collection_first_model_json2 = vpc_collection_first_model.to_dict() assert vpc_collection_first_model_json2 == vpc_collection_first_model_json - class TestVPCCollectionNext(): """ Test Class for VPCCollectionNext @@ -36214,19 +35515,15 @@ def test_vpc_collection_next_serialization(self): # Construct a json representation of a VPCCollectionNext model vpc_collection_next_model_json = {} - vpc_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + vpc_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation - vpc_collection_next_model = VPCCollectionNext.from_dict( - vpc_collection_next_model_json) + vpc_collection_next_model = VPCCollectionNext.from_dict(vpc_collection_next_model_json) assert vpc_collection_next_model != False # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation - vpc_collection_next_model_dict = VPCCollectionNext.from_dict( - vpc_collection_next_model_json).__dict__ - vpc_collection_next_model2 = VPCCollectionNext( - **vpc_collection_next_model_dict) + vpc_collection_next_model_dict = VPCCollectionNext.from_dict(vpc_collection_next_model_json).__dict__ + vpc_collection_next_model2 = VPCCollectionNext(**vpc_collection_next_model_dict) # Verify the model instances are equivalent assert vpc_collection_next_model == vpc_collection_next_model2 @@ -36235,7 +35532,6 @@ def test_vpc_collection_next_serialization(self): vpc_collection_next_model_json2 = vpc_collection_next_model.to_dict() assert vpc_collection_next_model_json2 == vpc_collection_next_model_json - class TestVPCPatch(): """ Test Class for VPCPatch @@ -36265,7 +35561,6 @@ def test_vpc_patch_serialization(self): vpc_patch_model_json2 = vpc_patch_model.to_dict() assert vpc_patch_model_json2 == vpc_patch_model_json - class TestVPCReference(): """ Test Class for VPCReference @@ -36278,17 +35573,14 @@ def test_vpc_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a VPCReference model vpc_reference_model_json = {} - vpc_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model_json['deleted'] = vpc_reference_deleted_model - vpc_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model_json['name'] = 'my-vpc' @@ -36297,8 +35589,7 @@ def test_vpc_reference_serialization(self): assert vpc_reference_model != False # Construct a model instance of VPCReference by calling from_dict on the json representation - vpc_reference_model_dict = VPCReference.from_dict( - vpc_reference_model_json).__dict__ + vpc_reference_model_dict = VPCReference.from_dict(vpc_reference_model_json).__dict__ vpc_reference_model2 = VPCReference(**vpc_reference_model_dict) # Verify the model instances are equivalent @@ -36308,7 +35599,6 @@ def test_vpc_reference_serialization(self): vpc_reference_model_json2 = vpc_reference_model.to_dict() assert vpc_reference_model_json2 == vpc_reference_model_json - class TestVPCReferenceDeleted(): """ Test Class for VPCReferenceDeleted @@ -36321,29 +35611,23 @@ def test_vpc_reference_deleted_serialization(self): # Construct a json representation of a VPCReferenceDeleted model vpc_reference_deleted_model_json = {} - vpc_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation - vpc_reference_deleted_model = VPCReferenceDeleted.from_dict( - vpc_reference_deleted_model_json) + vpc_reference_deleted_model = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json) assert vpc_reference_deleted_model != False # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation - vpc_reference_deleted_model_dict = VPCReferenceDeleted.from_dict( - vpc_reference_deleted_model_json).__dict__ - vpc_reference_deleted_model2 = VPCReferenceDeleted( - **vpc_reference_deleted_model_dict) + vpc_reference_deleted_model_dict = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json).__dict__ + vpc_reference_deleted_model2 = VPCReferenceDeleted(**vpc_reference_deleted_model_dict) # Verify the model instances are equivalent assert vpc_reference_deleted_model == vpc_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - vpc_reference_deleted_model_json2 = vpc_reference_deleted_model.to_dict( - ) + vpc_reference_deleted_model_json2 = vpc_reference_deleted_model.to_dict() assert vpc_reference_deleted_model_json2 == vpc_reference_deleted_model_json - class TestVPNGatewayCollection(): """ Test Class for VPNGatewayCollection @@ -36356,69 +35640,51 @@ def test_vpn_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst - vpn_gateway_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' - - vpn_gateway_collection_next_model = {} # VPNGatewayCollectionNext - vpn_gateway_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst + vpn_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' + + vpn_gateway_collection_next_model = {} # VPNGatewayCollectionNext + vpn_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - vpn_gateway_member_model = {} # VPNGatewayMember + vpn_gateway_member_model = {} # VPNGatewayMember vpn_gateway_member_model['private_ip'] = ip_model vpn_gateway_member_model['public_ip'] = ip_model vpn_gateway_member_model['role'] = 'active' vpn_gateway_member_model['status'] = 'available' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' - vpn_gateway_model = {} # VPNGatewayRouteMode - vpn_gateway_model['connections'] = [ - vpn_gateway_connection_reference_model - ] - vpn_gateway_model['created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_model = {} # VPNGatewayRouteMode + vpn_gateway_model['connections'] = [vpn_gateway_connection_reference_model] + vpn_gateway_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' vpn_gateway_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' vpn_gateway_model['members'] = [vpn_gateway_member_model] vpn_gateway_model['name'] = 'my-vpn-gateway' @@ -36430,34 +35696,27 @@ def test_vpn_gateway_collection_serialization(self): # Construct a json representation of a VPNGatewayCollection model vpn_gateway_collection_model_json = {} - vpn_gateway_collection_model_json[ - 'first'] = vpn_gateway_collection_first_model + vpn_gateway_collection_model_json['first'] = vpn_gateway_collection_first_model vpn_gateway_collection_model_json['limit'] = 20 - vpn_gateway_collection_model_json[ - 'next'] = vpn_gateway_collection_next_model + vpn_gateway_collection_model_json['next'] = vpn_gateway_collection_next_model vpn_gateway_collection_model_json['total_count'] = 132 vpn_gateway_collection_model_json['vpn_gateways'] = [vpn_gateway_model] # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation - vpn_gateway_collection_model = VPNGatewayCollection.from_dict( - vpn_gateway_collection_model_json) + vpn_gateway_collection_model = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json) assert vpn_gateway_collection_model != False # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation - vpn_gateway_collection_model_dict = VPNGatewayCollection.from_dict( - vpn_gateway_collection_model_json).__dict__ - vpn_gateway_collection_model2 = VPNGatewayCollection( - **vpn_gateway_collection_model_dict) + vpn_gateway_collection_model_dict = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json).__dict__ + vpn_gateway_collection_model2 = VPNGatewayCollection(**vpn_gateway_collection_model_dict) # Verify the model instances are equivalent assert vpn_gateway_collection_model == vpn_gateway_collection_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_collection_model_json2 = vpn_gateway_collection_model.to_dict( - ) + vpn_gateway_collection_model_json2 = vpn_gateway_collection_model.to_dict() assert vpn_gateway_collection_model_json2 == vpn_gateway_collection_model_json - class TestVPNGatewayCollectionFirst(): """ Test Class for VPNGatewayCollectionFirst @@ -36470,29 +35729,23 @@ def test_vpn_gateway_collection_first_serialization(self): # Construct a json representation of a VPNGatewayCollectionFirst model vpn_gateway_collection_first_model_json = {} - vpn_gateway_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' + vpn_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation - vpn_gateway_collection_first_model = VPNGatewayCollectionFirst.from_dict( - vpn_gateway_collection_first_model_json) + vpn_gateway_collection_first_model = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json) assert vpn_gateway_collection_first_model != False # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation - vpn_gateway_collection_first_model_dict = VPNGatewayCollectionFirst.from_dict( - vpn_gateway_collection_first_model_json).__dict__ - vpn_gateway_collection_first_model2 = VPNGatewayCollectionFirst( - **vpn_gateway_collection_first_model_dict) + vpn_gateway_collection_first_model_dict = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json).__dict__ + vpn_gateway_collection_first_model2 = VPNGatewayCollectionFirst(**vpn_gateway_collection_first_model_dict) # Verify the model instances are equivalent assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_collection_first_model_json2 = vpn_gateway_collection_first_model.to_dict( - ) + vpn_gateway_collection_first_model_json2 = vpn_gateway_collection_first_model.to_dict() assert vpn_gateway_collection_first_model_json2 == vpn_gateway_collection_first_model_json - class TestVPNGatewayCollectionNext(): """ Test Class for VPNGatewayCollectionNext @@ -36505,29 +35758,23 @@ def test_vpn_gateway_collection_next_serialization(self): # Construct a json representation of a VPNGatewayCollectionNext model vpn_gateway_collection_next_model_json = {} - vpn_gateway_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + vpn_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation - vpn_gateway_collection_next_model = VPNGatewayCollectionNext.from_dict( - vpn_gateway_collection_next_model_json) + vpn_gateway_collection_next_model = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json) assert vpn_gateway_collection_next_model != False # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation - vpn_gateway_collection_next_model_dict = VPNGatewayCollectionNext.from_dict( - vpn_gateway_collection_next_model_json).__dict__ - vpn_gateway_collection_next_model2 = VPNGatewayCollectionNext( - **vpn_gateway_collection_next_model_dict) + vpn_gateway_collection_next_model_dict = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json).__dict__ + vpn_gateway_collection_next_model2 = VPNGatewayCollectionNext(**vpn_gateway_collection_next_model_dict) # Verify the model instances are equivalent assert vpn_gateway_collection_next_model == vpn_gateway_collection_next_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_collection_next_model_json2 = vpn_gateway_collection_next_model.to_dict( - ) + vpn_gateway_collection_next_model_json2 = vpn_gateway_collection_next_model.to_dict() assert vpn_gateway_collection_next_model_json2 == vpn_gateway_collection_next_model_json - class TestVPNGatewayConnectionCollection(): """ Test Class for VPNGatewayConnectionCollection @@ -36540,63 +35787,47 @@ def test_vpn_gateway_connection_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD + vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD vpn_gateway_connection_dpd_model['action'] = 'restart' vpn_gateway_connection_dpd_model['interval'] = 30 vpn_gateway_connection_dpd_model['timeout'] = 120 - ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted - ike_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - ike_policy_reference_model = {} # IKEPolicyReference - ike_policy_reference_model[ - 'deleted'] = ike_policy_reference_deleted_model - ike_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - ike_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted + ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + ike_policy_reference_model = {} # IKEPolicyReference + ike_policy_reference_model['deleted'] = ike_policy_reference_deleted_model + ike_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_reference_model['name'] = 'my-ike-policy' ike_policy_reference_model['resource_type'] = 'ike_policy' - i_psec_policy_reference_deleted_model = { - } # IPsecPolicyReferenceDeleted - i_psec_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - i_psec_policy_reference_model = {} # IPsecPolicyReference - i_psec_policy_reference_model[ - 'deleted'] = i_psec_policy_reference_deleted_model - i_psec_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted + i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + i_psec_policy_reference_model = {} # IPsecPolicyReference + i_psec_policy_reference_model['deleted'] = i_psec_policy_reference_deleted_model + i_psec_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_reference_model['name'] = 'my-ipsec-policy' i_psec_policy_reference_model['resource_type'] = 'ipsec_policy' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - vpn_gateway_connection_static_route_mode_tunnel_model = { - } # VPNGatewayConnectionStaticRouteModeTunnel - vpn_gateway_connection_static_route_mode_tunnel_model[ - 'public_ip'] = ip_model + vpn_gateway_connection_static_route_mode_tunnel_model = {} # VPNGatewayConnectionStaticRouteModeTunnel + vpn_gateway_connection_static_route_mode_tunnel_model['public_ip'] = ip_model vpn_gateway_connection_static_route_mode_tunnel_model['status'] = 'up' - vpn_gateway_connection_model = {} # VPNGatewayConnectionStaticRouteMode + vpn_gateway_connection_model = {} # VPNGatewayConnectionStaticRouteMode vpn_gateway_connection_model['admin_state_up'] = True vpn_gateway_connection_model['authentication_mode'] = 'psk' - vpn_gateway_connection_model[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_connection_model[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_model - vpn_gateway_connection_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_connection_model['dead_peer_detection'] = vpn_gateway_connection_dpd_model + vpn_gateway_connection_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_model['ike_policy'] = ike_policy_reference_model - vpn_gateway_connection_model[ - 'ipsec_policy'] = i_psec_policy_reference_model + vpn_gateway_connection_model['ipsec_policy'] = i_psec_policy_reference_model vpn_gateway_connection_model['mode'] = 'route' vpn_gateway_connection_model['name'] = 'my-vpn-connection' vpn_gateway_connection_model['peer_address'] = '169.21.50.5' @@ -36604,36 +35835,27 @@ def test_vpn_gateway_connection_collection_serialization(self): vpn_gateway_connection_model['resource_type'] = 'vpn_gateway_connection' vpn_gateway_connection_model['status'] = 'down' vpn_gateway_connection_model['routing_protocol'] = 'none' - vpn_gateway_connection_model['tunnels'] = [ - vpn_gateway_connection_static_route_mode_tunnel_model - ] + vpn_gateway_connection_model['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model] # Construct a json representation of a VPNGatewayConnectionCollection model vpn_gateway_connection_collection_model_json = {} - vpn_gateway_connection_collection_model_json['connections'] = [ - vpn_gateway_connection_model - ] + vpn_gateway_connection_collection_model_json['connections'] = [vpn_gateway_connection_model] # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation - vpn_gateway_connection_collection_model = VPNGatewayConnectionCollection.from_dict( - vpn_gateway_connection_collection_model_json) + vpn_gateway_connection_collection_model = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json) assert vpn_gateway_connection_collection_model != False # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation - vpn_gateway_connection_collection_model_dict = VPNGatewayConnectionCollection.from_dict( - vpn_gateway_connection_collection_model_json).__dict__ - vpn_gateway_connection_collection_model2 = VPNGatewayConnectionCollection( - **vpn_gateway_connection_collection_model_dict) + vpn_gateway_connection_collection_model_dict = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json).__dict__ + vpn_gateway_connection_collection_model2 = VPNGatewayConnectionCollection(**vpn_gateway_connection_collection_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_collection_model == vpn_gateway_connection_collection_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_collection_model_json2 = vpn_gateway_connection_collection_model.to_dict( - ) + vpn_gateway_connection_collection_model_json2 = vpn_gateway_connection_collection_model.to_dict() assert vpn_gateway_connection_collection_model_json2 == vpn_gateway_connection_collection_model_json - class TestVPNGatewayConnectionDPD(): """ Test Class for VPNGatewayConnectionDPD @@ -36651,25 +35873,20 @@ def test_vpn_gateway_connection_dpd_serialization(self): vpn_gateway_connection_dpd_model_json['timeout'] = 120 # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation - vpn_gateway_connection_dpd_model = VPNGatewayConnectionDPD.from_dict( - vpn_gateway_connection_dpd_model_json) + vpn_gateway_connection_dpd_model = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json) assert vpn_gateway_connection_dpd_model != False # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation - vpn_gateway_connection_dpd_model_dict = VPNGatewayConnectionDPD.from_dict( - vpn_gateway_connection_dpd_model_json).__dict__ - vpn_gateway_connection_dpd_model2 = VPNGatewayConnectionDPD( - **vpn_gateway_connection_dpd_model_dict) + vpn_gateway_connection_dpd_model_dict = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json).__dict__ + vpn_gateway_connection_dpd_model2 = VPNGatewayConnectionDPD(**vpn_gateway_connection_dpd_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_dpd_model == vpn_gateway_connection_dpd_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_dpd_model_json2 = vpn_gateway_connection_dpd_model.to_dict( - ) + vpn_gateway_connection_dpd_model_json2 = vpn_gateway_connection_dpd_model.to_dict() assert vpn_gateway_connection_dpd_model_json2 == vpn_gateway_connection_dpd_model_json - class TestVPNGatewayConnectionDPDPrototype(): """ Test Class for VPNGatewayConnectionDPDPrototype @@ -36687,25 +35904,20 @@ def test_vpn_gateway_connection_dpd_prototype_serialization(self): vpn_gateway_connection_dpd_prototype_model_json['timeout'] = 120 # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation - vpn_gateway_connection_dpd_prototype_model = VPNGatewayConnectionDPDPrototype.from_dict( - vpn_gateway_connection_dpd_prototype_model_json) + vpn_gateway_connection_dpd_prototype_model = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json) assert vpn_gateway_connection_dpd_prototype_model != False # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation - vpn_gateway_connection_dpd_prototype_model_dict = VPNGatewayConnectionDPDPrototype.from_dict( - vpn_gateway_connection_dpd_prototype_model_json).__dict__ - vpn_gateway_connection_dpd_prototype_model2 = VPNGatewayConnectionDPDPrototype( - **vpn_gateway_connection_dpd_prototype_model_dict) + vpn_gateway_connection_dpd_prototype_model_dict = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json).__dict__ + vpn_gateway_connection_dpd_prototype_model2 = VPNGatewayConnectionDPDPrototype(**vpn_gateway_connection_dpd_prototype_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_dpd_prototype_model == vpn_gateway_connection_dpd_prototype_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_dpd_prototype_model_json2 = vpn_gateway_connection_dpd_prototype_model.to_dict( - ) + vpn_gateway_connection_dpd_prototype_model_json2 = vpn_gateway_connection_dpd_prototype_model.to_dict() assert vpn_gateway_connection_dpd_prototype_model_json2 == vpn_gateway_connection_dpd_prototype_model_json - class TestVPNGatewayConnectionLocalCIDRs(): """ Test Class for VPNGatewayConnectionLocalCIDRs @@ -36718,30 +35930,23 @@ def test_vpn_gateway_connection_local_cid_rs_serialization(self): # Construct a json representation of a VPNGatewayConnectionLocalCIDRs model vpn_gateway_connection_local_cid_rs_model_json = {} - vpn_gateway_connection_local_cid_rs_model_json['local_cidrs'] = [ - '192.168.1.0/24' - ] + vpn_gateway_connection_local_cid_rs_model_json['local_cidrs'] = ['192.168.1.0/24'] # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation - vpn_gateway_connection_local_cid_rs_model = VPNGatewayConnectionLocalCIDRs.from_dict( - vpn_gateway_connection_local_cid_rs_model_json) + vpn_gateway_connection_local_cid_rs_model = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json) assert vpn_gateway_connection_local_cid_rs_model != False # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation - vpn_gateway_connection_local_cid_rs_model_dict = VPNGatewayConnectionLocalCIDRs.from_dict( - vpn_gateway_connection_local_cid_rs_model_json).__dict__ - vpn_gateway_connection_local_cid_rs_model2 = VPNGatewayConnectionLocalCIDRs( - **vpn_gateway_connection_local_cid_rs_model_dict) + vpn_gateway_connection_local_cid_rs_model_dict = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json).__dict__ + vpn_gateway_connection_local_cid_rs_model2 = VPNGatewayConnectionLocalCIDRs(**vpn_gateway_connection_local_cid_rs_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_local_cid_rs_model == vpn_gateway_connection_local_cid_rs_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_local_cid_rs_model_json2 = vpn_gateway_connection_local_cid_rs_model.to_dict( - ) + vpn_gateway_connection_local_cid_rs_model_json2 = vpn_gateway_connection_local_cid_rs_model.to_dict() assert vpn_gateway_connection_local_cid_rs_model_json2 == vpn_gateway_connection_local_cid_rs_model_json - class TestVPNGatewayConnectionPeerCIDRs(): """ Test Class for VPNGatewayConnectionPeerCIDRs @@ -36754,30 +35959,23 @@ def test_vpn_gateway_connection_peer_cid_rs_serialization(self): # Construct a json representation of a VPNGatewayConnectionPeerCIDRs model vpn_gateway_connection_peer_cid_rs_model_json = {} - vpn_gateway_connection_peer_cid_rs_model_json['peer_cidrs'] = [ - '10.45.1.0/24' - ] + vpn_gateway_connection_peer_cid_rs_model_json['peer_cidrs'] = ['10.45.1.0/24'] # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation - vpn_gateway_connection_peer_cid_rs_model = VPNGatewayConnectionPeerCIDRs.from_dict( - vpn_gateway_connection_peer_cid_rs_model_json) + vpn_gateway_connection_peer_cid_rs_model = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json) assert vpn_gateway_connection_peer_cid_rs_model != False # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation - vpn_gateway_connection_peer_cid_rs_model_dict = VPNGatewayConnectionPeerCIDRs.from_dict( - vpn_gateway_connection_peer_cid_rs_model_json).__dict__ - vpn_gateway_connection_peer_cid_rs_model2 = VPNGatewayConnectionPeerCIDRs( - **vpn_gateway_connection_peer_cid_rs_model_dict) + vpn_gateway_connection_peer_cid_rs_model_dict = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json).__dict__ + vpn_gateway_connection_peer_cid_rs_model2 = VPNGatewayConnectionPeerCIDRs(**vpn_gateway_connection_peer_cid_rs_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_peer_cid_rs_model == vpn_gateway_connection_peer_cid_rs_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_peer_cid_rs_model_json2 = vpn_gateway_connection_peer_cid_rs_model.to_dict( - ) + vpn_gateway_connection_peer_cid_rs_model_json2 = vpn_gateway_connection_peer_cid_rs_model.to_dict() assert vpn_gateway_connection_peer_cid_rs_model_json2 == vpn_gateway_connection_peer_cid_rs_model_json - class TestVPNGatewayConnectionReference(): """ Test Class for VPNGatewayConnectionReference @@ -36790,44 +35988,32 @@ def test_vpn_gateway_connection_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a VPNGatewayConnectionReference model vpn_gateway_connection_reference_model_json = {} - vpn_gateway_connection_reference_model_json[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model_json[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' - vpn_gateway_connection_reference_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model_json[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection' # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation - vpn_gateway_connection_reference_model = VPNGatewayConnectionReference.from_dict( - vpn_gateway_connection_reference_model_json) + vpn_gateway_connection_reference_model = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json) assert vpn_gateway_connection_reference_model != False # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation - vpn_gateway_connection_reference_model_dict = VPNGatewayConnectionReference.from_dict( - vpn_gateway_connection_reference_model_json).__dict__ - vpn_gateway_connection_reference_model2 = VPNGatewayConnectionReference( - **vpn_gateway_connection_reference_model_dict) + vpn_gateway_connection_reference_model_dict = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json).__dict__ + vpn_gateway_connection_reference_model2 = VPNGatewayConnectionReference(**vpn_gateway_connection_reference_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_reference_model == vpn_gateway_connection_reference_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_reference_model_json2 = vpn_gateway_connection_reference_model.to_dict( - ) + vpn_gateway_connection_reference_model_json2 = vpn_gateway_connection_reference_model.to_dict() assert vpn_gateway_connection_reference_model_json2 == vpn_gateway_connection_reference_model_json - class TestVPNGatewayConnectionReferenceDeleted(): """ Test Class for VPNGatewayConnectionReferenceDeleted @@ -36840,72 +36026,58 @@ def test_vpn_gateway_connection_reference_deleted_serialization(self): # Construct a json representation of a VPNGatewayConnectionReferenceDeleted model vpn_gateway_connection_reference_deleted_model_json = {} - vpn_gateway_connection_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpn_gateway_connection_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation - vpn_gateway_connection_reference_deleted_model = VPNGatewayConnectionReferenceDeleted.from_dict( - vpn_gateway_connection_reference_deleted_model_json) + vpn_gateway_connection_reference_deleted_model = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json) assert vpn_gateway_connection_reference_deleted_model != False # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation - vpn_gateway_connection_reference_deleted_model_dict = VPNGatewayConnectionReferenceDeleted.from_dict( - vpn_gateway_connection_reference_deleted_model_json).__dict__ - vpn_gateway_connection_reference_deleted_model2 = VPNGatewayConnectionReferenceDeleted( - **vpn_gateway_connection_reference_deleted_model_dict) + vpn_gateway_connection_reference_deleted_model_dict = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json).__dict__ + vpn_gateway_connection_reference_deleted_model2 = VPNGatewayConnectionReferenceDeleted(**vpn_gateway_connection_reference_deleted_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_reference_deleted_model == vpn_gateway_connection_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_reference_deleted_model_json2 = vpn_gateway_connection_reference_deleted_model.to_dict( - ) + vpn_gateway_connection_reference_deleted_model_json2 = vpn_gateway_connection_reference_deleted_model.to_dict() assert vpn_gateway_connection_reference_deleted_model_json2 == vpn_gateway_connection_reference_deleted_model_json - class TestVPNGatewayConnectionStaticRouteModeTunnel(): """ Test Class for VPNGatewayConnectionStaticRouteModeTunnel """ - def test_vpn_gateway_connection_static_route_mode_tunnel_serialization( - self): + def test_vpn_gateway_connection_static_route_mode_tunnel_serialization(self): """ Test serialization/deserialization for VPNGatewayConnectionStaticRouteModeTunnel """ # Construct dict forms of any model objects needed in order to build this model. - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' # Construct a json representation of a VPNGatewayConnectionStaticRouteModeTunnel model vpn_gateway_connection_static_route_mode_tunnel_model_json = {} - vpn_gateway_connection_static_route_mode_tunnel_model_json[ - 'public_ip'] = ip_model - vpn_gateway_connection_static_route_mode_tunnel_model_json[ - 'status'] = 'up' + vpn_gateway_connection_static_route_mode_tunnel_model_json['public_ip'] = ip_model + vpn_gateway_connection_static_route_mode_tunnel_model_json['status'] = 'up' # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation - vpn_gateway_connection_static_route_mode_tunnel_model = VPNGatewayConnectionStaticRouteModeTunnel.from_dict( - vpn_gateway_connection_static_route_mode_tunnel_model_json) + vpn_gateway_connection_static_route_mode_tunnel_model = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json) assert vpn_gateway_connection_static_route_mode_tunnel_model != False # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation - vpn_gateway_connection_static_route_mode_tunnel_model_dict = VPNGatewayConnectionStaticRouteModeTunnel.from_dict( - vpn_gateway_connection_static_route_mode_tunnel_model_json).__dict__ - vpn_gateway_connection_static_route_mode_tunnel_model2 = VPNGatewayConnectionStaticRouteModeTunnel( - **vpn_gateway_connection_static_route_mode_tunnel_model_dict) + vpn_gateway_connection_static_route_mode_tunnel_model_dict = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json).__dict__ + vpn_gateway_connection_static_route_mode_tunnel_model2 = VPNGatewayConnectionStaticRouteModeTunnel(**vpn_gateway_connection_static_route_mode_tunnel_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_static_route_mode_tunnel_model == vpn_gateway_connection_static_route_mode_tunnel_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_static_route_mode_tunnel_model_json2 = vpn_gateway_connection_static_route_mode_tunnel_model.to_dict( - ) + vpn_gateway_connection_static_route_mode_tunnel_model_json2 = vpn_gateway_connection_static_route_mode_tunnel_model.to_dict() assert vpn_gateway_connection_static_route_mode_tunnel_model_json2 == vpn_gateway_connection_static_route_mode_tunnel_model_json - class TestVPNGatewayMember(): """ Test Class for VPNGatewayMember @@ -36918,7 +36090,7 @@ def test_vpn_gateway_member_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' # Construct a json representation of a VPNGatewayMember model @@ -36929,15 +36101,12 @@ def test_vpn_gateway_member_serialization(self): vpn_gateway_member_model_json['status'] = 'available' # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation - vpn_gateway_member_model = VPNGatewayMember.from_dict( - vpn_gateway_member_model_json) + vpn_gateway_member_model = VPNGatewayMember.from_dict(vpn_gateway_member_model_json) assert vpn_gateway_member_model != False # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation - vpn_gateway_member_model_dict = VPNGatewayMember.from_dict( - vpn_gateway_member_model_json).__dict__ - vpn_gateway_member_model2 = VPNGatewayMember( - **vpn_gateway_member_model_dict) + vpn_gateway_member_model_dict = VPNGatewayMember.from_dict(vpn_gateway_member_model_json).__dict__ + vpn_gateway_member_model2 = VPNGatewayMember(**vpn_gateway_member_model_dict) # Verify the model instances are equivalent assert vpn_gateway_member_model == vpn_gateway_member_model2 @@ -36946,7 +36115,6 @@ def test_vpn_gateway_member_serialization(self): vpn_gateway_member_model_json2 = vpn_gateway_member_model.to_dict() assert vpn_gateway_member_model_json2 == vpn_gateway_member_model_json - class TestVPNGatewayPatch(): """ Test Class for VPNGatewayPatch @@ -36962,15 +36130,12 @@ def test_vpn_gateway_patch_serialization(self): vpn_gateway_patch_model_json['name'] = 'my-vpn-gateway' # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation - vpn_gateway_patch_model = VPNGatewayPatch.from_dict( - vpn_gateway_patch_model_json) + vpn_gateway_patch_model = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json) assert vpn_gateway_patch_model != False # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation - vpn_gateway_patch_model_dict = VPNGatewayPatch.from_dict( - vpn_gateway_patch_model_json).__dict__ - vpn_gateway_patch_model2 = VPNGatewayPatch( - **vpn_gateway_patch_model_dict) + vpn_gateway_patch_model_dict = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json).__dict__ + vpn_gateway_patch_model2 = VPNGatewayPatch(**vpn_gateway_patch_model_dict) # Verify the model instances are equivalent assert vpn_gateway_patch_model == vpn_gateway_patch_model2 @@ -36979,7 +36144,6 @@ def test_vpn_gateway_patch_serialization(self): vpn_gateway_patch_model_json2 = vpn_gateway_patch_model.to_dict() assert vpn_gateway_patch_model_json2 == vpn_gateway_patch_model_json - class TestVolume(): """ Test Class for Volume @@ -36992,83 +36156,61 @@ def test_volume_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_reference_model = {} # VolumeProfileReference - volume_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_reference_model = {} # VolumeProfileReference + volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' volume_profile_reference_model['name'] = 'general-purpose' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - volume_status_reason_model = {} # VolumeStatusReason + volume_status_reason_model = {} # VolumeStatusReason volume_status_reason_model['code'] = 'encryption_key_deleted' volume_status_reason_model['message'] = 'testString' - volume_status_reason_model[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' - volume_attachment_reference_volume_context_deleted_model = { - } # VolumeAttachmentReferenceVolumeContextDeleted - volume_attachment_reference_volume_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted + volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - volume_attachment_reference_volume_context_model = { - } # VolumeAttachmentReferenceVolumeContext - volume_attachment_reference_volume_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_reference_volume_context_model[ - 'deleted'] = volume_attachment_reference_volume_context_deleted_model - volume_attachment_reference_volume_context_model[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model[ - 'instance'] = instance_reference_model - volume_attachment_reference_volume_context_model[ - 'name'] = 'my-volume-attachment' + volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext + volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model + volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model + volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['instance'] = instance_reference_model + volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment' volume_attachment_reference_volume_context_model['type'] = 'boot' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a Volume model volume_model_json = {} volume_model_json['capacity'] = 100 - volume_model_json['created_at'] = '2020-01-28T18:40:40.123456Z' - volume_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['encryption'] = 'provider_managed' volume_model_json['encryption_key'] = encryption_key_reference_model - volume_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['iops'] = 10000 volume_model_json['name'] = 'my-volume' @@ -37076,9 +36218,7 @@ def test_volume_serialization(self): volume_model_json['resource_group'] = resource_group_reference_model volume_model_json['status'] = 'available' volume_model_json['status_reasons'] = [volume_status_reason_model] - volume_model_json['volume_attachments'] = [ - volume_attachment_reference_volume_context_model - ] + volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model] volume_model_json['zone'] = zone_reference_model # Construct a model instance of Volume by calling from_dict on the json representation @@ -37096,7 +36236,6 @@ def test_volume_serialization(self): volume_model_json2 = volume_model.to_dict() assert volume_model_json2 == volume_model_json - class TestVolumeAttachment(): """ Test Class for VolumeAttachment @@ -37109,48 +36248,38 @@ def test_volume_attachment_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_reference_model = {} # VolumeReference - volume_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model = {} # VolumeReference + volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['deleted'] = volume_reference_deleted_model - volume_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['name'] = 'my-volume' # Construct a json representation of a VolumeAttachment model volume_attachment_model_json = {} - volume_attachment_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' + volume_attachment_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) volume_attachment_model_json['delete_volume_on_instance_delete'] = True volume_attachment_model_json['device'] = volume_attachment_device_model - volume_attachment_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_model_json[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_model_json['name'] = 'my-volume-attachment' volume_attachment_model_json['status'] = 'attached' volume_attachment_model_json['type'] = 'boot' volume_attachment_model_json['volume'] = volume_reference_model # Construct a model instance of VolumeAttachment by calling from_dict on the json representation - volume_attachment_model = VolumeAttachment.from_dict( - volume_attachment_model_json) + volume_attachment_model = VolumeAttachment.from_dict(volume_attachment_model_json) assert volume_attachment_model != False # Construct a model instance of VolumeAttachment by calling from_dict on the json representation - volume_attachment_model_dict = VolumeAttachment.from_dict( - volume_attachment_model_json).__dict__ - volume_attachment_model2 = VolumeAttachment( - **volume_attachment_model_dict) + volume_attachment_model_dict = VolumeAttachment.from_dict(volume_attachment_model_json).__dict__ + volume_attachment_model2 = VolumeAttachment(**volume_attachment_model_dict) # Verify the model instances are equivalent assert volume_attachment_model == volume_attachment_model2 @@ -37159,7 +36288,6 @@ def test_volume_attachment_serialization(self): volume_attachment_model_json2 = volume_attachment_model.to_dict() assert volume_attachment_model_json2 == volume_attachment_model_json - class TestVolumeAttachmentCollection(): """ Test Class for VolumeAttachmentCollection @@ -37172,29 +36300,24 @@ def test_volume_attachment_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_reference_model = {} # VolumeReference - volume_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model = {} # VolumeReference + volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['deleted'] = volume_reference_deleted_model - volume_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['name'] = 'my-volume' - volume_attachment_model = {} # VolumeAttachment - volume_attachment_model['created_at'] = '2020-01-28T18:40:40.123456Z' + volume_attachment_model = {} # VolumeAttachment + volume_attachment_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) volume_attachment_model['delete_volume_on_instance_delete'] = True volume_attachment_model['device'] = volume_attachment_device_model - volume_attachment_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_model['name'] = 'my-volume-attachment' volume_attachment_model['status'] = 'attached' @@ -37203,30 +36326,23 @@ def test_volume_attachment_collection_serialization(self): # Construct a json representation of a VolumeAttachmentCollection model volume_attachment_collection_model_json = {} - volume_attachment_collection_model_json['volume_attachments'] = [ - volume_attachment_model - ] + volume_attachment_collection_model_json['volume_attachments'] = [volume_attachment_model] # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation - volume_attachment_collection_model = VolumeAttachmentCollection.from_dict( - volume_attachment_collection_model_json) + volume_attachment_collection_model = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json) assert volume_attachment_collection_model != False # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation - volume_attachment_collection_model_dict = VolumeAttachmentCollection.from_dict( - volume_attachment_collection_model_json).__dict__ - volume_attachment_collection_model2 = VolumeAttachmentCollection( - **volume_attachment_collection_model_dict) + volume_attachment_collection_model_dict = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json).__dict__ + volume_attachment_collection_model2 = VolumeAttachmentCollection(**volume_attachment_collection_model_dict) # Verify the model instances are equivalent assert volume_attachment_collection_model == volume_attachment_collection_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_collection_model_json2 = volume_attachment_collection_model.to_dict( - ) + volume_attachment_collection_model_json2 = volume_attachment_collection_model.to_dict() assert volume_attachment_collection_model_json2 == volume_attachment_collection_model_json - class TestVolumeAttachmentDevice(): """ Test Class for VolumeAttachmentDevice @@ -37239,29 +36355,23 @@ def test_volume_attachment_device_serialization(self): # Construct a json representation of a VolumeAttachmentDevice model volume_attachment_device_model_json = {} - volume_attachment_device_model_json[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model_json['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation - volume_attachment_device_model = VolumeAttachmentDevice.from_dict( - volume_attachment_device_model_json) + volume_attachment_device_model = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json) assert volume_attachment_device_model != False # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation - volume_attachment_device_model_dict = VolumeAttachmentDevice.from_dict( - volume_attachment_device_model_json).__dict__ - volume_attachment_device_model2 = VolumeAttachmentDevice( - **volume_attachment_device_model_dict) + volume_attachment_device_model_dict = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json).__dict__ + volume_attachment_device_model2 = VolumeAttachmentDevice(**volume_attachment_device_model_dict) # Verify the model instances are equivalent assert volume_attachment_device_model == volume_attachment_device_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_device_model_json2 = volume_attachment_device_model.to_dict( - ) + volume_attachment_device_model_json2 = volume_attachment_device_model.to_dict() assert volume_attachment_device_model_json2 == volume_attachment_device_model_json - class TestVolumeAttachmentPatch(): """ Test Class for VolumeAttachmentPatch @@ -37274,90 +36384,70 @@ def test_volume_attachment_patch_serialization(self): # Construct a json representation of a VolumeAttachmentPatch model volume_attachment_patch_model_json = {} - volume_attachment_patch_model_json[ - 'delete_volume_on_instance_delete'] = True + volume_attachment_patch_model_json['delete_volume_on_instance_delete'] = True volume_attachment_patch_model_json['name'] = 'my-volume-attachment' # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation - volume_attachment_patch_model = VolumeAttachmentPatch.from_dict( - volume_attachment_patch_model_json) + volume_attachment_patch_model = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json) assert volume_attachment_patch_model != False # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation - volume_attachment_patch_model_dict = VolumeAttachmentPatch.from_dict( - volume_attachment_patch_model_json).__dict__ - volume_attachment_patch_model2 = VolumeAttachmentPatch( - **volume_attachment_patch_model_dict) + volume_attachment_patch_model_dict = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json).__dict__ + volume_attachment_patch_model2 = VolumeAttachmentPatch(**volume_attachment_patch_model_dict) # Verify the model instances are equivalent assert volume_attachment_patch_model == volume_attachment_patch_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_patch_model_json2 = volume_attachment_patch_model.to_dict( - ) + volume_attachment_patch_model_json2 = volume_attachment_patch_model.to_dict() assert volume_attachment_patch_model_json2 == volume_attachment_patch_model_json - class TestVolumeAttachmentPrototypeInstanceByImageContext(): """ Test Class for VolumeAttachmentPrototypeInstanceByImageContext """ - def test_volume_attachment_prototype_instance_by_image_context_serialization( - self): + def test_volume_attachment_prototype_instance_by_image_context_serialization(self): """ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByImageContext """ # Construct dict forms of any model objects needed in order to build this model. - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model # Construct a json representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model_json = {} - volume_attachment_prototype_instance_by_image_context_model_json[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model_json[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model_json[ - 'volume'] = volume_prototype_instance_by_image_context_model + volume_attachment_prototype_instance_by_image_context_model_json['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model_json['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model_json['volume'] = volume_prototype_instance_by_image_context_model # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation - volume_attachment_prototype_instance_by_image_context_model = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - volume_attachment_prototype_instance_by_image_context_model_json) + volume_attachment_prototype_instance_by_image_context_model = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json) assert volume_attachment_prototype_instance_by_image_context_model != False # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation - volume_attachment_prototype_instance_by_image_context_model_dict = VolumeAttachmentPrototypeInstanceByImageContext.from_dict( - volume_attachment_prototype_instance_by_image_context_model_json - ).__dict__ - volume_attachment_prototype_instance_by_image_context_model2 = VolumeAttachmentPrototypeInstanceByImageContext( - **volume_attachment_prototype_instance_by_image_context_model_dict) + volume_attachment_prototype_instance_by_image_context_model_dict = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json).__dict__ + volume_attachment_prototype_instance_by_image_context_model2 = VolumeAttachmentPrototypeInstanceByImageContext(**volume_attachment_prototype_instance_by_image_context_model_dict) # Verify the model instances are equivalent assert volume_attachment_prototype_instance_by_image_context_model == volume_attachment_prototype_instance_by_image_context_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_prototype_instance_by_image_context_model_json2 = volume_attachment_prototype_instance_by_image_context_model.to_dict( - ) + volume_attachment_prototype_instance_by_image_context_model_json2 = volume_attachment_prototype_instance_by_image_context_model.to_dict() assert volume_attachment_prototype_instance_by_image_context_model_json2 == volume_attachment_prototype_instance_by_image_context_model_json - class TestVolumeAttachmentPrototypeInstanceContext(): """ Test Class for VolumeAttachmentPrototypeInstanceContext @@ -37370,40 +36460,30 @@ def test_volume_attachment_prototype_instance_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a json representation of a VolumeAttachmentPrototypeInstanceContext model volume_attachment_prototype_instance_context_model_json = {} - volume_attachment_prototype_instance_context_model_json[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model_json[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model_json[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model + volume_attachment_prototype_instance_context_model_json['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model_json['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model_json['volume'] = volume_attachment_volume_prototype_instance_context_model # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation - volume_attachment_prototype_instance_context_model = VolumeAttachmentPrototypeInstanceContext.from_dict( - volume_attachment_prototype_instance_context_model_json) + volume_attachment_prototype_instance_context_model = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json) assert volume_attachment_prototype_instance_context_model != False # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation - volume_attachment_prototype_instance_context_model_dict = VolumeAttachmentPrototypeInstanceContext.from_dict( - volume_attachment_prototype_instance_context_model_json).__dict__ - volume_attachment_prototype_instance_context_model2 = VolumeAttachmentPrototypeInstanceContext( - **volume_attachment_prototype_instance_context_model_dict) + volume_attachment_prototype_instance_context_model_dict = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json).__dict__ + volume_attachment_prototype_instance_context_model2 = VolumeAttachmentPrototypeInstanceContext(**volume_attachment_prototype_instance_context_model_dict) # Verify the model instances are equivalent assert volume_attachment_prototype_instance_context_model == volume_attachment_prototype_instance_context_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_prototype_instance_context_model_json2 = volume_attachment_prototype_instance_context_model.to_dict( - ) + volume_attachment_prototype_instance_context_model_json2 = volume_attachment_prototype_instance_context_model.to_dict() assert volume_attachment_prototype_instance_context_model_json2 == volume_attachment_prototype_instance_context_model_json - class TestVolumeAttachmentReferenceInstanceContext(): """ Test Class for VolumeAttachmentReferenceInstanceContext @@ -37416,100 +36496,75 @@ def test_volume_attachment_reference_instance_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_reference_instance_context_deleted_model = { - } # VolumeAttachmentReferenceInstanceContextDeleted - volume_attachment_reference_instance_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted + volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_reference_model = {} # VolumeReference - volume_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model = {} # VolumeReference + volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['deleted'] = volume_reference_deleted_model - volume_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model['name'] = 'my-volume' # Construct a json representation of a VolumeAttachmentReferenceInstanceContext model volume_attachment_reference_instance_context_model_json = {} - volume_attachment_reference_instance_context_model_json[ - 'deleted'] = volume_attachment_reference_instance_context_deleted_model - volume_attachment_reference_instance_context_model_json[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model_json[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_instance_context_model_json[ - 'name'] = 'my-volume-attachment' - volume_attachment_reference_instance_context_model_json[ - 'volume'] = volume_reference_model + volume_attachment_reference_instance_context_model_json['deleted'] = volume_attachment_reference_instance_context_deleted_model + volume_attachment_reference_instance_context_model_json['device'] = volume_attachment_device_model + volume_attachment_reference_instance_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model_json['name'] = 'my-volume-attachment' + volume_attachment_reference_instance_context_model_json['volume'] = volume_reference_model # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation - volume_attachment_reference_instance_context_model = VolumeAttachmentReferenceInstanceContext.from_dict( - volume_attachment_reference_instance_context_model_json) + volume_attachment_reference_instance_context_model = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json) assert volume_attachment_reference_instance_context_model != False # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation - volume_attachment_reference_instance_context_model_dict = VolumeAttachmentReferenceInstanceContext.from_dict( - volume_attachment_reference_instance_context_model_json).__dict__ - volume_attachment_reference_instance_context_model2 = VolumeAttachmentReferenceInstanceContext( - **volume_attachment_reference_instance_context_model_dict) + volume_attachment_reference_instance_context_model_dict = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json).__dict__ + volume_attachment_reference_instance_context_model2 = VolumeAttachmentReferenceInstanceContext(**volume_attachment_reference_instance_context_model_dict) # Verify the model instances are equivalent assert volume_attachment_reference_instance_context_model == volume_attachment_reference_instance_context_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_reference_instance_context_model_json2 = volume_attachment_reference_instance_context_model.to_dict( - ) + volume_attachment_reference_instance_context_model_json2 = volume_attachment_reference_instance_context_model.to_dict() assert volume_attachment_reference_instance_context_model_json2 == volume_attachment_reference_instance_context_model_json - class TestVolumeAttachmentReferenceInstanceContextDeleted(): """ Test Class for VolumeAttachmentReferenceInstanceContextDeleted """ - def test_volume_attachment_reference_instance_context_deleted_serialization( - self): + def test_volume_attachment_reference_instance_context_deleted_serialization(self): """ Test serialization/deserialization for VolumeAttachmentReferenceInstanceContextDeleted """ # Construct a json representation of a VolumeAttachmentReferenceInstanceContextDeleted model volume_attachment_reference_instance_context_deleted_model_json = {} - volume_attachment_reference_instance_context_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_instance_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation - volume_attachment_reference_instance_context_deleted_model = VolumeAttachmentReferenceInstanceContextDeleted.from_dict( - volume_attachment_reference_instance_context_deleted_model_json) + volume_attachment_reference_instance_context_deleted_model = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json) assert volume_attachment_reference_instance_context_deleted_model != False # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation - volume_attachment_reference_instance_context_deleted_model_dict = VolumeAttachmentReferenceInstanceContextDeleted.from_dict( - volume_attachment_reference_instance_context_deleted_model_json - ).__dict__ - volume_attachment_reference_instance_context_deleted_model2 = VolumeAttachmentReferenceInstanceContextDeleted( - **volume_attachment_reference_instance_context_deleted_model_dict) + volume_attachment_reference_instance_context_deleted_model_dict = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json).__dict__ + volume_attachment_reference_instance_context_deleted_model2 = VolumeAttachmentReferenceInstanceContextDeleted(**volume_attachment_reference_instance_context_deleted_model_dict) # Verify the model instances are equivalent assert volume_attachment_reference_instance_context_deleted_model == volume_attachment_reference_instance_context_deleted_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_reference_instance_context_deleted_model_json2 = volume_attachment_reference_instance_context_deleted_model.to_dict( - ) + volume_attachment_reference_instance_context_deleted_model_json2 = volume_attachment_reference_instance_context_deleted_model.to_dict() assert volume_attachment_reference_instance_context_deleted_model_json2 == volume_attachment_reference_instance_context_deleted_model_json - class TestVolumeAttachmentReferenceVolumeContext(): """ Test Class for VolumeAttachmentReferenceVolumeContext @@ -37522,103 +36577,77 @@ def test_volume_attachment_reference_volume_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_attachment_reference_volume_context_deleted_model = { - } # VolumeAttachmentReferenceVolumeContextDeleted - volume_attachment_reference_volume_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted + volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' # Construct a json representation of a VolumeAttachmentReferenceVolumeContext model volume_attachment_reference_volume_context_model_json = {} - volume_attachment_reference_volume_context_model_json[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_reference_volume_context_model_json[ - 'deleted'] = volume_attachment_reference_volume_context_deleted_model - volume_attachment_reference_volume_context_model_json[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model_json[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model_json[ - 'instance'] = instance_reference_model - volume_attachment_reference_volume_context_model_json[ - 'name'] = 'my-volume-attachment' + volume_attachment_reference_volume_context_model_json['delete_volume_on_instance_delete'] = True + volume_attachment_reference_volume_context_model_json['deleted'] = volume_attachment_reference_volume_context_deleted_model + volume_attachment_reference_volume_context_model_json['device'] = volume_attachment_device_model + volume_attachment_reference_volume_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model_json['instance'] = instance_reference_model + volume_attachment_reference_volume_context_model_json['name'] = 'my-volume-attachment' volume_attachment_reference_volume_context_model_json['type'] = 'boot' # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation - volume_attachment_reference_volume_context_model = VolumeAttachmentReferenceVolumeContext.from_dict( - volume_attachment_reference_volume_context_model_json) + volume_attachment_reference_volume_context_model = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json) assert volume_attachment_reference_volume_context_model != False # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation - volume_attachment_reference_volume_context_model_dict = VolumeAttachmentReferenceVolumeContext.from_dict( - volume_attachment_reference_volume_context_model_json).__dict__ - volume_attachment_reference_volume_context_model2 = VolumeAttachmentReferenceVolumeContext( - **volume_attachment_reference_volume_context_model_dict) + volume_attachment_reference_volume_context_model_dict = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json).__dict__ + volume_attachment_reference_volume_context_model2 = VolumeAttachmentReferenceVolumeContext(**volume_attachment_reference_volume_context_model_dict) # Verify the model instances are equivalent assert volume_attachment_reference_volume_context_model == volume_attachment_reference_volume_context_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_reference_volume_context_model_json2 = volume_attachment_reference_volume_context_model.to_dict( - ) + volume_attachment_reference_volume_context_model_json2 = volume_attachment_reference_volume_context_model.to_dict() assert volume_attachment_reference_volume_context_model_json2 == volume_attachment_reference_volume_context_model_json - class TestVolumeAttachmentReferenceVolumeContextDeleted(): """ Test Class for VolumeAttachmentReferenceVolumeContextDeleted """ - def test_volume_attachment_reference_volume_context_deleted_serialization( - self): + def test_volume_attachment_reference_volume_context_deleted_serialization(self): """ Test serialization/deserialization for VolumeAttachmentReferenceVolumeContextDeleted """ # Construct a json representation of a VolumeAttachmentReferenceVolumeContextDeleted model volume_attachment_reference_volume_context_deleted_model_json = {} - volume_attachment_reference_volume_context_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_volume_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation - volume_attachment_reference_volume_context_deleted_model = VolumeAttachmentReferenceVolumeContextDeleted.from_dict( - volume_attachment_reference_volume_context_deleted_model_json) + volume_attachment_reference_volume_context_deleted_model = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json) assert volume_attachment_reference_volume_context_deleted_model != False # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation - volume_attachment_reference_volume_context_deleted_model_dict = VolumeAttachmentReferenceVolumeContextDeleted.from_dict( - volume_attachment_reference_volume_context_deleted_model_json - ).__dict__ - volume_attachment_reference_volume_context_deleted_model2 = VolumeAttachmentReferenceVolumeContextDeleted( - **volume_attachment_reference_volume_context_deleted_model_dict) + volume_attachment_reference_volume_context_deleted_model_dict = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json).__dict__ + volume_attachment_reference_volume_context_deleted_model2 = VolumeAttachmentReferenceVolumeContextDeleted(**volume_attachment_reference_volume_context_deleted_model_dict) # Verify the model instances are equivalent assert volume_attachment_reference_volume_context_deleted_model == volume_attachment_reference_volume_context_deleted_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_reference_volume_context_deleted_model_json2 = volume_attachment_reference_volume_context_deleted_model.to_dict( - ) + volume_attachment_reference_volume_context_deleted_model_json2 = volume_attachment_reference_volume_context_deleted_model.to_dict() assert volume_attachment_reference_volume_context_deleted_model_json2 == volume_attachment_reference_volume_context_deleted_model_json - class TestVolumeCollection(): """ Test Class for VolumeCollection @@ -37631,90 +36660,66 @@ def test_volume_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_collection_first_model = {} # VolumeCollectionFirst - volume_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20' + volume_collection_first_model = {} # VolumeCollectionFirst + volume_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20' - volume_collection_next_model = {} # VolumeCollectionNext - volume_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + volume_collection_next_model = {} # VolumeCollectionNext + volume_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_reference_model = {} # VolumeProfileReference - volume_profile_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_reference_model = {} # VolumeProfileReference + volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' volume_profile_reference_model['name'] = 'general-purpose' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - volume_status_reason_model = {} # VolumeStatusReason + volume_status_reason_model = {} # VolumeStatusReason volume_status_reason_model['code'] = 'encryption_key_deleted' volume_status_reason_model['message'] = 'testString' - volume_status_reason_model[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' - volume_attachment_reference_volume_context_deleted_model = { - } # VolumeAttachmentReferenceVolumeContextDeleted - volume_attachment_reference_volume_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted + volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model[ - 'id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model = {} # VolumeAttachmentDevice + volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - instance_reference_model = {} # InstanceReference - instance_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model = {} # InstanceReference + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['deleted'] = instance_reference_deleted_model - instance_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_reference_model['name'] = 'my-instance' - volume_attachment_reference_volume_context_model = { - } # VolumeAttachmentReferenceVolumeContext - volume_attachment_reference_volume_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_reference_volume_context_model[ - 'deleted'] = volume_attachment_reference_volume_context_deleted_model - volume_attachment_reference_volume_context_model[ - 'device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model[ - 'id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' - volume_attachment_reference_volume_context_model[ - 'instance'] = instance_reference_model - volume_attachment_reference_volume_context_model[ - 'name'] = 'my-volume-attachment' + volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext + volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model + volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model + volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['instance'] = instance_reference_model + volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment' volume_attachment_reference_volume_context_model['type'] = 'boot' - zone_reference_model = {} # ZoneReference - zone_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - volume_model = {} # Volume + volume_model = {} # Volume volume_model['capacity'] = 100 - volume_model['created_at'] = '2020-01-28T18:40:40.123456Z' - volume_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_model['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + volume_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['encryption'] = 'provider_managed' volume_model['encryption_key'] = encryption_key_reference_model - volume_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['iops'] = 10000 volume_model['name'] = 'my-volume' @@ -37722,9 +36727,7 @@ def test_volume_collection_serialization(self): volume_model['resource_group'] = resource_group_reference_model volume_model['status'] = 'available' volume_model['status_reasons'] = [volume_status_reason_model] - volume_model['volume_attachments'] = [ - volume_attachment_reference_volume_context_model - ] + volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model] volume_model['zone'] = zone_reference_model # Construct a json representation of a VolumeCollection model @@ -37735,15 +36738,12 @@ def test_volume_collection_serialization(self): volume_collection_model_json['volumes'] = [volume_model] # Construct a model instance of VolumeCollection by calling from_dict on the json representation - volume_collection_model = VolumeCollection.from_dict( - volume_collection_model_json) + volume_collection_model = VolumeCollection.from_dict(volume_collection_model_json) assert volume_collection_model != False # Construct a model instance of VolumeCollection by calling from_dict on the json representation - volume_collection_model_dict = VolumeCollection.from_dict( - volume_collection_model_json).__dict__ - volume_collection_model2 = VolumeCollection( - **volume_collection_model_dict) + volume_collection_model_dict = VolumeCollection.from_dict(volume_collection_model_json).__dict__ + volume_collection_model2 = VolumeCollection(**volume_collection_model_dict) # Verify the model instances are equivalent assert volume_collection_model == volume_collection_model2 @@ -37752,7 +36752,6 @@ def test_volume_collection_serialization(self): volume_collection_model_json2 = volume_collection_model.to_dict() assert volume_collection_model_json2 == volume_collection_model_json - class TestVolumeCollectionFirst(): """ Test Class for VolumeCollectionFirst @@ -37765,29 +36764,23 @@ def test_volume_collection_first_serialization(self): # Construct a json representation of a VolumeCollectionFirst model volume_collection_first_model_json = {} - volume_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20' + volume_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20' # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation - volume_collection_first_model = VolumeCollectionFirst.from_dict( - volume_collection_first_model_json) + volume_collection_first_model = VolumeCollectionFirst.from_dict(volume_collection_first_model_json) assert volume_collection_first_model != False # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation - volume_collection_first_model_dict = VolumeCollectionFirst.from_dict( - volume_collection_first_model_json).__dict__ - volume_collection_first_model2 = VolumeCollectionFirst( - **volume_collection_first_model_dict) + volume_collection_first_model_dict = VolumeCollectionFirst.from_dict(volume_collection_first_model_json).__dict__ + volume_collection_first_model2 = VolumeCollectionFirst(**volume_collection_first_model_dict) # Verify the model instances are equivalent assert volume_collection_first_model == volume_collection_first_model2 # Convert model instance back to dict and verify no loss of data - volume_collection_first_model_json2 = volume_collection_first_model.to_dict( - ) + volume_collection_first_model_json2 = volume_collection_first_model.to_dict() assert volume_collection_first_model_json2 == volume_collection_first_model_json - class TestVolumeCollectionNext(): """ Test Class for VolumeCollectionNext @@ -37800,29 +36793,23 @@ def test_volume_collection_next_serialization(self): # Construct a json representation of a VolumeCollectionNext model volume_collection_next_model_json = {} - volume_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + volume_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation - volume_collection_next_model = VolumeCollectionNext.from_dict( - volume_collection_next_model_json) + volume_collection_next_model = VolumeCollectionNext.from_dict(volume_collection_next_model_json) assert volume_collection_next_model != False # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation - volume_collection_next_model_dict = VolumeCollectionNext.from_dict( - volume_collection_next_model_json).__dict__ - volume_collection_next_model2 = VolumeCollectionNext( - **volume_collection_next_model_dict) + volume_collection_next_model_dict = VolumeCollectionNext.from_dict(volume_collection_next_model_json).__dict__ + volume_collection_next_model2 = VolumeCollectionNext(**volume_collection_next_model_dict) # Verify the model instances are equivalent assert volume_collection_next_model == volume_collection_next_model2 # Convert model instance back to dict and verify no loss of data - volume_collection_next_model_json2 = volume_collection_next_model.to_dict( - ) + volume_collection_next_model_json2 = volume_collection_next_model.to_dict() assert volume_collection_next_model_json2 == volume_collection_next_model_json - class TestVolumePatch(): """ Test Class for VolumePatch @@ -37842,8 +36829,7 @@ def test_volume_patch_serialization(self): assert volume_patch_model != False # Construct a model instance of VolumePatch by calling from_dict on the json representation - volume_patch_model_dict = VolumePatch.from_dict( - volume_patch_model_json).__dict__ + volume_patch_model_dict = VolumePatch.from_dict(volume_patch_model_json).__dict__ volume_patch_model2 = VolumePatch(**volume_patch_model_dict) # Verify the model instances are equivalent @@ -37853,7 +36839,6 @@ def test_volume_patch_serialization(self): volume_patch_model_json2 = volume_patch_model.to_dict() assert volume_patch_model_json2 == volume_patch_model_json - class TestVolumeProfile(): """ Test Class for VolumeProfile @@ -37867,18 +36852,15 @@ def test_volume_profile_serialization(self): # Construct a json representation of a VolumeProfile model volume_profile_model_json = {} volume_profile_model_json['family'] = 'tiered' - volume_profile_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' volume_profile_model_json['name'] = 'general-purpose' # Construct a model instance of VolumeProfile by calling from_dict on the json representation - volume_profile_model = VolumeProfile.from_dict( - volume_profile_model_json) + volume_profile_model = VolumeProfile.from_dict(volume_profile_model_json) assert volume_profile_model != False # Construct a model instance of VolumeProfile by calling from_dict on the json representation - volume_profile_model_dict = VolumeProfile.from_dict( - volume_profile_model_json).__dict__ + volume_profile_model_dict = VolumeProfile.from_dict(volume_profile_model_json).__dict__ volume_profile_model2 = VolumeProfile(**volume_profile_model_dict) # Verify the model instances are equivalent @@ -37888,7 +36870,6 @@ def test_volume_profile_serialization(self): volume_profile_model_json2 = volume_profile_model.to_dict() assert volume_profile_model_json2 == volume_profile_model_json - class TestVolumeProfileCollection(): """ Test Class for VolumeProfileCollection @@ -37901,53 +36882,40 @@ def test_volume_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_profile_collection_first_model = { - } # VolumeProfileCollectionFirst - volume_profile_collection_first_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20' + volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst + volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20' - volume_profile_collection_next_model = {} # VolumeProfileCollectionNext - volume_profile_collection_next_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + volume_profile_collection_next_model = {} # VolumeProfileCollectionNext + volume_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - volume_profile_model = {} # VolumeProfile + volume_profile_model = {} # VolumeProfile volume_profile_model['family'] = 'tiered' - volume_profile_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' volume_profile_model['name'] = 'general-purpose' # Construct a json representation of a VolumeProfileCollection model volume_profile_collection_model_json = {} - volume_profile_collection_model_json[ - 'first'] = volume_profile_collection_first_model + volume_profile_collection_model_json['first'] = volume_profile_collection_first_model volume_profile_collection_model_json['limit'] = 20 - volume_profile_collection_model_json[ - 'next'] = volume_profile_collection_next_model - volume_profile_collection_model_json['profiles'] = [ - volume_profile_model - ] + volume_profile_collection_model_json['next'] = volume_profile_collection_next_model + volume_profile_collection_model_json['profiles'] = [volume_profile_model] volume_profile_collection_model_json['total_count'] = 132 # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation - volume_profile_collection_model = VolumeProfileCollection.from_dict( - volume_profile_collection_model_json) + volume_profile_collection_model = VolumeProfileCollection.from_dict(volume_profile_collection_model_json) assert volume_profile_collection_model != False # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation - volume_profile_collection_model_dict = VolumeProfileCollection.from_dict( - volume_profile_collection_model_json).__dict__ - volume_profile_collection_model2 = VolumeProfileCollection( - **volume_profile_collection_model_dict) + volume_profile_collection_model_dict = VolumeProfileCollection.from_dict(volume_profile_collection_model_json).__dict__ + volume_profile_collection_model2 = VolumeProfileCollection(**volume_profile_collection_model_dict) # Verify the model instances are equivalent assert volume_profile_collection_model == volume_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_collection_model_json2 = volume_profile_collection_model.to_dict( - ) + volume_profile_collection_model_json2 = volume_profile_collection_model.to_dict() assert volume_profile_collection_model_json2 == volume_profile_collection_model_json - class TestVolumeProfileCollectionFirst(): """ Test Class for VolumeProfileCollectionFirst @@ -37960,29 +36928,23 @@ def test_volume_profile_collection_first_serialization(self): # Construct a json representation of a VolumeProfileCollectionFirst model volume_profile_collection_first_model_json = {} - volume_profile_collection_first_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20' + volume_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20' # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation - volume_profile_collection_first_model = VolumeProfileCollectionFirst.from_dict( - volume_profile_collection_first_model_json) + volume_profile_collection_first_model = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json) assert volume_profile_collection_first_model != False # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation - volume_profile_collection_first_model_dict = VolumeProfileCollectionFirst.from_dict( - volume_profile_collection_first_model_json).__dict__ - volume_profile_collection_first_model2 = VolumeProfileCollectionFirst( - **volume_profile_collection_first_model_dict) + volume_profile_collection_first_model_dict = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json).__dict__ + volume_profile_collection_first_model2 = VolumeProfileCollectionFirst(**volume_profile_collection_first_model_dict) # Verify the model instances are equivalent assert volume_profile_collection_first_model == volume_profile_collection_first_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_collection_first_model_json2 = volume_profile_collection_first_model.to_dict( - ) + volume_profile_collection_first_model_json2 = volume_profile_collection_first_model.to_dict() assert volume_profile_collection_first_model_json2 == volume_profile_collection_first_model_json - class TestVolumeProfileCollectionNext(): """ Test Class for VolumeProfileCollectionNext @@ -37995,29 +36957,23 @@ def test_volume_profile_collection_next_serialization(self): # Construct a json representation of a VolumeProfileCollectionNext model volume_profile_collection_next_model_json = {} - volume_profile_collection_next_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + volume_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation - volume_profile_collection_next_model = VolumeProfileCollectionNext.from_dict( - volume_profile_collection_next_model_json) + volume_profile_collection_next_model = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json) assert volume_profile_collection_next_model != False # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation - volume_profile_collection_next_model_dict = VolumeProfileCollectionNext.from_dict( - volume_profile_collection_next_model_json).__dict__ - volume_profile_collection_next_model2 = VolumeProfileCollectionNext( - **volume_profile_collection_next_model_dict) + volume_profile_collection_next_model_dict = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json).__dict__ + volume_profile_collection_next_model2 = VolumeProfileCollectionNext(**volume_profile_collection_next_model_dict) # Verify the model instances are equivalent assert volume_profile_collection_next_model == volume_profile_collection_next_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_collection_next_model_json2 = volume_profile_collection_next_model.to_dict( - ) + volume_profile_collection_next_model_json2 = volume_profile_collection_next_model.to_dict() assert volume_profile_collection_next_model_json2 == volume_profile_collection_next_model_json - class TestVolumeProfileReference(): """ Test Class for VolumeProfileReference @@ -38030,30 +36986,24 @@ def test_volume_profile_reference_serialization(self): # Construct a json representation of a VolumeProfileReference model volume_profile_reference_model_json = {} - volume_profile_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' volume_profile_reference_model_json['name'] = 'general-purpose' # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation - volume_profile_reference_model = VolumeProfileReference.from_dict( - volume_profile_reference_model_json) + volume_profile_reference_model = VolumeProfileReference.from_dict(volume_profile_reference_model_json) assert volume_profile_reference_model != False # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation - volume_profile_reference_model_dict = VolumeProfileReference.from_dict( - volume_profile_reference_model_json).__dict__ - volume_profile_reference_model2 = VolumeProfileReference( - **volume_profile_reference_model_dict) + volume_profile_reference_model_dict = VolumeProfileReference.from_dict(volume_profile_reference_model_json).__dict__ + volume_profile_reference_model2 = VolumeProfileReference(**volume_profile_reference_model_dict) # Verify the model instances are equivalent assert volume_profile_reference_model == volume_profile_reference_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_reference_model_json2 = volume_profile_reference_model.to_dict( - ) + volume_profile_reference_model_json2 = volume_profile_reference_model.to_dict() assert volume_profile_reference_model_json2 == volume_profile_reference_model_json - class TestVolumePrototypeInstanceByImageContext(): """ Test Class for VolumePrototypeInstanceByImageContext @@ -38066,44 +37016,35 @@ def test_volume_prototype_instance_by_image_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' # Construct a json representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model_json = {} volume_prototype_instance_by_image_context_model_json['capacity'] = 100 - volume_prototype_instance_by_image_context_model_json[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model_json['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model_json['iops'] = 10000 - volume_prototype_instance_by_image_context_model_json[ - 'name'] = 'my-volume' - volume_prototype_instance_by_image_context_model_json[ - 'profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume' + volume_prototype_instance_by_image_context_model_json['profile'] = volume_profile_identity_model # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation - volume_prototype_instance_by_image_context_model = VolumePrototypeInstanceByImageContext.from_dict( - volume_prototype_instance_by_image_context_model_json) + volume_prototype_instance_by_image_context_model = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json) assert volume_prototype_instance_by_image_context_model != False # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation - volume_prototype_instance_by_image_context_model_dict = VolumePrototypeInstanceByImageContext.from_dict( - volume_prototype_instance_by_image_context_model_json).__dict__ - volume_prototype_instance_by_image_context_model2 = VolumePrototypeInstanceByImageContext( - **volume_prototype_instance_by_image_context_model_dict) + volume_prototype_instance_by_image_context_model_dict = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json).__dict__ + volume_prototype_instance_by_image_context_model2 = VolumePrototypeInstanceByImageContext(**volume_prototype_instance_by_image_context_model_dict) # Verify the model instances are equivalent assert volume_prototype_instance_by_image_context_model == volume_prototype_instance_by_image_context_model2 # Convert model instance back to dict and verify no loss of data - volume_prototype_instance_by_image_context_model_json2 = volume_prototype_instance_by_image_context_model.to_dict( - ) + volume_prototype_instance_by_image_context_model_json2 = volume_prototype_instance_by_image_context_model.to_dict() assert volume_prototype_instance_by_image_context_model_json2 == volume_prototype_instance_by_image_context_model_json - class TestVolumeReference(): """ Test Class for VolumeReference @@ -38116,29 +37057,23 @@ def test_volume_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_reference_deleted_model = {} # VolumeReferenceDeleted - volume_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a VolumeReference model volume_reference_model_json = {} - volume_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model_json['deleted'] = volume_reference_deleted_model - volume_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - volume_reference_model_json[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_model_json['name'] = 'my-volume' # Construct a model instance of VolumeReference by calling from_dict on the json representation - volume_reference_model = VolumeReference.from_dict( - volume_reference_model_json) + volume_reference_model = VolumeReference.from_dict(volume_reference_model_json) assert volume_reference_model != False # Construct a model instance of VolumeReference by calling from_dict on the json representation - volume_reference_model_dict = VolumeReference.from_dict( - volume_reference_model_json).__dict__ + volume_reference_model_dict = VolumeReference.from_dict(volume_reference_model_json).__dict__ volume_reference_model2 = VolumeReference(**volume_reference_model_dict) # Verify the model instances are equivalent @@ -38148,7 +37083,6 @@ def test_volume_reference_serialization(self): volume_reference_model_json2 = volume_reference_model.to_dict() assert volume_reference_model_json2 == volume_reference_model_json - class TestVolumeReferenceDeleted(): """ Test Class for VolumeReferenceDeleted @@ -38161,29 +37095,23 @@ def test_volume_reference_deleted_serialization(self): # Construct a json representation of a VolumeReferenceDeleted model volume_reference_deleted_model_json = {} - volume_reference_deleted_model_json[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + volume_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation - volume_reference_deleted_model = VolumeReferenceDeleted.from_dict( - volume_reference_deleted_model_json) + volume_reference_deleted_model = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json) assert volume_reference_deleted_model != False # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation - volume_reference_deleted_model_dict = VolumeReferenceDeleted.from_dict( - volume_reference_deleted_model_json).__dict__ - volume_reference_deleted_model2 = VolumeReferenceDeleted( - **volume_reference_deleted_model_dict) + volume_reference_deleted_model_dict = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json).__dict__ + volume_reference_deleted_model2 = VolumeReferenceDeleted(**volume_reference_deleted_model_dict) # Verify the model instances are equivalent assert volume_reference_deleted_model == volume_reference_deleted_model2 # Convert model instance back to dict and verify no loss of data - volume_reference_deleted_model_json2 = volume_reference_deleted_model.to_dict( - ) + volume_reference_deleted_model_json2 = volume_reference_deleted_model.to_dict() assert volume_reference_deleted_model_json2 == volume_reference_deleted_model_json - class TestVolumeStatusReason(): """ Test Class for VolumeStatusReason @@ -38198,19 +37126,15 @@ def test_volume_status_reason_serialization(self): volume_status_reason_model_json = {} volume_status_reason_model_json['code'] = 'encryption_key_deleted' volume_status_reason_model_json['message'] = 'testString' - volume_status_reason_model_json[ - 'more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' + volume_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation - volume_status_reason_model = VolumeStatusReason.from_dict( - volume_status_reason_model_json) + volume_status_reason_model = VolumeStatusReason.from_dict(volume_status_reason_model_json) assert volume_status_reason_model != False # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation - volume_status_reason_model_dict = VolumeStatusReason.from_dict( - volume_status_reason_model_json).__dict__ - volume_status_reason_model2 = VolumeStatusReason( - **volume_status_reason_model_dict) + volume_status_reason_model_dict = VolumeStatusReason.from_dict(volume_status_reason_model_json).__dict__ + volume_status_reason_model2 = VolumeStatusReason(**volume_status_reason_model_dict) # Verify the model instances are equivalent assert volume_status_reason_model == volume_status_reason_model2 @@ -38219,7 +37143,6 @@ def test_volume_status_reason_serialization(self): volume_status_reason_model_json2 = volume_status_reason_model.to_dict() assert volume_status_reason_model_json2 == volume_status_reason_model_json - class TestZone(): """ Test Class for Zone @@ -38232,15 +37155,13 @@ def test_zone_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - region_reference_model = {} # RegionReference - region_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_reference_model['name'] = 'us-south' # Construct a json representation of a Zone model zone_model_json = {} - zone_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_model_json['name'] = 'us-south-1' zone_model_json['region'] = region_reference_model zone_model_json['status'] = 'available' @@ -38260,7 +37181,6 @@ def test_zone_serialization(self): zone_model_json2 = zone_model.to_dict() assert zone_model_json2 == zone_model_json - class TestZoneCollection(): """ Test Class for ZoneCollection @@ -38273,14 +37193,12 @@ def test_zone_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - region_reference_model = {} # RegionReference - region_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_reference_model['name'] = 'us-south' - zone_model = {} # Zone - zone_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_model = {} # Zone + zone_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_model['name'] = 'us-south-1' zone_model['region'] = region_reference_model zone_model['status'] = 'available' @@ -38290,13 +37208,11 @@ def test_zone_collection_serialization(self): zone_collection_model_json['zones'] = [zone_model] # Construct a model instance of ZoneCollection by calling from_dict on the json representation - zone_collection_model = ZoneCollection.from_dict( - zone_collection_model_json) + zone_collection_model = ZoneCollection.from_dict(zone_collection_model_json) assert zone_collection_model != False # Construct a model instance of ZoneCollection by calling from_dict on the json representation - zone_collection_model_dict = ZoneCollection.from_dict( - zone_collection_model_json).__dict__ + zone_collection_model_dict = ZoneCollection.from_dict(zone_collection_model_json).__dict__ zone_collection_model2 = ZoneCollection(**zone_collection_model_dict) # Verify the model instances are equivalent @@ -38306,7 +37222,6 @@ def test_zone_collection_serialization(self): zone_collection_model_json2 = zone_collection_model.to_dict() assert zone_collection_model_json2 == zone_collection_model_json - class TestZoneReference(): """ Test Class for ZoneReference @@ -38319,18 +37234,15 @@ def test_zone_reference_serialization(self): # Construct a json representation of a ZoneReference model zone_reference_model_json = {} - zone_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model_json['name'] = 'us-south-1' # Construct a model instance of ZoneReference by calling from_dict on the json representation - zone_reference_model = ZoneReference.from_dict( - zone_reference_model_json) + zone_reference_model = ZoneReference.from_dict(zone_reference_model_json) assert zone_reference_model != False # Construct a model instance of ZoneReference by calling from_dict on the json representation - zone_reference_model_dict = ZoneReference.from_dict( - zone_reference_model_json).__dict__ + zone_reference_model_dict = ZoneReference.from_dict(zone_reference_model_json).__dict__ zone_reference_model2 = ZoneReference(**zone_reference_model_dict) # Verify the model instances are equivalent @@ -38340,7 +37252,6 @@ def test_zone_reference_serialization(self): zone_reference_model_json2 = zone_reference_model.to_dict() assert zone_reference_model_json2 == zone_reference_model_json - class TestCertificateInstanceIdentityByCRN(): """ Test Class for CertificateInstanceIdentityByCRN @@ -38353,29 +37264,23 @@ def test_certificate_instance_identity_by_crn_serialization(self): # Construct a json representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_by_crn_model_json = {} - certificate_instance_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' # Construct a model instance of CertificateInstanceIdentityByCRN by calling from_dict on the json representation - certificate_instance_identity_by_crn_model = CertificateInstanceIdentityByCRN.from_dict( - certificate_instance_identity_by_crn_model_json) + certificate_instance_identity_by_crn_model = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json) assert certificate_instance_identity_by_crn_model != False # Construct a model instance of CertificateInstanceIdentityByCRN by calling from_dict on the json representation - certificate_instance_identity_by_crn_model_dict = CertificateInstanceIdentityByCRN.from_dict( - certificate_instance_identity_by_crn_model_json).__dict__ - certificate_instance_identity_by_crn_model2 = CertificateInstanceIdentityByCRN( - **certificate_instance_identity_by_crn_model_dict) + certificate_instance_identity_by_crn_model_dict = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json).__dict__ + certificate_instance_identity_by_crn_model2 = CertificateInstanceIdentityByCRN(**certificate_instance_identity_by_crn_model_dict) # Verify the model instances are equivalent assert certificate_instance_identity_by_crn_model == certificate_instance_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - certificate_instance_identity_by_crn_model_json2 = certificate_instance_identity_by_crn_model.to_dict( - ) + certificate_instance_identity_by_crn_model_json2 = certificate_instance_identity_by_crn_model.to_dict() assert certificate_instance_identity_by_crn_model_json2 == certificate_instance_identity_by_crn_model_json - class TestCloudObjectStorageBucketIdentityByName(): """ Test Class for CloudObjectStorageBucketIdentityByName @@ -38388,29 +37293,23 @@ def test_cloud_object_storage_bucket_identity_by_name_serialization(self): # Construct a json representation of a CloudObjectStorageBucketIdentityByName model cloud_object_storage_bucket_identity_by_name_model_json = {} - cloud_object_storage_bucket_identity_by_name_model_json[ - 'name'] = 'bucket-27200-lwx4cfvcue' + cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue' # Construct a model instance of CloudObjectStorageBucketIdentityByName by calling from_dict on the json representation - cloud_object_storage_bucket_identity_by_name_model = CloudObjectStorageBucketIdentityByName.from_dict( - cloud_object_storage_bucket_identity_by_name_model_json) + cloud_object_storage_bucket_identity_by_name_model = CloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_by_name_model_json) assert cloud_object_storage_bucket_identity_by_name_model != False # Construct a model instance of CloudObjectStorageBucketIdentityByName by calling from_dict on the json representation - cloud_object_storage_bucket_identity_by_name_model_dict = CloudObjectStorageBucketIdentityByName.from_dict( - cloud_object_storage_bucket_identity_by_name_model_json).__dict__ - cloud_object_storage_bucket_identity_by_name_model2 = CloudObjectStorageBucketIdentityByName( - **cloud_object_storage_bucket_identity_by_name_model_dict) + cloud_object_storage_bucket_identity_by_name_model_dict = CloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_by_name_model_json).__dict__ + cloud_object_storage_bucket_identity_by_name_model2 = CloudObjectStorageBucketIdentityByName(**cloud_object_storage_bucket_identity_by_name_model_dict) # Verify the model instances are equivalent assert cloud_object_storage_bucket_identity_by_name_model == cloud_object_storage_bucket_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - cloud_object_storage_bucket_identity_by_name_model_json2 = cloud_object_storage_bucket_identity_by_name_model.to_dict( - ) + cloud_object_storage_bucket_identity_by_name_model_json2 = cloud_object_storage_bucket_identity_by_name_model.to_dict() assert cloud_object_storage_bucket_identity_by_name_model_json2 == cloud_object_storage_bucket_identity_by_name_model_json - class TestDedicatedHostGroupIdentityByCRN(): """ Test Class for DedicatedHostGroupIdentityByCRN @@ -38423,29 +37322,23 @@ def test_dedicated_host_group_identity_by_crn_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityByCRN model dedicated_host_group_identity_by_crn_model_json = {} - dedicated_host_group_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation - dedicated_host_group_identity_by_crn_model = DedicatedHostGroupIdentityByCRN.from_dict( - dedicated_host_group_identity_by_crn_model_json) + dedicated_host_group_identity_by_crn_model = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json) assert dedicated_host_group_identity_by_crn_model != False # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation - dedicated_host_group_identity_by_crn_model_dict = DedicatedHostGroupIdentityByCRN.from_dict( - dedicated_host_group_identity_by_crn_model_json).__dict__ - dedicated_host_group_identity_by_crn_model2 = DedicatedHostGroupIdentityByCRN( - **dedicated_host_group_identity_by_crn_model_dict) + dedicated_host_group_identity_by_crn_model_dict = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json).__dict__ + dedicated_host_group_identity_by_crn_model2 = DedicatedHostGroupIdentityByCRN(**dedicated_host_group_identity_by_crn_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_identity_by_crn_model == dedicated_host_group_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_identity_by_crn_model_json2 = dedicated_host_group_identity_by_crn_model.to_dict( - ) + dedicated_host_group_identity_by_crn_model_json2 = dedicated_host_group_identity_by_crn_model.to_dict() assert dedicated_host_group_identity_by_crn_model_json2 == dedicated_host_group_identity_by_crn_model_json - class TestDedicatedHostGroupIdentityByHref(): """ Test Class for DedicatedHostGroupIdentityByHref @@ -38458,29 +37351,23 @@ def test_dedicated_host_group_identity_by_href_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityByHref model dedicated_host_group_identity_by_href_model_json = {} - dedicated_host_group_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation - dedicated_host_group_identity_by_href_model = DedicatedHostGroupIdentityByHref.from_dict( - dedicated_host_group_identity_by_href_model_json) + dedicated_host_group_identity_by_href_model = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json) assert dedicated_host_group_identity_by_href_model != False # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation - dedicated_host_group_identity_by_href_model_dict = DedicatedHostGroupIdentityByHref.from_dict( - dedicated_host_group_identity_by_href_model_json).__dict__ - dedicated_host_group_identity_by_href_model2 = DedicatedHostGroupIdentityByHref( - **dedicated_host_group_identity_by_href_model_dict) + dedicated_host_group_identity_by_href_model_dict = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json).__dict__ + dedicated_host_group_identity_by_href_model2 = DedicatedHostGroupIdentityByHref(**dedicated_host_group_identity_by_href_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_identity_by_href_model == dedicated_host_group_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_identity_by_href_model_json2 = dedicated_host_group_identity_by_href_model.to_dict( - ) + dedicated_host_group_identity_by_href_model_json2 = dedicated_host_group_identity_by_href_model.to_dict() assert dedicated_host_group_identity_by_href_model_json2 == dedicated_host_group_identity_by_href_model_json - class TestDedicatedHostGroupIdentityById(): """ Test Class for DedicatedHostGroupIdentityById @@ -38493,29 +37380,23 @@ def test_dedicated_host_group_identity_by_id_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityById model dedicated_host_group_identity_by_id_model_json = {} - dedicated_host_group_identity_by_id_model_json[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation - dedicated_host_group_identity_by_id_model = DedicatedHostGroupIdentityById.from_dict( - dedicated_host_group_identity_by_id_model_json) + dedicated_host_group_identity_by_id_model = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json) assert dedicated_host_group_identity_by_id_model != False # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation - dedicated_host_group_identity_by_id_model_dict = DedicatedHostGroupIdentityById.from_dict( - dedicated_host_group_identity_by_id_model_json).__dict__ - dedicated_host_group_identity_by_id_model2 = DedicatedHostGroupIdentityById( - **dedicated_host_group_identity_by_id_model_dict) + dedicated_host_group_identity_by_id_model_dict = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json).__dict__ + dedicated_host_group_identity_by_id_model2 = DedicatedHostGroupIdentityById(**dedicated_host_group_identity_by_id_model_dict) # Verify the model instances are equivalent assert dedicated_host_group_identity_by_id_model == dedicated_host_group_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_group_identity_by_id_model_json2 = dedicated_host_group_identity_by_id_model.to_dict( - ) + dedicated_host_group_identity_by_id_model_json2 = dedicated_host_group_identity_by_id_model.to_dict() assert dedicated_host_group_identity_by_id_model_json2 == dedicated_host_group_identity_by_id_model_json - class TestDedicatedHostProfileIdentityByHref(): """ Test Class for DedicatedHostProfileIdentityByHref @@ -38528,29 +37409,23 @@ def test_dedicated_host_profile_identity_by_href_serialization(self): # Construct a json representation of a DedicatedHostProfileIdentityByHref model dedicated_host_profile_identity_by_href_model_json = {} - dedicated_host_profile_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216' + dedicated_host_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216' # Construct a model instance of DedicatedHostProfileIdentityByHref by calling from_dict on the json representation - dedicated_host_profile_identity_by_href_model = DedicatedHostProfileIdentityByHref.from_dict( - dedicated_host_profile_identity_by_href_model_json) + dedicated_host_profile_identity_by_href_model = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json) assert dedicated_host_profile_identity_by_href_model != False # Construct a model instance of DedicatedHostProfileIdentityByHref by calling from_dict on the json representation - dedicated_host_profile_identity_by_href_model_dict = DedicatedHostProfileIdentityByHref.from_dict( - dedicated_host_profile_identity_by_href_model_json).__dict__ - dedicated_host_profile_identity_by_href_model2 = DedicatedHostProfileIdentityByHref( - **dedicated_host_profile_identity_by_href_model_dict) + dedicated_host_profile_identity_by_href_model_dict = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json).__dict__ + dedicated_host_profile_identity_by_href_model2 = DedicatedHostProfileIdentityByHref(**dedicated_host_profile_identity_by_href_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_identity_by_href_model == dedicated_host_profile_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_identity_by_href_model_json2 = dedicated_host_profile_identity_by_href_model.to_dict( - ) + dedicated_host_profile_identity_by_href_model_json2 = dedicated_host_profile_identity_by_href_model.to_dict() assert dedicated_host_profile_identity_by_href_model_json2 == dedicated_host_profile_identity_by_href_model_json - class TestDedicatedHostProfileIdentityByName(): """ Test Class for DedicatedHostProfileIdentityByName @@ -38563,29 +37438,23 @@ def test_dedicated_host_profile_identity_by_name_serialization(self): # Construct a json representation of a DedicatedHostProfileIdentityByName model dedicated_host_profile_identity_by_name_model_json = {} - dedicated_host_profile_identity_by_name_model_json[ - 'name'] = 'mx2-host-152x1216' + dedicated_host_profile_identity_by_name_model_json['name'] = 'mx2-host-152x1216' # Construct a model instance of DedicatedHostProfileIdentityByName by calling from_dict on the json representation - dedicated_host_profile_identity_by_name_model = DedicatedHostProfileIdentityByName.from_dict( - dedicated_host_profile_identity_by_name_model_json) + dedicated_host_profile_identity_by_name_model = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json) assert dedicated_host_profile_identity_by_name_model != False # Construct a model instance of DedicatedHostProfileIdentityByName by calling from_dict on the json representation - dedicated_host_profile_identity_by_name_model_dict = DedicatedHostProfileIdentityByName.from_dict( - dedicated_host_profile_identity_by_name_model_json).__dict__ - dedicated_host_profile_identity_by_name_model2 = DedicatedHostProfileIdentityByName( - **dedicated_host_profile_identity_by_name_model_dict) + dedicated_host_profile_identity_by_name_model_dict = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json).__dict__ + dedicated_host_profile_identity_by_name_model2 = DedicatedHostProfileIdentityByName(**dedicated_host_profile_identity_by_name_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_identity_by_name_model == dedicated_host_profile_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_identity_by_name_model_json2 = dedicated_host_profile_identity_by_name_model.to_dict( - ) + dedicated_host_profile_identity_by_name_model_json2 = dedicated_host_profile_identity_by_name_model.to_dict() assert dedicated_host_profile_identity_by_name_model_json2 == dedicated_host_profile_identity_by_name_model_json - class TestDedicatedHostProfileMemoryDependent(): """ Test Class for DedicatedHostProfileMemoryDependent @@ -38601,25 +37470,20 @@ def test_dedicated_host_profile_memory_dependent_serialization(self): dedicated_host_profile_memory_dependent_model_json['type'] = 'dependent' # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation - dedicated_host_profile_memory_dependent_model = DedicatedHostProfileMemoryDependent.from_dict( - dedicated_host_profile_memory_dependent_model_json) + dedicated_host_profile_memory_dependent_model = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json) assert dedicated_host_profile_memory_dependent_model != False # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation - dedicated_host_profile_memory_dependent_model_dict = DedicatedHostProfileMemoryDependent.from_dict( - dedicated_host_profile_memory_dependent_model_json).__dict__ - dedicated_host_profile_memory_dependent_model2 = DedicatedHostProfileMemoryDependent( - **dedicated_host_profile_memory_dependent_model_dict) + dedicated_host_profile_memory_dependent_model_dict = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json).__dict__ + dedicated_host_profile_memory_dependent_model2 = DedicatedHostProfileMemoryDependent(**dedicated_host_profile_memory_dependent_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_memory_dependent_model == dedicated_host_profile_memory_dependent_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_memory_dependent_model_json2 = dedicated_host_profile_memory_dependent_model.to_dict( - ) + dedicated_host_profile_memory_dependent_model_json2 = dedicated_host_profile_memory_dependent_model.to_dict() assert dedicated_host_profile_memory_dependent_model_json2 == dedicated_host_profile_memory_dependent_model_json - class TestDedicatedHostProfileMemoryEnum(): """ Test Class for DedicatedHostProfileMemoryEnum @@ -38637,25 +37501,20 @@ def test_dedicated_host_profile_memory_enum_serialization(self): dedicated_host_profile_memory_enum_model_json['values'] = [8, 16, 32] # Construct a model instance of DedicatedHostProfileMemoryEnum by calling from_dict on the json representation - dedicated_host_profile_memory_enum_model = DedicatedHostProfileMemoryEnum.from_dict( - dedicated_host_profile_memory_enum_model_json) + dedicated_host_profile_memory_enum_model = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json) assert dedicated_host_profile_memory_enum_model != False # Construct a model instance of DedicatedHostProfileMemoryEnum by calling from_dict on the json representation - dedicated_host_profile_memory_enum_model_dict = DedicatedHostProfileMemoryEnum.from_dict( - dedicated_host_profile_memory_enum_model_json).__dict__ - dedicated_host_profile_memory_enum_model2 = DedicatedHostProfileMemoryEnum( - **dedicated_host_profile_memory_enum_model_dict) + dedicated_host_profile_memory_enum_model_dict = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json).__dict__ + dedicated_host_profile_memory_enum_model2 = DedicatedHostProfileMemoryEnum(**dedicated_host_profile_memory_enum_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_memory_enum_model == dedicated_host_profile_memory_enum_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_memory_enum_model_json2 = dedicated_host_profile_memory_enum_model.to_dict( - ) + dedicated_host_profile_memory_enum_model_json2 = dedicated_host_profile_memory_enum_model.to_dict() assert dedicated_host_profile_memory_enum_model_json2 == dedicated_host_profile_memory_enum_model_json - class TestDedicatedHostProfileMemoryFixed(): """ Test Class for DedicatedHostProfileMemoryFixed @@ -38672,25 +37531,20 @@ def test_dedicated_host_profile_memory_fixed_serialization(self): dedicated_host_profile_memory_fixed_model_json['value'] = 16 # Construct a model instance of DedicatedHostProfileMemoryFixed by calling from_dict on the json representation - dedicated_host_profile_memory_fixed_model = DedicatedHostProfileMemoryFixed.from_dict( - dedicated_host_profile_memory_fixed_model_json) + dedicated_host_profile_memory_fixed_model = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json) assert dedicated_host_profile_memory_fixed_model != False # Construct a model instance of DedicatedHostProfileMemoryFixed by calling from_dict on the json representation - dedicated_host_profile_memory_fixed_model_dict = DedicatedHostProfileMemoryFixed.from_dict( - dedicated_host_profile_memory_fixed_model_json).__dict__ - dedicated_host_profile_memory_fixed_model2 = DedicatedHostProfileMemoryFixed( - **dedicated_host_profile_memory_fixed_model_dict) + dedicated_host_profile_memory_fixed_model_dict = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json).__dict__ + dedicated_host_profile_memory_fixed_model2 = DedicatedHostProfileMemoryFixed(**dedicated_host_profile_memory_fixed_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_memory_fixed_model == dedicated_host_profile_memory_fixed_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_memory_fixed_model_json2 = dedicated_host_profile_memory_fixed_model.to_dict( - ) + dedicated_host_profile_memory_fixed_model_json2 = dedicated_host_profile_memory_fixed_model.to_dict() assert dedicated_host_profile_memory_fixed_model_json2 == dedicated_host_profile_memory_fixed_model_json - class TestDedicatedHostProfileMemoryRange(): """ Test Class for DedicatedHostProfileMemoryRange @@ -38710,25 +37564,20 @@ def test_dedicated_host_profile_memory_range_serialization(self): dedicated_host_profile_memory_range_model_json['type'] = 'range' # Construct a model instance of DedicatedHostProfileMemoryRange by calling from_dict on the json representation - dedicated_host_profile_memory_range_model = DedicatedHostProfileMemoryRange.from_dict( - dedicated_host_profile_memory_range_model_json) + dedicated_host_profile_memory_range_model = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json) assert dedicated_host_profile_memory_range_model != False # Construct a model instance of DedicatedHostProfileMemoryRange by calling from_dict on the json representation - dedicated_host_profile_memory_range_model_dict = DedicatedHostProfileMemoryRange.from_dict( - dedicated_host_profile_memory_range_model_json).__dict__ - dedicated_host_profile_memory_range_model2 = DedicatedHostProfileMemoryRange( - **dedicated_host_profile_memory_range_model_dict) + dedicated_host_profile_memory_range_model_dict = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json).__dict__ + dedicated_host_profile_memory_range_model2 = DedicatedHostProfileMemoryRange(**dedicated_host_profile_memory_range_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_memory_range_model == dedicated_host_profile_memory_range_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_memory_range_model_json2 = dedicated_host_profile_memory_range_model.to_dict( - ) + dedicated_host_profile_memory_range_model_json2 = dedicated_host_profile_memory_range_model.to_dict() assert dedicated_host_profile_memory_range_model_json2 == dedicated_host_profile_memory_range_model_json - class TestDedicatedHostProfileSocketDependent(): """ Test Class for DedicatedHostProfileSocketDependent @@ -38744,25 +37593,20 @@ def test_dedicated_host_profile_socket_dependent_serialization(self): dedicated_host_profile_socket_dependent_model_json['type'] = 'dependent' # Construct a model instance of DedicatedHostProfileSocketDependent by calling from_dict on the json representation - dedicated_host_profile_socket_dependent_model = DedicatedHostProfileSocketDependent.from_dict( - dedicated_host_profile_socket_dependent_model_json) + dedicated_host_profile_socket_dependent_model = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json) assert dedicated_host_profile_socket_dependent_model != False # Construct a model instance of DedicatedHostProfileSocketDependent by calling from_dict on the json representation - dedicated_host_profile_socket_dependent_model_dict = DedicatedHostProfileSocketDependent.from_dict( - dedicated_host_profile_socket_dependent_model_json).__dict__ - dedicated_host_profile_socket_dependent_model2 = DedicatedHostProfileSocketDependent( - **dedicated_host_profile_socket_dependent_model_dict) + dedicated_host_profile_socket_dependent_model_dict = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json).__dict__ + dedicated_host_profile_socket_dependent_model2 = DedicatedHostProfileSocketDependent(**dedicated_host_profile_socket_dependent_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_socket_dependent_model == dedicated_host_profile_socket_dependent_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_socket_dependent_model_json2 = dedicated_host_profile_socket_dependent_model.to_dict( - ) + dedicated_host_profile_socket_dependent_model_json2 = dedicated_host_profile_socket_dependent_model.to_dict() assert dedicated_host_profile_socket_dependent_model_json2 == dedicated_host_profile_socket_dependent_model_json - class TestDedicatedHostProfileSocketEnum(): """ Test Class for DedicatedHostProfileSocketEnum @@ -38780,25 +37624,20 @@ def test_dedicated_host_profile_socket_enum_serialization(self): dedicated_host_profile_socket_enum_model_json['values'] = [2, 4, 8] # Construct a model instance of DedicatedHostProfileSocketEnum by calling from_dict on the json representation - dedicated_host_profile_socket_enum_model = DedicatedHostProfileSocketEnum.from_dict( - dedicated_host_profile_socket_enum_model_json) + dedicated_host_profile_socket_enum_model = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json) assert dedicated_host_profile_socket_enum_model != False # Construct a model instance of DedicatedHostProfileSocketEnum by calling from_dict on the json representation - dedicated_host_profile_socket_enum_model_dict = DedicatedHostProfileSocketEnum.from_dict( - dedicated_host_profile_socket_enum_model_json).__dict__ - dedicated_host_profile_socket_enum_model2 = DedicatedHostProfileSocketEnum( - **dedicated_host_profile_socket_enum_model_dict) + dedicated_host_profile_socket_enum_model_dict = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json).__dict__ + dedicated_host_profile_socket_enum_model2 = DedicatedHostProfileSocketEnum(**dedicated_host_profile_socket_enum_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_socket_enum_model == dedicated_host_profile_socket_enum_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_socket_enum_model_json2 = dedicated_host_profile_socket_enum_model.to_dict( - ) + dedicated_host_profile_socket_enum_model_json2 = dedicated_host_profile_socket_enum_model.to_dict() assert dedicated_host_profile_socket_enum_model_json2 == dedicated_host_profile_socket_enum_model_json - class TestDedicatedHostProfileSocketFixed(): """ Test Class for DedicatedHostProfileSocketFixed @@ -38815,25 +37654,20 @@ def test_dedicated_host_profile_socket_fixed_serialization(self): dedicated_host_profile_socket_fixed_model_json['value'] = 2 # Construct a model instance of DedicatedHostProfileSocketFixed by calling from_dict on the json representation - dedicated_host_profile_socket_fixed_model = DedicatedHostProfileSocketFixed.from_dict( - dedicated_host_profile_socket_fixed_model_json) + dedicated_host_profile_socket_fixed_model = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json) assert dedicated_host_profile_socket_fixed_model != False # Construct a model instance of DedicatedHostProfileSocketFixed by calling from_dict on the json representation - dedicated_host_profile_socket_fixed_model_dict = DedicatedHostProfileSocketFixed.from_dict( - dedicated_host_profile_socket_fixed_model_json).__dict__ - dedicated_host_profile_socket_fixed_model2 = DedicatedHostProfileSocketFixed( - **dedicated_host_profile_socket_fixed_model_dict) + dedicated_host_profile_socket_fixed_model_dict = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json).__dict__ + dedicated_host_profile_socket_fixed_model2 = DedicatedHostProfileSocketFixed(**dedicated_host_profile_socket_fixed_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_socket_fixed_model == dedicated_host_profile_socket_fixed_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_socket_fixed_model_json2 = dedicated_host_profile_socket_fixed_model.to_dict( - ) + dedicated_host_profile_socket_fixed_model_json2 = dedicated_host_profile_socket_fixed_model.to_dict() assert dedicated_host_profile_socket_fixed_model_json2 == dedicated_host_profile_socket_fixed_model_json - class TestDedicatedHostProfileSocketRange(): """ Test Class for DedicatedHostProfileSocketRange @@ -38853,25 +37687,20 @@ def test_dedicated_host_profile_socket_range_serialization(self): dedicated_host_profile_socket_range_model_json['type'] = 'range' # Construct a model instance of DedicatedHostProfileSocketRange by calling from_dict on the json representation - dedicated_host_profile_socket_range_model = DedicatedHostProfileSocketRange.from_dict( - dedicated_host_profile_socket_range_model_json) + dedicated_host_profile_socket_range_model = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json) assert dedicated_host_profile_socket_range_model != False # Construct a model instance of DedicatedHostProfileSocketRange by calling from_dict on the json representation - dedicated_host_profile_socket_range_model_dict = DedicatedHostProfileSocketRange.from_dict( - dedicated_host_profile_socket_range_model_json).__dict__ - dedicated_host_profile_socket_range_model2 = DedicatedHostProfileSocketRange( - **dedicated_host_profile_socket_range_model_dict) + dedicated_host_profile_socket_range_model_dict = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json).__dict__ + dedicated_host_profile_socket_range_model2 = DedicatedHostProfileSocketRange(**dedicated_host_profile_socket_range_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_socket_range_model == dedicated_host_profile_socket_range_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_socket_range_model_json2 = dedicated_host_profile_socket_range_model.to_dict( - ) + dedicated_host_profile_socket_range_model_json2 = dedicated_host_profile_socket_range_model.to_dict() assert dedicated_host_profile_socket_range_model_json2 == dedicated_host_profile_socket_range_model_json - class TestDedicatedHostProfileVCPUDependent(): """ Test Class for DedicatedHostProfileVCPUDependent @@ -38887,25 +37716,20 @@ def test_dedicated_host_profile_vcpu_dependent_serialization(self): dedicated_host_profile_vcpu_dependent_model_json['type'] = 'dependent' # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation - dedicated_host_profile_vcpu_dependent_model = DedicatedHostProfileVCPUDependent.from_dict( - dedicated_host_profile_vcpu_dependent_model_json) + dedicated_host_profile_vcpu_dependent_model = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json) assert dedicated_host_profile_vcpu_dependent_model != False # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation - dedicated_host_profile_vcpu_dependent_model_dict = DedicatedHostProfileVCPUDependent.from_dict( - dedicated_host_profile_vcpu_dependent_model_json).__dict__ - dedicated_host_profile_vcpu_dependent_model2 = DedicatedHostProfileVCPUDependent( - **dedicated_host_profile_vcpu_dependent_model_dict) + dedicated_host_profile_vcpu_dependent_model_dict = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json).__dict__ + dedicated_host_profile_vcpu_dependent_model2 = DedicatedHostProfileVCPUDependent(**dedicated_host_profile_vcpu_dependent_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_vcpu_dependent_model == dedicated_host_profile_vcpu_dependent_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_vcpu_dependent_model_json2 = dedicated_host_profile_vcpu_dependent_model.to_dict( - ) + dedicated_host_profile_vcpu_dependent_model_json2 = dedicated_host_profile_vcpu_dependent_model.to_dict() assert dedicated_host_profile_vcpu_dependent_model_json2 == dedicated_host_profile_vcpu_dependent_model_json - class TestDedicatedHostProfileVCPUEnum(): """ Test Class for DedicatedHostProfileVCPUEnum @@ -38923,25 +37747,20 @@ def test_dedicated_host_profile_vcpu_enum_serialization(self): dedicated_host_profile_vcpu_enum_model_json['values'] = [2, 4, 16] # Construct a model instance of DedicatedHostProfileVCPUEnum by calling from_dict on the json representation - dedicated_host_profile_vcpu_enum_model = DedicatedHostProfileVCPUEnum.from_dict( - dedicated_host_profile_vcpu_enum_model_json) + dedicated_host_profile_vcpu_enum_model = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json) assert dedicated_host_profile_vcpu_enum_model != False # Construct a model instance of DedicatedHostProfileVCPUEnum by calling from_dict on the json representation - dedicated_host_profile_vcpu_enum_model_dict = DedicatedHostProfileVCPUEnum.from_dict( - dedicated_host_profile_vcpu_enum_model_json).__dict__ - dedicated_host_profile_vcpu_enum_model2 = DedicatedHostProfileVCPUEnum( - **dedicated_host_profile_vcpu_enum_model_dict) + dedicated_host_profile_vcpu_enum_model_dict = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json).__dict__ + dedicated_host_profile_vcpu_enum_model2 = DedicatedHostProfileVCPUEnum(**dedicated_host_profile_vcpu_enum_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_vcpu_enum_model == dedicated_host_profile_vcpu_enum_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_vcpu_enum_model_json2 = dedicated_host_profile_vcpu_enum_model.to_dict( - ) + dedicated_host_profile_vcpu_enum_model_json2 = dedicated_host_profile_vcpu_enum_model.to_dict() assert dedicated_host_profile_vcpu_enum_model_json2 == dedicated_host_profile_vcpu_enum_model_json - class TestDedicatedHostProfileVCPUFixed(): """ Test Class for DedicatedHostProfileVCPUFixed @@ -38958,25 +37777,20 @@ def test_dedicated_host_profile_vcpu_fixed_serialization(self): dedicated_host_profile_vcpu_fixed_model_json['value'] = 16 # Construct a model instance of DedicatedHostProfileVCPUFixed by calling from_dict on the json representation - dedicated_host_profile_vcpu_fixed_model = DedicatedHostProfileVCPUFixed.from_dict( - dedicated_host_profile_vcpu_fixed_model_json) + dedicated_host_profile_vcpu_fixed_model = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json) assert dedicated_host_profile_vcpu_fixed_model != False # Construct a model instance of DedicatedHostProfileVCPUFixed by calling from_dict on the json representation - dedicated_host_profile_vcpu_fixed_model_dict = DedicatedHostProfileVCPUFixed.from_dict( - dedicated_host_profile_vcpu_fixed_model_json).__dict__ - dedicated_host_profile_vcpu_fixed_model2 = DedicatedHostProfileVCPUFixed( - **dedicated_host_profile_vcpu_fixed_model_dict) + dedicated_host_profile_vcpu_fixed_model_dict = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json).__dict__ + dedicated_host_profile_vcpu_fixed_model2 = DedicatedHostProfileVCPUFixed(**dedicated_host_profile_vcpu_fixed_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_vcpu_fixed_model == dedicated_host_profile_vcpu_fixed_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_vcpu_fixed_model_json2 = dedicated_host_profile_vcpu_fixed_model.to_dict( - ) + dedicated_host_profile_vcpu_fixed_model_json2 = dedicated_host_profile_vcpu_fixed_model.to_dict() assert dedicated_host_profile_vcpu_fixed_model_json2 == dedicated_host_profile_vcpu_fixed_model_json - class TestDedicatedHostProfileVCPURange(): """ Test Class for DedicatedHostProfileVCPURange @@ -38996,149 +37810,113 @@ def test_dedicated_host_profile_vcpu_range_serialization(self): dedicated_host_profile_vcpu_range_model_json['type'] = 'range' # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation - dedicated_host_profile_vcpu_range_model = DedicatedHostProfileVCPURange.from_dict( - dedicated_host_profile_vcpu_range_model_json) + dedicated_host_profile_vcpu_range_model = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json) assert dedicated_host_profile_vcpu_range_model != False # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation - dedicated_host_profile_vcpu_range_model_dict = DedicatedHostProfileVCPURange.from_dict( - dedicated_host_profile_vcpu_range_model_json).__dict__ - dedicated_host_profile_vcpu_range_model2 = DedicatedHostProfileVCPURange( - **dedicated_host_profile_vcpu_range_model_dict) + dedicated_host_profile_vcpu_range_model_dict = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json).__dict__ + dedicated_host_profile_vcpu_range_model2 = DedicatedHostProfileVCPURange(**dedicated_host_profile_vcpu_range_model_dict) # Verify the model instances are equivalent assert dedicated_host_profile_vcpu_range_model == dedicated_host_profile_vcpu_range_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_vcpu_range_model_json2 = dedicated_host_profile_vcpu_range_model.to_dict( - ) + dedicated_host_profile_vcpu_range_model_json2 = dedicated_host_profile_vcpu_range_model.to_dict() assert dedicated_host_profile_vcpu_range_model_json2 == dedicated_host_profile_vcpu_range_model_json - class TestDedicatedHostPrototypeDedicatedHostByGroup(): """ Test Class for DedicatedHostPrototypeDedicatedHostByGroup """ - def test_dedicated_host_prototype_dedicated_host_by_group_serialization( - self): + def test_dedicated_host_prototype_dedicated_host_by_group_serialization(self): """ Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByGroup """ # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_profile_identity_model = { - } # DedicatedHostProfileIdentityByName + dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - dedicated_host_group_identity_model = { - } # DedicatedHostGroupIdentityById - dedicated_host_group_identity_model[ - 'id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_model = {} # DedicatedHostGroupIdentityById + dedicated_host_group_identity_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByGroup model dedicated_host_prototype_dedicated_host_by_group_model_json = {} - dedicated_host_prototype_dedicated_host_by_group_model_json[ - 'instance_placement_enabled'] = True - dedicated_host_prototype_dedicated_host_by_group_model_json[ - 'name'] = 'my-host' - dedicated_host_prototype_dedicated_host_by_group_model_json[ - 'profile'] = dedicated_host_profile_identity_model - dedicated_host_prototype_dedicated_host_by_group_model_json[ - 'resource_group'] = resource_group_identity_model - dedicated_host_prototype_dedicated_host_by_group_model_json[ - 'group'] = dedicated_host_group_identity_model + dedicated_host_prototype_dedicated_host_by_group_model_json['instance_placement_enabled'] = True + dedicated_host_prototype_dedicated_host_by_group_model_json['name'] = 'my-host' + dedicated_host_prototype_dedicated_host_by_group_model_json['profile'] = dedicated_host_profile_identity_model + dedicated_host_prototype_dedicated_host_by_group_model_json['resource_group'] = resource_group_identity_model + dedicated_host_prototype_dedicated_host_by_group_model_json['group'] = dedicated_host_group_identity_model # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation - dedicated_host_prototype_dedicated_host_by_group_model = DedicatedHostPrototypeDedicatedHostByGroup.from_dict( - dedicated_host_prototype_dedicated_host_by_group_model_json) + dedicated_host_prototype_dedicated_host_by_group_model = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json) assert dedicated_host_prototype_dedicated_host_by_group_model != False # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation - dedicated_host_prototype_dedicated_host_by_group_model_dict = DedicatedHostPrototypeDedicatedHostByGroup.from_dict( - dedicated_host_prototype_dedicated_host_by_group_model_json - ).__dict__ - dedicated_host_prototype_dedicated_host_by_group_model2 = DedicatedHostPrototypeDedicatedHostByGroup( - **dedicated_host_prototype_dedicated_host_by_group_model_dict) + dedicated_host_prototype_dedicated_host_by_group_model_dict = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json).__dict__ + dedicated_host_prototype_dedicated_host_by_group_model2 = DedicatedHostPrototypeDedicatedHostByGroup(**dedicated_host_prototype_dedicated_host_by_group_model_dict) # Verify the model instances are equivalent assert dedicated_host_prototype_dedicated_host_by_group_model == dedicated_host_prototype_dedicated_host_by_group_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_prototype_dedicated_host_by_group_model_json2 = dedicated_host_prototype_dedicated_host_by_group_model.to_dict( - ) + dedicated_host_prototype_dedicated_host_by_group_model_json2 = dedicated_host_prototype_dedicated_host_by_group_model.to_dict() assert dedicated_host_prototype_dedicated_host_by_group_model_json2 == dedicated_host_prototype_dedicated_host_by_group_model_json - class TestDedicatedHostPrototypeDedicatedHostByZone(): """ Test Class for DedicatedHostPrototypeDedicatedHostByZone """ - def test_dedicated_host_prototype_dedicated_host_by_zone_serialization( - self): + def test_dedicated_host_prototype_dedicated_host_by_zone_serialization(self): """ Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByZone """ # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_profile_identity_model = { - } # DedicatedHostProfileIdentityByName + dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - dedicated_host_group_prototype_dedicated_host_by_zone_context_model = { - } # DedicatedHostGroupPrototypeDedicatedHostByZoneContext - dedicated_host_group_prototype_dedicated_host_by_zone_context_model[ - 'name'] = 'my-host-group' - dedicated_host_group_prototype_dedicated_host_by_zone_context_model[ - 'resource_group'] = resource_group_identity_model + dedicated_host_group_prototype_dedicated_host_by_zone_context_model = {} # DedicatedHostGroupPrototypeDedicatedHostByZoneContext + dedicated_host_group_prototype_dedicated_host_by_zone_context_model['name'] = 'my-host-group' + dedicated_host_group_prototype_dedicated_host_by_zone_context_model['resource_group'] = resource_group_identity_model - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByZone model dedicated_host_prototype_dedicated_host_by_zone_model_json = {} - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'instance_placement_enabled'] = True - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'name'] = 'my-host' - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'profile'] = dedicated_host_profile_identity_model - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'resource_group'] = resource_group_identity_model - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'group'] = dedicated_host_group_prototype_dedicated_host_by_zone_context_model - dedicated_host_prototype_dedicated_host_by_zone_model_json[ - 'zone'] = zone_identity_model + dedicated_host_prototype_dedicated_host_by_zone_model_json['instance_placement_enabled'] = True + dedicated_host_prototype_dedicated_host_by_zone_model_json['name'] = 'my-host' + dedicated_host_prototype_dedicated_host_by_zone_model_json['profile'] = dedicated_host_profile_identity_model + dedicated_host_prototype_dedicated_host_by_zone_model_json['resource_group'] = resource_group_identity_model + dedicated_host_prototype_dedicated_host_by_zone_model_json['group'] = dedicated_host_group_prototype_dedicated_host_by_zone_context_model + dedicated_host_prototype_dedicated_host_by_zone_model_json['zone'] = zone_identity_model # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation - dedicated_host_prototype_dedicated_host_by_zone_model = DedicatedHostPrototypeDedicatedHostByZone.from_dict( - dedicated_host_prototype_dedicated_host_by_zone_model_json) + dedicated_host_prototype_dedicated_host_by_zone_model = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json) assert dedicated_host_prototype_dedicated_host_by_zone_model != False # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation - dedicated_host_prototype_dedicated_host_by_zone_model_dict = DedicatedHostPrototypeDedicatedHostByZone.from_dict( - dedicated_host_prototype_dedicated_host_by_zone_model_json).__dict__ - dedicated_host_prototype_dedicated_host_by_zone_model2 = DedicatedHostPrototypeDedicatedHostByZone( - **dedicated_host_prototype_dedicated_host_by_zone_model_dict) + dedicated_host_prototype_dedicated_host_by_zone_model_dict = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json).__dict__ + dedicated_host_prototype_dedicated_host_by_zone_model2 = DedicatedHostPrototypeDedicatedHostByZone(**dedicated_host_prototype_dedicated_host_by_zone_model_dict) # Verify the model instances are equivalent assert dedicated_host_prototype_dedicated_host_by_zone_model == dedicated_host_prototype_dedicated_host_by_zone_model2 # Convert model instance back to dict and verify no loss of data - dedicated_host_prototype_dedicated_host_by_zone_model_json2 = dedicated_host_prototype_dedicated_host_by_zone_model.to_dict( - ) + dedicated_host_prototype_dedicated_host_by_zone_model_json2 = dedicated_host_prototype_dedicated_host_by_zone_model.to_dict() assert dedicated_host_prototype_dedicated_host_by_zone_model_json2 == dedicated_host_prototype_dedicated_host_by_zone_model_json - class TestEncryptionKeyIdentityByCRN(): """ Test Class for EncryptionKeyIdentityByCRN @@ -39151,324 +37929,235 @@ def test_encryption_key_identity_by_crn_serialization(self): # Construct a json representation of a EncryptionKeyIdentityByCRN model encryption_key_identity_by_crn_model_json = {} - encryption_key_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' # Construct a model instance of EncryptionKeyIdentityByCRN by calling from_dict on the json representation - encryption_key_identity_by_crn_model = EncryptionKeyIdentityByCRN.from_dict( - encryption_key_identity_by_crn_model_json) + encryption_key_identity_by_crn_model = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json) assert encryption_key_identity_by_crn_model != False # Construct a model instance of EncryptionKeyIdentityByCRN by calling from_dict on the json representation - encryption_key_identity_by_crn_model_dict = EncryptionKeyIdentityByCRN.from_dict( - encryption_key_identity_by_crn_model_json).__dict__ - encryption_key_identity_by_crn_model2 = EncryptionKeyIdentityByCRN( - **encryption_key_identity_by_crn_model_dict) + encryption_key_identity_by_crn_model_dict = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json).__dict__ + encryption_key_identity_by_crn_model2 = EncryptionKeyIdentityByCRN(**encryption_key_identity_by_crn_model_dict) # Verify the model instances are equivalent assert encryption_key_identity_by_crn_model == encryption_key_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - encryption_key_identity_by_crn_model_json2 = encryption_key_identity_by_crn_model.to_dict( - ) + encryption_key_identity_by_crn_model_json2 = encryption_key_identity_by_crn_model.to_dict() assert encryption_key_identity_by_crn_model_json2 == encryption_key_identity_by_crn_model_json - class TestEndpointGatewayReservedIPReservedIPPrototypeTargetContext(): """ Test Class for EndpointGatewayReservedIPReservedIPPrototypeTargetContext """ - def test_endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_serialization( - self): + def test_endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_serialization(self): """ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPPrototypeTargetContext """ # Construct dict forms of any model objects needed in order to build this model. - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a json representation of a EndpointGatewayReservedIPReservedIPPrototypeTargetContext model endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json = {} - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json[ - 'auto_delete'] = False - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json[ - 'name'] = 'my-reserved-ip' - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json[ - 'subnet'] = subnet_identity_model + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['auto_delete'] = False + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['name'] = 'my-reserved-ip' + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['subnet'] = subnet_identity_model # Construct a model instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json - ) + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json) assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model != False # Construct a model instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json - ).__dict__ - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2 = EndpointGatewayReservedIPReservedIPPrototypeTargetContext( - ** - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict - ) + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json).__dict__ + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2 = EndpointGatewayReservedIPReservedIPPrototypeTargetContext(**endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model.to_dict( - ) + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model.to_dict() assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json - class TestEndpointGatewayTargetProviderCloudServiceReference(): """ Test Class for EndpointGatewayTargetProviderCloudServiceReference """ - def test_endpoint_gateway_target_provider_cloud_service_reference_serialization( - self): + def test_endpoint_gateway_target_provider_cloud_service_reference_serialization(self): """ Test serialization/deserialization for EndpointGatewayTargetProviderCloudServiceReference """ # Construct a json representation of a EndpointGatewayTargetProviderCloudServiceReference model endpoint_gateway_target_provider_cloud_service_reference_model_json = {} - endpoint_gateway_target_provider_cloud_service_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' - endpoint_gateway_target_provider_cloud_service_reference_model_json[ - 'resource_type'] = 'provider_cloud_service' + endpoint_gateway_target_provider_cloud_service_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_provider_cloud_service_reference_model_json['resource_type'] = 'provider_cloud_service' # Construct a model instance of EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation - endpoint_gateway_target_provider_cloud_service_reference_model = EndpointGatewayTargetProviderCloudServiceReference.from_dict( - endpoint_gateway_target_provider_cloud_service_reference_model_json) + endpoint_gateway_target_provider_cloud_service_reference_model = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json) assert endpoint_gateway_target_provider_cloud_service_reference_model != False # Construct a model instance of EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation - endpoint_gateway_target_provider_cloud_service_reference_model_dict = EndpointGatewayTargetProviderCloudServiceReference.from_dict( - endpoint_gateway_target_provider_cloud_service_reference_model_json - ).__dict__ - endpoint_gateway_target_provider_cloud_service_reference_model2 = EndpointGatewayTargetProviderCloudServiceReference( - ** - endpoint_gateway_target_provider_cloud_service_reference_model_dict) + endpoint_gateway_target_provider_cloud_service_reference_model_dict = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json).__dict__ + endpoint_gateway_target_provider_cloud_service_reference_model2 = EndpointGatewayTargetProviderCloudServiceReference(**endpoint_gateway_target_provider_cloud_service_reference_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_target_provider_cloud_service_reference_model == endpoint_gateway_target_provider_cloud_service_reference_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_target_provider_cloud_service_reference_model_json2 = endpoint_gateway_target_provider_cloud_service_reference_model.to_dict( - ) + endpoint_gateway_target_provider_cloud_service_reference_model_json2 = endpoint_gateway_target_provider_cloud_service_reference_model.to_dict() assert endpoint_gateway_target_provider_cloud_service_reference_model_json2 == endpoint_gateway_target_provider_cloud_service_reference_model_json - class TestEndpointGatewayTargetProviderInfrastructureServiceReference(): """ Test Class for EndpointGatewayTargetProviderInfrastructureServiceReference """ - def test_endpoint_gateway_target_provider_infrastructure_service_reference_serialization( - self): + def test_endpoint_gateway_target_provider_infrastructure_service_reference_serialization(self): """ Test serialization/deserialization for EndpointGatewayTargetProviderInfrastructureServiceReference """ # Construct a json representation of a EndpointGatewayTargetProviderInfrastructureServiceReference model endpoint_gateway_target_provider_infrastructure_service_reference_model_json = {} - endpoint_gateway_target_provider_infrastructure_service_reference_model_json[ - 'name'] = 'ibm-ntp-server' - endpoint_gateway_target_provider_infrastructure_service_reference_model_json[ - 'resource_type'] = 'provider_infrastructure_service' + endpoint_gateway_target_provider_infrastructure_service_reference_model_json['name'] = 'ibm-ntp-server' + endpoint_gateway_target_provider_infrastructure_service_reference_model_json['resource_type'] = 'provider_infrastructure_service' # Construct a model instance of EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation - endpoint_gateway_target_provider_infrastructure_service_reference_model = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict( - endpoint_gateway_target_provider_infrastructure_service_reference_model_json - ) + endpoint_gateway_target_provider_infrastructure_service_reference_model = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json) assert endpoint_gateway_target_provider_infrastructure_service_reference_model != False # Construct a model instance of EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation - endpoint_gateway_target_provider_infrastructure_service_reference_model_dict = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict( - endpoint_gateway_target_provider_infrastructure_service_reference_model_json - ).__dict__ - endpoint_gateway_target_provider_infrastructure_service_reference_model2 = EndpointGatewayTargetProviderInfrastructureServiceReference( - ** - endpoint_gateway_target_provider_infrastructure_service_reference_model_dict - ) + endpoint_gateway_target_provider_infrastructure_service_reference_model_dict = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json).__dict__ + endpoint_gateway_target_provider_infrastructure_service_reference_model2 = EndpointGatewayTargetProviderInfrastructureServiceReference(**endpoint_gateway_target_provider_infrastructure_service_reference_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_target_provider_infrastructure_service_reference_model == endpoint_gateway_target_provider_infrastructure_service_reference_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 = endpoint_gateway_target_provider_infrastructure_service_reference_model.to_dict( - ) + endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 = endpoint_gateway_target_provider_infrastructure_service_reference_model.to_dict() assert endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 == endpoint_gateway_target_provider_infrastructure_service_reference_model_json - -class TestFloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( -): +class TestFloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(): """ Test Class for FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ - def test_floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_serialization( - self): + def test_floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_serialization(self): """ Test serialization/deserialization for FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ # Construct a json representation of a FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json = {} - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json) assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model != False # Construct a model instance of FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json - ).__dict__ - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( - ** - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_dict - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json).__dict__ + floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_dict) # Verify the model instances are equivalent assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model == floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model.to_dict( - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model.to_dict() assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_by_target_network_interface_identity_network_interface_identity_by_href_model_json - -class TestFloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById( -): +class TestFloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(): """ Test Class for FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById """ - def test_floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_serialization( - self): + def test_floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_serialization(self): """ Test serialization/deserialization for FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById """ # Construct a json representation of a FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json = {} - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json) assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model != False # Construct a model instance of FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json - ).__dict__ - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById( - ** - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_dict - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json).__dict__ + floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_dict) # Verify the model instances are equivalent assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model == floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model.to_dict( - ) + floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model.to_dict() assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json - -class TestFloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( -): +class TestFloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(): """ Test Class for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ - def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_serialization( - self): + def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_serialization(self): """ Test serialization/deserialization for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ # Construct a json representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json = {} - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json) assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model != False # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json - ).__dict__ - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( - ** - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json).__dict__ + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict) # Verify the model instances are equivalent assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model.to_dict( - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model.to_dict() assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json - -class TestFloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById( -): +class TestFloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(): """ Test Class for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById """ - def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_serialization( - self): + def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_serialization(self): """ Test serialization/deserialization for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById """ # Construct a json representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json = {} - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json) assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model != False # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json - ).__dict__ - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById( - ** - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json).__dict__ + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict) # Verify the model instances are equivalent assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model.to_dict( - ) + floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model.to_dict() assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json - class TestFloatingIPPrototypeFloatingIPByTarget(): """ Test Class for FloatingIPPrototypeFloatingIPByTarget @@ -39481,43 +38170,33 @@ def test_floating_ip_prototype_floating_ip_by_target_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - floating_ip_by_target_network_interface_identity_model = { - } # FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById - floating_ip_by_target_network_interface_identity_model[ - 'id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' + floating_ip_by_target_network_interface_identity_model = {} # FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById + floating_ip_by_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793' # Construct a json representation of a FloatingIPPrototypeFloatingIPByTarget model floating_ip_prototype_floating_ip_by_target_model_json = {} - floating_ip_prototype_floating_ip_by_target_model_json[ - 'name'] = 'my-floating-ip' - floating_ip_prototype_floating_ip_by_target_model_json[ - 'resource_group'] = resource_group_identity_model - floating_ip_prototype_floating_ip_by_target_model_json[ - 'target'] = floating_ip_by_target_network_interface_identity_model + floating_ip_prototype_floating_ip_by_target_model_json['name'] = 'my-floating-ip' + floating_ip_prototype_floating_ip_by_target_model_json['resource_group'] = resource_group_identity_model + floating_ip_prototype_floating_ip_by_target_model_json['target'] = floating_ip_by_target_network_interface_identity_model # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation - floating_ip_prototype_floating_ip_by_target_model = FloatingIPPrototypeFloatingIPByTarget.from_dict( - floating_ip_prototype_floating_ip_by_target_model_json) + floating_ip_prototype_floating_ip_by_target_model = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json) assert floating_ip_prototype_floating_ip_by_target_model != False # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation - floating_ip_prototype_floating_ip_by_target_model_dict = FloatingIPPrototypeFloatingIPByTarget.from_dict( - floating_ip_prototype_floating_ip_by_target_model_json).__dict__ - floating_ip_prototype_floating_ip_by_target_model2 = FloatingIPPrototypeFloatingIPByTarget( - **floating_ip_prototype_floating_ip_by_target_model_dict) + floating_ip_prototype_floating_ip_by_target_model_dict = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json).__dict__ + floating_ip_prototype_floating_ip_by_target_model2 = FloatingIPPrototypeFloatingIPByTarget(**floating_ip_prototype_floating_ip_by_target_model_dict) # Verify the model instances are equivalent assert floating_ip_prototype_floating_ip_by_target_model == floating_ip_prototype_floating_ip_by_target_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_prototype_floating_ip_by_target_model_json2 = floating_ip_prototype_floating_ip_by_target_model.to_dict( - ) + floating_ip_prototype_floating_ip_by_target_model_json2 = floating_ip_prototype_floating_ip_by_target_model.to_dict() assert floating_ip_prototype_floating_ip_by_target_model_json2 == floating_ip_prototype_floating_ip_by_target_model_json - class TestFloatingIPPrototypeFloatingIPByZone(): """ Test Class for FloatingIPPrototypeFloatingIPByZone @@ -39530,41 +38209,33 @@ def test_floating_ip_prototype_floating_ip_by_zone_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a FloatingIPPrototypeFloatingIPByZone model floating_ip_prototype_floating_ip_by_zone_model_json = {} - floating_ip_prototype_floating_ip_by_zone_model_json[ - 'name'] = 'my-floating-ip' - floating_ip_prototype_floating_ip_by_zone_model_json[ - 'resource_group'] = resource_group_identity_model - floating_ip_prototype_floating_ip_by_zone_model_json[ - 'zone'] = zone_identity_model + floating_ip_prototype_floating_ip_by_zone_model_json['name'] = 'my-floating-ip' + floating_ip_prototype_floating_ip_by_zone_model_json['resource_group'] = resource_group_identity_model + floating_ip_prototype_floating_ip_by_zone_model_json['zone'] = zone_identity_model # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation - floating_ip_prototype_floating_ip_by_zone_model = FloatingIPPrototypeFloatingIPByZone.from_dict( - floating_ip_prototype_floating_ip_by_zone_model_json) + floating_ip_prototype_floating_ip_by_zone_model = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json) assert floating_ip_prototype_floating_ip_by_zone_model != False # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation - floating_ip_prototype_floating_ip_by_zone_model_dict = FloatingIPPrototypeFloatingIPByZone.from_dict( - floating_ip_prototype_floating_ip_by_zone_model_json).__dict__ - floating_ip_prototype_floating_ip_by_zone_model2 = FloatingIPPrototypeFloatingIPByZone( - **floating_ip_prototype_floating_ip_by_zone_model_dict) + floating_ip_prototype_floating_ip_by_zone_model_dict = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json).__dict__ + floating_ip_prototype_floating_ip_by_zone_model2 = FloatingIPPrototypeFloatingIPByZone(**floating_ip_prototype_floating_ip_by_zone_model_dict) # Verify the model instances are equivalent assert floating_ip_prototype_floating_ip_by_zone_model == floating_ip_prototype_floating_ip_by_zone_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_prototype_floating_ip_by_zone_model_json2 = floating_ip_prototype_floating_ip_by_zone_model.to_dict( - ) + floating_ip_prototype_floating_ip_by_zone_model_json2 = floating_ip_prototype_floating_ip_by_zone_model.to_dict() assert floating_ip_prototype_floating_ip_by_zone_model_json2 == floating_ip_prototype_floating_ip_by_zone_model_json - class TestFloatingIPTargetNetworkInterfaceReference(): """ Test Class for FloatingIPTargetNetworkInterfaceReference @@ -39577,46 +38248,33 @@ def test_floating_ip_target_network_interface_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_deleted_model = { - } # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted + network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FloatingIPTargetNetworkInterfaceReference model floating_ip_target_network_interface_reference_model_json = {} - floating_ip_target_network_interface_reference_model_json[ - 'deleted'] = network_interface_reference_deleted_model - floating_ip_target_network_interface_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_network_interface_reference_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_network_interface_reference_model_json[ - 'name'] = 'my-network-interface' - floating_ip_target_network_interface_reference_model_json[ - 'primary_ipv4_address'] = '192.168.3.4' - floating_ip_target_network_interface_reference_model_json[ - 'resource_type'] = 'network_interface' + floating_ip_target_network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model + floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_network_interface_reference_model_json['name'] = 'my-network-interface' + floating_ip_target_network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + floating_ip_target_network_interface_reference_model_json['resource_type'] = 'network_interface' # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation - floating_ip_target_network_interface_reference_model = FloatingIPTargetNetworkInterfaceReference.from_dict( - floating_ip_target_network_interface_reference_model_json) + floating_ip_target_network_interface_reference_model = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json) assert floating_ip_target_network_interface_reference_model != False # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation - floating_ip_target_network_interface_reference_model_dict = FloatingIPTargetNetworkInterfaceReference.from_dict( - floating_ip_target_network_interface_reference_model_json).__dict__ - floating_ip_target_network_interface_reference_model2 = FloatingIPTargetNetworkInterfaceReference( - **floating_ip_target_network_interface_reference_model_dict) + floating_ip_target_network_interface_reference_model_dict = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json).__dict__ + floating_ip_target_network_interface_reference_model2 = FloatingIPTargetNetworkInterfaceReference(**floating_ip_target_network_interface_reference_model_dict) # Verify the model instances are equivalent assert floating_ip_target_network_interface_reference_model == floating_ip_target_network_interface_reference_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_target_network_interface_reference_model_json2 = floating_ip_target_network_interface_reference_model.to_dict( - ) + floating_ip_target_network_interface_reference_model_json2 = floating_ip_target_network_interface_reference_model.to_dict() assert floating_ip_target_network_interface_reference_model_json2 == floating_ip_target_network_interface_reference_model_json - class TestFloatingIPTargetPublicGatewayReference(): """ Test Class for FloatingIPTargetPublicGatewayReference @@ -39629,46 +38287,33 @@ def test_floating_ip_target_public_gateway_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - public_gateway_reference_deleted_model = { - } # PublicGatewayReferenceDeleted - public_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted + public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FloatingIPTargetPublicGatewayReference model floating_ip_target_public_gateway_reference_model_json = {} - floating_ip_target_public_gateway_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' - floating_ip_target_public_gateway_reference_model_json[ - 'deleted'] = public_gateway_reference_deleted_model - floating_ip_target_public_gateway_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' - floating_ip_target_public_gateway_reference_model_json[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' - floating_ip_target_public_gateway_reference_model_json[ - 'name'] = 'my-public-gateway' - floating_ip_target_public_gateway_reference_model_json[ - 'resource_type'] = 'public_gateway' + floating_ip_target_public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + floating_ip_target_public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model + floating_ip_target_public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + floating_ip_target_public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + floating_ip_target_public_gateway_reference_model_json['name'] = 'my-public-gateway' + floating_ip_target_public_gateway_reference_model_json['resource_type'] = 'public_gateway' # Construct a model instance of FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation - floating_ip_target_public_gateway_reference_model = FloatingIPTargetPublicGatewayReference.from_dict( - floating_ip_target_public_gateway_reference_model_json) + floating_ip_target_public_gateway_reference_model = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json) assert floating_ip_target_public_gateway_reference_model != False # Construct a model instance of FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation - floating_ip_target_public_gateway_reference_model_dict = FloatingIPTargetPublicGatewayReference.from_dict( - floating_ip_target_public_gateway_reference_model_json).__dict__ - floating_ip_target_public_gateway_reference_model2 = FloatingIPTargetPublicGatewayReference( - **floating_ip_target_public_gateway_reference_model_dict) + floating_ip_target_public_gateway_reference_model_dict = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json).__dict__ + floating_ip_target_public_gateway_reference_model2 = FloatingIPTargetPublicGatewayReference(**floating_ip_target_public_gateway_reference_model_dict) # Verify the model instances are equivalent assert floating_ip_target_public_gateway_reference_model == floating_ip_target_public_gateway_reference_model2 # Convert model instance back to dict and verify no loss of data - floating_ip_target_public_gateway_reference_model_json2 = floating_ip_target_public_gateway_reference_model.to_dict( - ) + floating_ip_target_public_gateway_reference_model_json2 = floating_ip_target_public_gateway_reference_model.to_dict() assert floating_ip_target_public_gateway_reference_model_json2 == floating_ip_target_public_gateway_reference_model_json - class TestFlowLogCollectorTargetInstanceReference(): """ Test Class for FlowLogCollectorTargetInstanceReference @@ -39681,98 +38326,70 @@ def test_flow_log_collector_target_instance_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FlowLogCollectorTargetInstanceReference model flow_log_collector_target_instance_reference_model_json = {} - flow_log_collector_target_instance_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' - flow_log_collector_target_instance_reference_model_json[ - 'deleted'] = instance_reference_deleted_model - flow_log_collector_target_instance_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' - flow_log_collector_target_instance_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - flow_log_collector_target_instance_reference_model_json[ - 'name'] = 'my-instance' + flow_log_collector_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model + flow_log_collector_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation - flow_log_collector_target_instance_reference_model = FlowLogCollectorTargetInstanceReference.from_dict( - flow_log_collector_target_instance_reference_model_json) + flow_log_collector_target_instance_reference_model = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json) assert flow_log_collector_target_instance_reference_model != False # Construct a model instance of FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation - flow_log_collector_target_instance_reference_model_dict = FlowLogCollectorTargetInstanceReference.from_dict( - flow_log_collector_target_instance_reference_model_json).__dict__ - flow_log_collector_target_instance_reference_model2 = FlowLogCollectorTargetInstanceReference( - **flow_log_collector_target_instance_reference_model_dict) + flow_log_collector_target_instance_reference_model_dict = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json).__dict__ + flow_log_collector_target_instance_reference_model2 = FlowLogCollectorTargetInstanceReference(**flow_log_collector_target_instance_reference_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_instance_reference_model == flow_log_collector_target_instance_reference_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_instance_reference_model_json2 = flow_log_collector_target_instance_reference_model.to_dict( - ) + flow_log_collector_target_instance_reference_model_json2 = flow_log_collector_target_instance_reference_model.to_dict() assert flow_log_collector_target_instance_reference_model_json2 == flow_log_collector_target_instance_reference_model_json - class TestFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(): """ Test Class for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext """ - def test_flow_log_collector_target_network_interface_reference_target_context_serialization( - self): + def test_flow_log_collector_target_network_interface_reference_target_context_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext """ # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext model flow_log_collector_target_network_interface_reference_target_context_model_json = {} - flow_log_collector_target_network_interface_reference_target_context_model_json[ - 'deleted'] = network_interface_reference_target_context_deleted_model - flow_log_collector_target_network_interface_reference_target_context_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_network_interface_reference_target_context_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_network_interface_reference_target_context_model_json[ - 'name'] = 'my-network-interface' - flow_log_collector_target_network_interface_reference_target_context_model_json[ - 'resource_type'] = 'network_interface' + flow_log_collector_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model + flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + flow_log_collector_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation - flow_log_collector_target_network_interface_reference_target_context_model = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict( - flow_log_collector_target_network_interface_reference_target_context_model_json - ) + flow_log_collector_target_network_interface_reference_target_context_model = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json) assert flow_log_collector_target_network_interface_reference_target_context_model != False # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation - flow_log_collector_target_network_interface_reference_target_context_model_dict = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict( - flow_log_collector_target_network_interface_reference_target_context_model_json - ).__dict__ - flow_log_collector_target_network_interface_reference_target_context_model2 = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext( - ** - flow_log_collector_target_network_interface_reference_target_context_model_dict - ) + flow_log_collector_target_network_interface_reference_target_context_model_dict = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json).__dict__ + flow_log_collector_target_network_interface_reference_target_context_model2 = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(**flow_log_collector_target_network_interface_reference_target_context_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_network_interface_reference_target_context_model == flow_log_collector_target_network_interface_reference_target_context_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_network_interface_reference_target_context_model_json2 = flow_log_collector_target_network_interface_reference_target_context_model.to_dict( - ) + flow_log_collector_target_network_interface_reference_target_context_model_json2 = flow_log_collector_target_network_interface_reference_target_context_model.to_dict() assert flow_log_collector_target_network_interface_reference_target_context_model_json2 == flow_log_collector_target_network_interface_reference_target_context_model_json - class TestFlowLogCollectorTargetSubnetReference(): """ Test Class for FlowLogCollectorTargetSubnetReference @@ -39785,43 +38402,32 @@ def test_flow_log_collector_target_subnet_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FlowLogCollectorTargetSubnetReference model flow_log_collector_target_subnet_reference_model_json = {} - flow_log_collector_target_subnet_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - flow_log_collector_target_subnet_reference_model_json[ - 'deleted'] = subnet_reference_deleted_model - flow_log_collector_target_subnet_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - flow_log_collector_target_subnet_reference_model_json[ - 'id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - flow_log_collector_target_subnet_reference_model_json[ - 'name'] = 'my-subnet' + flow_log_collector_target_subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_subnet_reference_model_json['deleted'] = subnet_reference_deleted_model + flow_log_collector_target_subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_subnet_reference_model_json['name'] = 'my-subnet' # Construct a model instance of FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation - flow_log_collector_target_subnet_reference_model = FlowLogCollectorTargetSubnetReference.from_dict( - flow_log_collector_target_subnet_reference_model_json) + flow_log_collector_target_subnet_reference_model = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json) assert flow_log_collector_target_subnet_reference_model != False # Construct a model instance of FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation - flow_log_collector_target_subnet_reference_model_dict = FlowLogCollectorTargetSubnetReference.from_dict( - flow_log_collector_target_subnet_reference_model_json).__dict__ - flow_log_collector_target_subnet_reference_model2 = FlowLogCollectorTargetSubnetReference( - **flow_log_collector_target_subnet_reference_model_dict) + flow_log_collector_target_subnet_reference_model_dict = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json).__dict__ + flow_log_collector_target_subnet_reference_model2 = FlowLogCollectorTargetSubnetReference(**flow_log_collector_target_subnet_reference_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_subnet_reference_model == flow_log_collector_target_subnet_reference_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_subnet_reference_model_json2 = flow_log_collector_target_subnet_reference_model.to_dict( - ) + flow_log_collector_target_subnet_reference_model_json2 = flow_log_collector_target_subnet_reference_model.to_dict() assert flow_log_collector_target_subnet_reference_model_json2 == flow_log_collector_target_subnet_reference_model_json - class TestFlowLogCollectorTargetVPCReference(): """ Test Class for FlowLogCollectorTargetVPCReference @@ -39834,42 +38440,32 @@ def test_flow_log_collector_target_vpc_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpc_reference_deleted_model = {} # VPCReferenceDeleted - vpc_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a FlowLogCollectorTargetVPCReference model flow_log_collector_target_vpc_reference_model_json = {} - flow_log_collector_target_vpc_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - flow_log_collector_target_vpc_reference_model_json[ - 'deleted'] = vpc_reference_deleted_model - flow_log_collector_target_vpc_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' - flow_log_collector_target_vpc_reference_model_json[ - 'id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_vpc_reference_model_json['deleted'] = vpc_reference_deleted_model + flow_log_collector_target_vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' flow_log_collector_target_vpc_reference_model_json['name'] = 'my-vpc' # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation - flow_log_collector_target_vpc_reference_model = FlowLogCollectorTargetVPCReference.from_dict( - flow_log_collector_target_vpc_reference_model_json) + flow_log_collector_target_vpc_reference_model = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json) assert flow_log_collector_target_vpc_reference_model != False # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation - flow_log_collector_target_vpc_reference_model_dict = FlowLogCollectorTargetVPCReference.from_dict( - flow_log_collector_target_vpc_reference_model_json).__dict__ - flow_log_collector_target_vpc_reference_model2 = FlowLogCollectorTargetVPCReference( - **flow_log_collector_target_vpc_reference_model_dict) + flow_log_collector_target_vpc_reference_model_dict = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json).__dict__ + flow_log_collector_target_vpc_reference_model2 = FlowLogCollectorTargetVPCReference(**flow_log_collector_target_vpc_reference_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_vpc_reference_model == flow_log_collector_target_vpc_reference_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_vpc_reference_model_json2 = flow_log_collector_target_vpc_reference_model.to_dict( - ) + flow_log_collector_target_vpc_reference_model_json2 = flow_log_collector_target_vpc_reference_model.to_dict() assert flow_log_collector_target_vpc_reference_model_json2 == flow_log_collector_target_vpc_reference_model_json - class TestIKEPolicyIdentityByHref(): """ Test Class for IKEPolicyIdentityByHref @@ -39882,29 +38478,23 @@ def test_ike_policy_identity_by_href_serialization(self): # Construct a json representation of a IKEPolicyIdentityByHref model ike_policy_identity_by_href_model_json = {} - ike_policy_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a model instance of IKEPolicyIdentityByHref by calling from_dict on the json representation - ike_policy_identity_by_href_model = IKEPolicyIdentityByHref.from_dict( - ike_policy_identity_by_href_model_json) + ike_policy_identity_by_href_model = IKEPolicyIdentityByHref.from_dict(ike_policy_identity_by_href_model_json) assert ike_policy_identity_by_href_model != False # Construct a model instance of IKEPolicyIdentityByHref by calling from_dict on the json representation - ike_policy_identity_by_href_model_dict = IKEPolicyIdentityByHref.from_dict( - ike_policy_identity_by_href_model_json).__dict__ - ike_policy_identity_by_href_model2 = IKEPolicyIdentityByHref( - **ike_policy_identity_by_href_model_dict) + ike_policy_identity_by_href_model_dict = IKEPolicyIdentityByHref.from_dict(ike_policy_identity_by_href_model_json).__dict__ + ike_policy_identity_by_href_model2 = IKEPolicyIdentityByHref(**ike_policy_identity_by_href_model_dict) # Verify the model instances are equivalent assert ike_policy_identity_by_href_model == ike_policy_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_identity_by_href_model_json2 = ike_policy_identity_by_href_model.to_dict( - ) + ike_policy_identity_by_href_model_json2 = ike_policy_identity_by_href_model.to_dict() assert ike_policy_identity_by_href_model_json2 == ike_policy_identity_by_href_model_json - class TestIKEPolicyIdentityById(): """ Test Class for IKEPolicyIdentityById @@ -39917,29 +38507,23 @@ def test_ike_policy_identity_by_id_serialization(self): # Construct a json representation of a IKEPolicyIdentityById model ike_policy_identity_by_id_model_json = {} - ike_policy_identity_by_id_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a model instance of IKEPolicyIdentityById by calling from_dict on the json representation - ike_policy_identity_by_id_model = IKEPolicyIdentityById.from_dict( - ike_policy_identity_by_id_model_json) + ike_policy_identity_by_id_model = IKEPolicyIdentityById.from_dict(ike_policy_identity_by_id_model_json) assert ike_policy_identity_by_id_model != False # Construct a model instance of IKEPolicyIdentityById by calling from_dict on the json representation - ike_policy_identity_by_id_model_dict = IKEPolicyIdentityById.from_dict( - ike_policy_identity_by_id_model_json).__dict__ - ike_policy_identity_by_id_model2 = IKEPolicyIdentityById( - **ike_policy_identity_by_id_model_dict) + ike_policy_identity_by_id_model_dict = IKEPolicyIdentityById.from_dict(ike_policy_identity_by_id_model_json).__dict__ + ike_policy_identity_by_id_model2 = IKEPolicyIdentityById(**ike_policy_identity_by_id_model_dict) # Verify the model instances are equivalent assert ike_policy_identity_by_id_model == ike_policy_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - ike_policy_identity_by_id_model_json2 = ike_policy_identity_by_id_model.to_dict( - ) + ike_policy_identity_by_id_model_json2 = ike_policy_identity_by_id_model.to_dict() assert ike_policy_identity_by_id_model_json2 == ike_policy_identity_by_id_model_json - class TestIPsecPolicyIdentityByHref(): """ Test Class for IPsecPolicyIdentityByHref @@ -39952,29 +38536,23 @@ def test_i_psec_policy_identity_by_href_serialization(self): # Construct a json representation of a IPsecPolicyIdentityByHref model i_psec_policy_identity_by_href_model_json = {} - i_psec_policy_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a model instance of IPsecPolicyIdentityByHref by calling from_dict on the json representation - i_psec_policy_identity_by_href_model = IPsecPolicyIdentityByHref.from_dict( - i_psec_policy_identity_by_href_model_json) + i_psec_policy_identity_by_href_model = IPsecPolicyIdentityByHref.from_dict(i_psec_policy_identity_by_href_model_json) assert i_psec_policy_identity_by_href_model != False # Construct a model instance of IPsecPolicyIdentityByHref by calling from_dict on the json representation - i_psec_policy_identity_by_href_model_dict = IPsecPolicyIdentityByHref.from_dict( - i_psec_policy_identity_by_href_model_json).__dict__ - i_psec_policy_identity_by_href_model2 = IPsecPolicyIdentityByHref( - **i_psec_policy_identity_by_href_model_dict) + i_psec_policy_identity_by_href_model_dict = IPsecPolicyIdentityByHref.from_dict(i_psec_policy_identity_by_href_model_json).__dict__ + i_psec_policy_identity_by_href_model2 = IPsecPolicyIdentityByHref(**i_psec_policy_identity_by_href_model_dict) # Verify the model instances are equivalent assert i_psec_policy_identity_by_href_model == i_psec_policy_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_identity_by_href_model_json2 = i_psec_policy_identity_by_href_model.to_dict( - ) + i_psec_policy_identity_by_href_model_json2 = i_psec_policy_identity_by_href_model.to_dict() assert i_psec_policy_identity_by_href_model_json2 == i_psec_policy_identity_by_href_model_json - class TestIPsecPolicyIdentityById(): """ Test Class for IPsecPolicyIdentityById @@ -39987,29 +38565,23 @@ def test_i_psec_policy_identity_by_id_serialization(self): # Construct a json representation of a IPsecPolicyIdentityById model i_psec_policy_identity_by_id_model_json = {} - i_psec_policy_identity_by_id_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a model instance of IPsecPolicyIdentityById by calling from_dict on the json representation - i_psec_policy_identity_by_id_model = IPsecPolicyIdentityById.from_dict( - i_psec_policy_identity_by_id_model_json) + i_psec_policy_identity_by_id_model = IPsecPolicyIdentityById.from_dict(i_psec_policy_identity_by_id_model_json) assert i_psec_policy_identity_by_id_model != False # Construct a model instance of IPsecPolicyIdentityById by calling from_dict on the json representation - i_psec_policy_identity_by_id_model_dict = IPsecPolicyIdentityById.from_dict( - i_psec_policy_identity_by_id_model_json).__dict__ - i_psec_policy_identity_by_id_model2 = IPsecPolicyIdentityById( - **i_psec_policy_identity_by_id_model_dict) + i_psec_policy_identity_by_id_model_dict = IPsecPolicyIdentityById.from_dict(i_psec_policy_identity_by_id_model_json).__dict__ + i_psec_policy_identity_by_id_model2 = IPsecPolicyIdentityById(**i_psec_policy_identity_by_id_model_dict) # Verify the model instances are equivalent assert i_psec_policy_identity_by_id_model == i_psec_policy_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - i_psec_policy_identity_by_id_model_json2 = i_psec_policy_identity_by_id_model.to_dict( - ) + i_psec_policy_identity_by_id_model_json2 = i_psec_policy_identity_by_id_model.to_dict() assert i_psec_policy_identity_by_id_model_json2 == i_psec_policy_identity_by_id_model_json - class TestImageIdentityByCRN(): """ Test Class for ImageIdentityByCRN @@ -40022,29 +38594,23 @@ def test_image_identity_by_crn_serialization(self): # Construct a json representation of a ImageIdentityByCRN model image_identity_by_crn_model_json = {} - image_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation - image_identity_by_crn_model = ImageIdentityByCRN.from_dict( - image_identity_by_crn_model_json) + image_identity_by_crn_model = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json) assert image_identity_by_crn_model != False # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation - image_identity_by_crn_model_dict = ImageIdentityByCRN.from_dict( - image_identity_by_crn_model_json).__dict__ - image_identity_by_crn_model2 = ImageIdentityByCRN( - **image_identity_by_crn_model_dict) + image_identity_by_crn_model_dict = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json).__dict__ + image_identity_by_crn_model2 = ImageIdentityByCRN(**image_identity_by_crn_model_dict) # Verify the model instances are equivalent assert image_identity_by_crn_model == image_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - image_identity_by_crn_model_json2 = image_identity_by_crn_model.to_dict( - ) + image_identity_by_crn_model_json2 = image_identity_by_crn_model.to_dict() assert image_identity_by_crn_model_json2 == image_identity_by_crn_model_json - class TestImageIdentityByHref(): """ Test Class for ImageIdentityByHref @@ -40057,29 +38623,23 @@ def test_image_identity_by_href_serialization(self): # Construct a json representation of a ImageIdentityByHref model image_identity_by_href_model_json = {} - image_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation - image_identity_by_href_model = ImageIdentityByHref.from_dict( - image_identity_by_href_model_json) + image_identity_by_href_model = ImageIdentityByHref.from_dict(image_identity_by_href_model_json) assert image_identity_by_href_model != False # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation - image_identity_by_href_model_dict = ImageIdentityByHref.from_dict( - image_identity_by_href_model_json).__dict__ - image_identity_by_href_model2 = ImageIdentityByHref( - **image_identity_by_href_model_dict) + image_identity_by_href_model_dict = ImageIdentityByHref.from_dict(image_identity_by_href_model_json).__dict__ + image_identity_by_href_model2 = ImageIdentityByHref(**image_identity_by_href_model_dict) # Verify the model instances are equivalent assert image_identity_by_href_model == image_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - image_identity_by_href_model_json2 = image_identity_by_href_model.to_dict( - ) + image_identity_by_href_model_json2 = image_identity_by_href_model.to_dict() assert image_identity_by_href_model_json2 == image_identity_by_href_model_json - class TestImageIdentityById(): """ Test Class for ImageIdentityById @@ -40092,19 +38652,15 @@ def test_image_identity_by_id_serialization(self): # Construct a json representation of a ImageIdentityById model image_identity_by_id_model_json = {} - image_identity_by_id_model_json[ - 'id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_identity_by_id_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' # Construct a model instance of ImageIdentityById by calling from_dict on the json representation - image_identity_by_id_model = ImageIdentityById.from_dict( - image_identity_by_id_model_json) + image_identity_by_id_model = ImageIdentityById.from_dict(image_identity_by_id_model_json) assert image_identity_by_id_model != False # Construct a model instance of ImageIdentityById by calling from_dict on the json representation - image_identity_by_id_model_dict = ImageIdentityById.from_dict( - image_identity_by_id_model_json).__dict__ - image_identity_by_id_model2 = ImageIdentityById( - **image_identity_by_id_model_dict) + image_identity_by_id_model_dict = ImageIdentityById.from_dict(image_identity_by_id_model_json).__dict__ + image_identity_by_id_model2 = ImageIdentityById(**image_identity_by_id_model_dict) # Verify the model instances are equivalent assert image_identity_by_id_model == image_identity_by_id_model2 @@ -40113,7 +38669,6 @@ def test_image_identity_by_id_serialization(self): image_identity_by_id_model_json2 = image_identity_by_id_model.to_dict() assert image_identity_by_id_model_json2 == image_identity_by_id_model_json - class TestImagePrototypeImageByFile(): """ Test Class for ImagePrototypeImageByFile @@ -40126,53 +38681,83 @@ def test_image_prototype_image_by_file_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - image_file_prototype_model = {} # ImageFilePrototype - image_file_prototype_model[ - 'href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd' + image_file_prototype_model = {} # ImageFilePrototype + image_file_prototype_model['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd' - operating_system_identity_model = {} # OperatingSystemIdentityByName + operating_system_identity_model = {} # OperatingSystemIdentityByName operating_system_identity_model['name'] = 'ubuntu-16-amd64' # Construct a json representation of a ImagePrototypeImageByFile model image_prototype_image_by_file_model_json = {} image_prototype_image_by_file_model_json['name'] = 'my-image' - image_prototype_image_by_file_model_json[ - 'resource_group'] = resource_group_identity_model - image_prototype_image_by_file_model_json[ - 'encrypted_data_key'] = 'testString' - image_prototype_image_by_file_model_json[ - 'encryption_key'] = encryption_key_identity_model - image_prototype_image_by_file_model_json[ - 'file'] = image_file_prototype_model - image_prototype_image_by_file_model_json[ - 'operating_system'] = operating_system_identity_model + image_prototype_image_by_file_model_json['resource_group'] = resource_group_identity_model + image_prototype_image_by_file_model_json['encrypted_data_key'] = 'testString' + image_prototype_image_by_file_model_json['encryption_key'] = encryption_key_identity_model + image_prototype_image_by_file_model_json['file'] = image_file_prototype_model + image_prototype_image_by_file_model_json['operating_system'] = operating_system_identity_model # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation - image_prototype_image_by_file_model = ImagePrototypeImageByFile.from_dict( - image_prototype_image_by_file_model_json) + image_prototype_image_by_file_model = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json) assert image_prototype_image_by_file_model != False # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation - image_prototype_image_by_file_model_dict = ImagePrototypeImageByFile.from_dict( - image_prototype_image_by_file_model_json).__dict__ - image_prototype_image_by_file_model2 = ImagePrototypeImageByFile( - **image_prototype_image_by_file_model_dict) + image_prototype_image_by_file_model_dict = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json).__dict__ + image_prototype_image_by_file_model2 = ImagePrototypeImageByFile(**image_prototype_image_by_file_model_dict) # Verify the model instances are equivalent assert image_prototype_image_by_file_model == image_prototype_image_by_file_model2 # Convert model instance back to dict and verify no loss of data - image_prototype_image_by_file_model_json2 = image_prototype_image_by_file_model.to_dict( - ) + image_prototype_image_by_file_model_json2 = image_prototype_image_by_file_model.to_dict() assert image_prototype_image_by_file_model_json2 == image_prototype_image_by_file_model_json +class TestInstanceGroupManagerActionPatchScheduledActionPatch(): + """ + Test Class for InstanceGroupManagerActionPatchScheduledActionPatch + """ + + def test_instance_group_manager_action_patch_scheduled_action_patch_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionPatchScheduledActionPatch + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_group_patch_model = {} # InstanceGroupManagerScheduledActionGroupPatch + instance_group_manager_scheduled_action_group_patch_model['membership_count'] = 10 + + instance_group_manager_scheduled_action_by_manager_patch_manager_model = {} # InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch + instance_group_manager_scheduled_action_by_manager_patch_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_patch_manager_model['min_membership_count'] = 10 + + # Construct a json representation of a InstanceGroupManagerActionPatchScheduledActionPatch model + instance_group_manager_action_patch_scheduled_action_patch_model_json = {} + instance_group_manager_action_patch_scheduled_action_patch_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_patch_scheduled_action_patch_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_scheduled_action_patch_model_json['group'] = instance_group_manager_scheduled_action_group_patch_model + instance_group_manager_action_patch_scheduled_action_patch_model_json['manager'] = instance_group_manager_scheduled_action_by_manager_patch_manager_model + instance_group_manager_action_patch_scheduled_action_patch_model_json['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + + # Construct a model instance of InstanceGroupManagerActionPatchScheduledActionPatch by calling from_dict on the json representation + instance_group_manager_action_patch_scheduled_action_patch_model = InstanceGroupManagerActionPatchScheduledActionPatch.from_dict(instance_group_manager_action_patch_scheduled_action_patch_model_json) + assert instance_group_manager_action_patch_scheduled_action_patch_model != False + + # Construct a model instance of InstanceGroupManagerActionPatchScheduledActionPatch by calling from_dict on the json representation + instance_group_manager_action_patch_scheduled_action_patch_model_dict = InstanceGroupManagerActionPatchScheduledActionPatch.from_dict(instance_group_manager_action_patch_scheduled_action_patch_model_json).__dict__ + instance_group_manager_action_patch_scheduled_action_patch_model2 = InstanceGroupManagerActionPatchScheduledActionPatch(**instance_group_manager_action_patch_scheduled_action_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_patch_scheduled_action_patch_model == instance_group_manager_action_patch_scheduled_action_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_patch_scheduled_action_patch_model_json2 = instance_group_manager_action_patch_scheduled_action_patch_model.to_dict() + assert instance_group_manager_action_patch_scheduled_action_patch_model_json2 == instance_group_manager_action_patch_scheduled_action_patch_model_json class TestInstanceGroupManagerAutoScale(): """ @@ -40186,212 +38771,353 @@ def test_instance_group_manager_auto_scale_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_policy_reference_deleted_model = { - } # InstanceGroupManagerPolicyReferenceDeleted - instance_group_manager_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - instance_group_manager_policy_reference_model = { - } # InstanceGroupManagerPolicyReference - instance_group_manager_policy_reference_model[ - 'deleted'] = instance_group_manager_policy_reference_deleted_model - instance_group_manager_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_reference_model[ - 'name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted + instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_policy_reference_model = {} # InstanceGroupManagerPolicyReference + instance_group_manager_policy_reference_model['deleted'] = instance_group_manager_policy_reference_deleted_model + instance_group_manager_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_reference_model['name'] = 'my-instance-group-manager-policy' # Construct a json representation of a InstanceGroupManagerAutoScale model instance_group_manager_auto_scale_model_json = {} - instance_group_manager_auto_scale_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - instance_group_manager_auto_scale_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_auto_scale_model_json[ - 'management_enabled'] = True - instance_group_manager_auto_scale_model_json[ - 'name'] = 'my-instance-group-manager' + instance_group_manager_auto_scale_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_auto_scale_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_auto_scale_model_json['management_enabled'] = True + instance_group_manager_auto_scale_model_json['name'] = 'my-instance-group-manager' + instance_group_manager_auto_scale_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) instance_group_manager_auto_scale_model_json['aggregation_window'] = 120 instance_group_manager_auto_scale_model_json['cooldown'] = 210 - instance_group_manager_auto_scale_model_json[ - 'manager_type'] = 'autoscale' - instance_group_manager_auto_scale_model_json[ - 'max_membership_count'] = 10 - instance_group_manager_auto_scale_model_json[ - 'min_membership_count'] = 10 - instance_group_manager_auto_scale_model_json['policies'] = [ - instance_group_manager_policy_reference_model - ] + instance_group_manager_auto_scale_model_json['manager_type'] = 'autoscale' + instance_group_manager_auto_scale_model_json['max_membership_count'] = 10 + instance_group_manager_auto_scale_model_json['min_membership_count'] = 10 + instance_group_manager_auto_scale_model_json['policies'] = [instance_group_manager_policy_reference_model] # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation - instance_group_manager_auto_scale_model = InstanceGroupManagerAutoScale.from_dict( - instance_group_manager_auto_scale_model_json) + instance_group_manager_auto_scale_model = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json) assert instance_group_manager_auto_scale_model != False # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation - instance_group_manager_auto_scale_model_dict = InstanceGroupManagerAutoScale.from_dict( - instance_group_manager_auto_scale_model_json).__dict__ - instance_group_manager_auto_scale_model2 = InstanceGroupManagerAutoScale( - **instance_group_manager_auto_scale_model_dict) + instance_group_manager_auto_scale_model_dict = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json).__dict__ + instance_group_manager_auto_scale_model2 = InstanceGroupManagerAutoScale(**instance_group_manager_auto_scale_model_dict) # Verify the model instances are equivalent assert instance_group_manager_auto_scale_model == instance_group_manager_auto_scale_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_auto_scale_model_json2 = instance_group_manager_auto_scale_model.to_dict( - ) + instance_group_manager_auto_scale_model_json2 = instance_group_manager_auto_scale_model.to_dict() assert instance_group_manager_auto_scale_model_json2 == instance_group_manager_auto_scale_model_json - -class TestInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype( -): +class TestInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(): """ Test Class for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype """ - def test_instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_serialization( - self): + def test_instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_serialization(self): """ Test serialization/deserialization for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype """ # Construct a json representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json = {} - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json[ - 'name'] = 'my-instance-group-manager-policy' - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json[ - 'metric_type'] = 'cpu' - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json[ - 'metric_value'] = 38 - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json[ - 'policy_type'] = 'target' + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_type'] = 'cpu' + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_value'] = 38 + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['policy_type'] = 'target' # Construct a model instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict( - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json - ) + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json) assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model != False # Construct a model instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict( - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json - ).__dict__ - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2 = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype( - ** - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict - ) + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json).__dict__ + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2 = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(**instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 = instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model.to_dict( - ) + instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 = instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model.to_dict() assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json - class TestInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(): """ Test Class for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy """ - def test_instance_group_manager_policy_instance_group_manager_target_policy_serialization( - self): + def test_instance_group_manager_policy_instance_group_manager_target_policy_serialization(self): """ Test serialization/deserialization for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy """ # Construct a json representation of a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy model instance_group_manager_policy_instance_group_manager_target_policy_model_json = {} - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'name'] = 'my-instance-group-manager-policy' - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'metric_type'] = 'cpu' - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'metric_value'] = 38 - instance_group_manager_policy_instance_group_manager_target_policy_model_json[ - 'policy_type'] = 'target' + instance_group_manager_policy_instance_group_manager_target_policy_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_policy_instance_group_manager_target_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_instance_group_manager_target_policy_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_policy_instance_group_manager_target_policy_model_json['name'] = 'my-instance-group-manager-policy' + instance_group_manager_policy_instance_group_manager_target_policy_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_type'] = 'cpu' + instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_value'] = 38 + instance_group_manager_policy_instance_group_manager_target_policy_model_json['policy_type'] = 'target' # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation - instance_group_manager_policy_instance_group_manager_target_policy_model = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict( - instance_group_manager_policy_instance_group_manager_target_policy_model_json - ) + instance_group_manager_policy_instance_group_manager_target_policy_model = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json) assert instance_group_manager_policy_instance_group_manager_target_policy_model != False # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation - instance_group_manager_policy_instance_group_manager_target_policy_model_dict = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict( - instance_group_manager_policy_instance_group_manager_target_policy_model_json - ).__dict__ - instance_group_manager_policy_instance_group_manager_target_policy_model2 = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy( - ** - instance_group_manager_policy_instance_group_manager_target_policy_model_dict - ) + instance_group_manager_policy_instance_group_manager_target_policy_model_dict = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json).__dict__ + instance_group_manager_policy_instance_group_manager_target_policy_model2 = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(**instance_group_manager_policy_instance_group_manager_target_policy_model_dict) # Verify the model instances are equivalent assert instance_group_manager_policy_instance_group_manager_target_policy_model == instance_group_manager_policy_instance_group_manager_target_policy_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_instance_group_manager_target_policy_model_json2 = instance_group_manager_policy_instance_group_manager_target_policy_model.to_dict( - ) + instance_group_manager_policy_instance_group_manager_target_policy_model_json2 = instance_group_manager_policy_instance_group_manager_target_policy_model.to_dict() assert instance_group_manager_policy_instance_group_manager_target_policy_model_json2 == instance_group_manager_policy_instance_group_manager_target_policy_model_json - class TestInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(): """ Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype """ - def test_instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_serialization( - self): + def test_instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_serialization(self): """ Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype """ # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json = {} - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'management_enabled'] = True - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'name'] = 'my-instance-group-manager' - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'aggregation_window'] = 120 - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'cooldown'] = 210 - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'manager_type'] = 'autoscale' - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'max_membership_count'] = 10 - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json[ - 'min_membership_count'] = 10 + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['management_enabled'] = True + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['name'] = 'my-instance-group-manager' + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['aggregation_window'] = 120 + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['cooldown'] = 210 + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['manager_type'] = 'autoscale' + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['max_membership_count'] = 10 + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['min_membership_count'] = 10 # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict( - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json - ) + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json) assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model != False # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict( - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json - ).__dict__ - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype( - ** - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict - ) + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json).__dict__ + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(**instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict) # Verify the model instances are equivalent assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2 # Convert model instance back to dict and verify no loss of data - instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model.to_dict( - ) + instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model.to_dict() assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json +class TestInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(): + """ + Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype + """ + + def test_instance_group_manager_prototype_instance_group_manager_scheduled_prototype_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype + """ + + # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype model + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json = {} + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['management_enabled'] = True + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['name'] = 'my-instance-group-manager' + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['manager_type'] = 'scheduled' + + # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json) + assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model != False + + # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json).__dict__ + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(**instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model.to_dict() + assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json + +class TestInstanceGroupManagerScheduled(): + """ + Test Class for InstanceGroupManagerScheduled + """ + + def test_instance_group_manager_scheduled_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduled + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_action_reference_deleted_model = {} # InstanceGroupManagerActionReferenceDeleted + instance_group_manager_action_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_action_reference_model = {} # InstanceGroupManagerActionReference + instance_group_manager_action_reference_model['deleted'] = instance_group_manager_action_reference_deleted_model + instance_group_manager_action_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_reference_model['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_reference_model['resource_type'] = 'instance_group_manager_action' + + # Construct a json representation of a InstanceGroupManagerScheduled model + instance_group_manager_scheduled_model_json = {} + instance_group_manager_scheduled_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_scheduled_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_scheduled_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_scheduled_model_json['management_enabled'] = True + instance_group_manager_scheduled_model_json['name'] = 'my-instance-group-manager' + instance_group_manager_scheduled_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_scheduled_model_json['actions'] = [instance_group_manager_action_reference_model] + instance_group_manager_scheduled_model_json['manager_type'] = 'scheduled' + + # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation + instance_group_manager_scheduled_model = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json) + assert instance_group_manager_scheduled_model != False + + # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation + instance_group_manager_scheduled_model_dict = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json).__dict__ + instance_group_manager_scheduled_model2 = InstanceGroupManagerScheduled(**instance_group_manager_scheduled_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_model == instance_group_manager_scheduled_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_model_json2 = instance_group_manager_scheduled_model.to_dict() + assert instance_group_manager_scheduled_model_json2 == instance_group_manager_scheduled_model_json + +class TestInstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch(): + """ + Test Class for InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch + """ + + def test_instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch model + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json = {} + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json['min_membership_count'] = 10 + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model = InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch.from_dict(instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json) + assert instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_dict = InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch.from_dict(instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json).__dict__ + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model2 = InstanceGroupManagerScheduledActionByManagerPatchManagerAutoScalePatch(**instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model == instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json2 = instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model.to_dict() + assert instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json2 == instance_group_manager_scheduled_action_by_manager_patch_manager_auto_scale_patch_model_json + +class TestInstanceGroupManagerScheduledActionManagerManagerAutoScale(): + """ + Test Class for InstanceGroupManagerScheduledActionManagerManagerAutoScale + """ + + def test_instance_group_manager_scheduled_action_manager_manager_auto_scale_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerManagerAutoScale + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted + instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a InstanceGroupManagerScheduledActionManagerManagerAutoScale model + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json = {} + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['deleted'] = instance_group_manager_reference_deleted_model + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['name'] = 'my-instance-group-manager' + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['max_membership_count'] = 10 + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json['min_membership_count'] = 10 + + # Construct a model instance of InstanceGroupManagerScheduledActionManagerManagerAutoScale by calling from_dict on the json representation + instance_group_manager_scheduled_action_manager_manager_auto_scale_model = InstanceGroupManagerScheduledActionManagerManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json) + assert instance_group_manager_scheduled_action_manager_manager_auto_scale_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionManagerManagerAutoScale by calling from_dict on the json representation + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_dict = InstanceGroupManagerScheduledActionManagerManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json).__dict__ + instance_group_manager_scheduled_action_manager_manager_auto_scale_model2 = InstanceGroupManagerScheduledActionManagerManagerAutoScale(**instance_group_manager_scheduled_action_manager_manager_auto_scale_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_manager_manager_auto_scale_model == instance_group_manager_scheduled_action_manager_manager_auto_scale_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json2 = instance_group_manager_scheduled_action_manager_manager_auto_scale_model.to_dict() + assert instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json2 == instance_group_manager_scheduled_action_manager_manager_auto_scale_model_json + +class TestInstancePatchProfileInstanceProfileIdentityByHref(): + """ + Test Class for InstancePatchProfileInstanceProfileIdentityByHref + """ + + def test_instance_patch_profile_instance_profile_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByHref + """ + + # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByHref model + instance_patch_profile_instance_profile_identity_by_href_model_json = {} + instance_patch_profile_instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + + # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation + instance_patch_profile_instance_profile_identity_by_href_model = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json) + assert instance_patch_profile_instance_profile_identity_by_href_model != False + + # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation + instance_patch_profile_instance_profile_identity_by_href_model_dict = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json).__dict__ + instance_patch_profile_instance_profile_identity_by_href_model2 = InstancePatchProfileInstanceProfileIdentityByHref(**instance_patch_profile_instance_profile_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_patch_profile_instance_profile_identity_by_href_model == instance_patch_profile_instance_profile_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_patch_profile_instance_profile_identity_by_href_model_json2 = instance_patch_profile_instance_profile_identity_by_href_model.to_dict() + assert instance_patch_profile_instance_profile_identity_by_href_model_json2 == instance_patch_profile_instance_profile_identity_by_href_model_json + +class TestInstancePatchProfileInstanceProfileIdentityByName(): + """ + Test Class for InstancePatchProfileInstanceProfileIdentityByName + """ + + def test_instance_patch_profile_instance_profile_identity_by_name_serialization(self): + """ + Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByName + """ + + # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByName model + instance_patch_profile_instance_profile_identity_by_name_model_json = {} + instance_patch_profile_instance_profile_identity_by_name_model_json['name'] = 'bc1-4x16' + + # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation + instance_patch_profile_instance_profile_identity_by_name_model = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json) + assert instance_patch_profile_instance_profile_identity_by_name_model != False + + # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation + instance_patch_profile_instance_profile_identity_by_name_model_dict = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json).__dict__ + instance_patch_profile_instance_profile_identity_by_name_model2 = InstancePatchProfileInstanceProfileIdentityByName(**instance_patch_profile_instance_profile_identity_by_name_model_dict) + + # Verify the model instances are equivalent + assert instance_patch_profile_instance_profile_identity_by_name_model == instance_patch_profile_instance_profile_identity_by_name_model2 + + # Convert model instance back to dict and verify no loss of data + instance_patch_profile_instance_profile_identity_by_name_model_json2 = instance_patch_profile_instance_profile_identity_by_name_model.to_dict() + assert instance_patch_profile_instance_profile_identity_by_name_model_json2 == instance_patch_profile_instance_profile_identity_by_name_model_json class TestInstanceProfileBandwidthDependent(): """ @@ -40408,25 +39134,20 @@ def test_instance_profile_bandwidth_dependent_serialization(self): instance_profile_bandwidth_dependent_model_json['type'] = 'dependent' # Construct a model instance of InstanceProfileBandwidthDependent by calling from_dict on the json representation - instance_profile_bandwidth_dependent_model = InstanceProfileBandwidthDependent.from_dict( - instance_profile_bandwidth_dependent_model_json) + instance_profile_bandwidth_dependent_model = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json) assert instance_profile_bandwidth_dependent_model != False # Construct a model instance of InstanceProfileBandwidthDependent by calling from_dict on the json representation - instance_profile_bandwidth_dependent_model_dict = InstanceProfileBandwidthDependent.from_dict( - instance_profile_bandwidth_dependent_model_json).__dict__ - instance_profile_bandwidth_dependent_model2 = InstanceProfileBandwidthDependent( - **instance_profile_bandwidth_dependent_model_dict) + instance_profile_bandwidth_dependent_model_dict = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json).__dict__ + instance_profile_bandwidth_dependent_model2 = InstanceProfileBandwidthDependent(**instance_profile_bandwidth_dependent_model_dict) # Verify the model instances are equivalent assert instance_profile_bandwidth_dependent_model == instance_profile_bandwidth_dependent_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_bandwidth_dependent_model_json2 = instance_profile_bandwidth_dependent_model.to_dict( - ) + instance_profile_bandwidth_dependent_model_json2 = instance_profile_bandwidth_dependent_model.to_dict() assert instance_profile_bandwidth_dependent_model_json2 == instance_profile_bandwidth_dependent_model_json - class TestInstanceProfileBandwidthEnum(): """ Test Class for InstanceProfileBandwidthEnum @@ -40441,30 +39162,23 @@ def test_instance_profile_bandwidth_enum_serialization(self): instance_profile_bandwidth_enum_model_json = {} instance_profile_bandwidth_enum_model_json['default'] = 38 instance_profile_bandwidth_enum_model_json['type'] = 'enum' - instance_profile_bandwidth_enum_model_json['values'] = [ - 16000, 32000, 48000 - ] + instance_profile_bandwidth_enum_model_json['values'] = [38] # Construct a model instance of InstanceProfileBandwidthEnum by calling from_dict on the json representation - instance_profile_bandwidth_enum_model = InstanceProfileBandwidthEnum.from_dict( - instance_profile_bandwidth_enum_model_json) + instance_profile_bandwidth_enum_model = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json) assert instance_profile_bandwidth_enum_model != False # Construct a model instance of InstanceProfileBandwidthEnum by calling from_dict on the json representation - instance_profile_bandwidth_enum_model_dict = InstanceProfileBandwidthEnum.from_dict( - instance_profile_bandwidth_enum_model_json).__dict__ - instance_profile_bandwidth_enum_model2 = InstanceProfileBandwidthEnum( - **instance_profile_bandwidth_enum_model_dict) + instance_profile_bandwidth_enum_model_dict = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json).__dict__ + instance_profile_bandwidth_enum_model2 = InstanceProfileBandwidthEnum(**instance_profile_bandwidth_enum_model_dict) # Verify the model instances are equivalent assert instance_profile_bandwidth_enum_model == instance_profile_bandwidth_enum_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_bandwidth_enum_model_json2 = instance_profile_bandwidth_enum_model.to_dict( - ) + instance_profile_bandwidth_enum_model_json2 = instance_profile_bandwidth_enum_model.to_dict() assert instance_profile_bandwidth_enum_model_json2 == instance_profile_bandwidth_enum_model_json - class TestInstanceProfileBandwidthFixed(): """ Test Class for InstanceProfileBandwidthFixed @@ -40481,25 +39195,20 @@ def test_instance_profile_bandwidth_fixed_serialization(self): instance_profile_bandwidth_fixed_model_json['value'] = 20000 # Construct a model instance of InstanceProfileBandwidthFixed by calling from_dict on the json representation - instance_profile_bandwidth_fixed_model = InstanceProfileBandwidthFixed.from_dict( - instance_profile_bandwidth_fixed_model_json) + instance_profile_bandwidth_fixed_model = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json) assert instance_profile_bandwidth_fixed_model != False # Construct a model instance of InstanceProfileBandwidthFixed by calling from_dict on the json representation - instance_profile_bandwidth_fixed_model_dict = InstanceProfileBandwidthFixed.from_dict( - instance_profile_bandwidth_fixed_model_json).__dict__ - instance_profile_bandwidth_fixed_model2 = InstanceProfileBandwidthFixed( - **instance_profile_bandwidth_fixed_model_dict) + instance_profile_bandwidth_fixed_model_dict = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json).__dict__ + instance_profile_bandwidth_fixed_model2 = InstanceProfileBandwidthFixed(**instance_profile_bandwidth_fixed_model_dict) # Verify the model instances are equivalent assert instance_profile_bandwidth_fixed_model == instance_profile_bandwidth_fixed_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_bandwidth_fixed_model_json2 = instance_profile_bandwidth_fixed_model.to_dict( - ) + instance_profile_bandwidth_fixed_model_json2 = instance_profile_bandwidth_fixed_model.to_dict() assert instance_profile_bandwidth_fixed_model_json2 == instance_profile_bandwidth_fixed_model_json - class TestInstanceProfileBandwidthRange(): """ Test Class for InstanceProfileBandwidthRange @@ -40519,24 +39228,265 @@ def test_instance_profile_bandwidth_range_serialization(self): instance_profile_bandwidth_range_model_json['type'] = 'range' # Construct a model instance of InstanceProfileBandwidthRange by calling from_dict on the json representation - instance_profile_bandwidth_range_model = InstanceProfileBandwidthRange.from_dict( - instance_profile_bandwidth_range_model_json) + instance_profile_bandwidth_range_model = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json) assert instance_profile_bandwidth_range_model != False # Construct a model instance of InstanceProfileBandwidthRange by calling from_dict on the json representation - instance_profile_bandwidth_range_model_dict = InstanceProfileBandwidthRange.from_dict( - instance_profile_bandwidth_range_model_json).__dict__ - instance_profile_bandwidth_range_model2 = InstanceProfileBandwidthRange( - **instance_profile_bandwidth_range_model_dict) + instance_profile_bandwidth_range_model_dict = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json).__dict__ + instance_profile_bandwidth_range_model2 = InstanceProfileBandwidthRange(**instance_profile_bandwidth_range_model_dict) # Verify the model instances are equivalent assert instance_profile_bandwidth_range_model == instance_profile_bandwidth_range_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_bandwidth_range_model_json2 = instance_profile_bandwidth_range_model.to_dict( - ) + instance_profile_bandwidth_range_model_json2 = instance_profile_bandwidth_range_model.to_dict() assert instance_profile_bandwidth_range_model_json2 == instance_profile_bandwidth_range_model_json +class TestInstanceProfileDiskQuantityDependent(): + """ + Test Class for InstanceProfileDiskQuantityDependent + """ + + def test_instance_profile_disk_quantity_dependent_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskQuantityDependent + """ + + # Construct a json representation of a InstanceProfileDiskQuantityDependent model + instance_profile_disk_quantity_dependent_model_json = {} + instance_profile_disk_quantity_dependent_model_json['type'] = 'dependent' + + # Construct a model instance of InstanceProfileDiskQuantityDependent by calling from_dict on the json representation + instance_profile_disk_quantity_dependent_model = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json) + assert instance_profile_disk_quantity_dependent_model != False + + # Construct a model instance of InstanceProfileDiskQuantityDependent by calling from_dict on the json representation + instance_profile_disk_quantity_dependent_model_dict = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json).__dict__ + instance_profile_disk_quantity_dependent_model2 = InstanceProfileDiskQuantityDependent(**instance_profile_disk_quantity_dependent_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_quantity_dependent_model == instance_profile_disk_quantity_dependent_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_quantity_dependent_model_json2 = instance_profile_disk_quantity_dependent_model.to_dict() + assert instance_profile_disk_quantity_dependent_model_json2 == instance_profile_disk_quantity_dependent_model_json + +class TestInstanceProfileDiskQuantityEnum(): + """ + Test Class for InstanceProfileDiskQuantityEnum + """ + + def test_instance_profile_disk_quantity_enum_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskQuantityEnum + """ + + # Construct a json representation of a InstanceProfileDiskQuantityEnum model + instance_profile_disk_quantity_enum_model_json = {} + instance_profile_disk_quantity_enum_model_json['default'] = 38 + instance_profile_disk_quantity_enum_model_json['type'] = 'enum' + instance_profile_disk_quantity_enum_model_json['values'] = [1, 2, 4, 8] + + # Construct a model instance of InstanceProfileDiskQuantityEnum by calling from_dict on the json representation + instance_profile_disk_quantity_enum_model = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json) + assert instance_profile_disk_quantity_enum_model != False + + # Construct a model instance of InstanceProfileDiskQuantityEnum by calling from_dict on the json representation + instance_profile_disk_quantity_enum_model_dict = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json).__dict__ + instance_profile_disk_quantity_enum_model2 = InstanceProfileDiskQuantityEnum(**instance_profile_disk_quantity_enum_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_quantity_enum_model == instance_profile_disk_quantity_enum_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_quantity_enum_model_json2 = instance_profile_disk_quantity_enum_model.to_dict() + assert instance_profile_disk_quantity_enum_model_json2 == instance_profile_disk_quantity_enum_model_json + +class TestInstanceProfileDiskQuantityFixed(): + """ + Test Class for InstanceProfileDiskQuantityFixed + """ + + def test_instance_profile_disk_quantity_fixed_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskQuantityFixed + """ + + # Construct a json representation of a InstanceProfileDiskQuantityFixed model + instance_profile_disk_quantity_fixed_model_json = {} + instance_profile_disk_quantity_fixed_model_json['type'] = 'fixed' + instance_profile_disk_quantity_fixed_model_json['value'] = 4 + + # Construct a model instance of InstanceProfileDiskQuantityFixed by calling from_dict on the json representation + instance_profile_disk_quantity_fixed_model = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json) + assert instance_profile_disk_quantity_fixed_model != False + + # Construct a model instance of InstanceProfileDiskQuantityFixed by calling from_dict on the json representation + instance_profile_disk_quantity_fixed_model_dict = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json).__dict__ + instance_profile_disk_quantity_fixed_model2 = InstanceProfileDiskQuantityFixed(**instance_profile_disk_quantity_fixed_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_quantity_fixed_model == instance_profile_disk_quantity_fixed_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_quantity_fixed_model_json2 = instance_profile_disk_quantity_fixed_model.to_dict() + assert instance_profile_disk_quantity_fixed_model_json2 == instance_profile_disk_quantity_fixed_model_json + +class TestInstanceProfileDiskQuantityRange(): + """ + Test Class for InstanceProfileDiskQuantityRange + """ + + def test_instance_profile_disk_quantity_range_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskQuantityRange + """ + + # Construct a json representation of a InstanceProfileDiskQuantityRange model + instance_profile_disk_quantity_range_model_json = {} + instance_profile_disk_quantity_range_model_json['default'] = 1 + instance_profile_disk_quantity_range_model_json['max'] = 4 + instance_profile_disk_quantity_range_model_json['min'] = 1 + instance_profile_disk_quantity_range_model_json['step'] = 1 + instance_profile_disk_quantity_range_model_json['type'] = 'range' + + # Construct a model instance of InstanceProfileDiskQuantityRange by calling from_dict on the json representation + instance_profile_disk_quantity_range_model = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json) + assert instance_profile_disk_quantity_range_model != False + + # Construct a model instance of InstanceProfileDiskQuantityRange by calling from_dict on the json representation + instance_profile_disk_quantity_range_model_dict = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json).__dict__ + instance_profile_disk_quantity_range_model2 = InstanceProfileDiskQuantityRange(**instance_profile_disk_quantity_range_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_quantity_range_model == instance_profile_disk_quantity_range_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_quantity_range_model_json2 = instance_profile_disk_quantity_range_model.to_dict() + assert instance_profile_disk_quantity_range_model_json2 == instance_profile_disk_quantity_range_model_json + +class TestInstanceProfileDiskSizeDependent(): + """ + Test Class for InstanceProfileDiskSizeDependent + """ + + def test_instance_profile_disk_size_dependent_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskSizeDependent + """ + + # Construct a json representation of a InstanceProfileDiskSizeDependent model + instance_profile_disk_size_dependent_model_json = {} + instance_profile_disk_size_dependent_model_json['type'] = 'dependent' + + # Construct a model instance of InstanceProfileDiskSizeDependent by calling from_dict on the json representation + instance_profile_disk_size_dependent_model = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json) + assert instance_profile_disk_size_dependent_model != False + + # Construct a model instance of InstanceProfileDiskSizeDependent by calling from_dict on the json representation + instance_profile_disk_size_dependent_model_dict = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json).__dict__ + instance_profile_disk_size_dependent_model2 = InstanceProfileDiskSizeDependent(**instance_profile_disk_size_dependent_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_size_dependent_model == instance_profile_disk_size_dependent_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_size_dependent_model_json2 = instance_profile_disk_size_dependent_model.to_dict() + assert instance_profile_disk_size_dependent_model_json2 == instance_profile_disk_size_dependent_model_json + +class TestInstanceProfileDiskSizeEnum(): + """ + Test Class for InstanceProfileDiskSizeEnum + """ + + def test_instance_profile_disk_size_enum_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskSizeEnum + """ + + # Construct a json representation of a InstanceProfileDiskSizeEnum model + instance_profile_disk_size_enum_model_json = {} + instance_profile_disk_size_enum_model_json['default'] = 38 + instance_profile_disk_size_enum_model_json['type'] = 'enum' + instance_profile_disk_size_enum_model_json['values'] = [1, 2, 4, 8] + + # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation + instance_profile_disk_size_enum_model = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json) + assert instance_profile_disk_size_enum_model != False + + # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation + instance_profile_disk_size_enum_model_dict = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json).__dict__ + instance_profile_disk_size_enum_model2 = InstanceProfileDiskSizeEnum(**instance_profile_disk_size_enum_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_size_enum_model == instance_profile_disk_size_enum_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_size_enum_model_json2 = instance_profile_disk_size_enum_model.to_dict() + assert instance_profile_disk_size_enum_model_json2 == instance_profile_disk_size_enum_model_json + +class TestInstanceProfileDiskSizeFixed(): + """ + Test Class for InstanceProfileDiskSizeFixed + """ + + def test_instance_profile_disk_size_fixed_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskSizeFixed + """ + + # Construct a json representation of a InstanceProfileDiskSizeFixed model + instance_profile_disk_size_fixed_model_json = {} + instance_profile_disk_size_fixed_model_json['type'] = 'fixed' + instance_profile_disk_size_fixed_model_json['value'] = 100 + + # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation + instance_profile_disk_size_fixed_model = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json) + assert instance_profile_disk_size_fixed_model != False + + # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation + instance_profile_disk_size_fixed_model_dict = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json).__dict__ + instance_profile_disk_size_fixed_model2 = InstanceProfileDiskSizeFixed(**instance_profile_disk_size_fixed_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_size_fixed_model == instance_profile_disk_size_fixed_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_size_fixed_model_json2 = instance_profile_disk_size_fixed_model.to_dict() + assert instance_profile_disk_size_fixed_model_json2 == instance_profile_disk_size_fixed_model_json + +class TestInstanceProfileDiskSizeRange(): + """ + Test Class for InstanceProfileDiskSizeRange + """ + + def test_instance_profile_disk_size_range_serialization(self): + """ + Test serialization/deserialization for InstanceProfileDiskSizeRange + """ + + # Construct a json representation of a InstanceProfileDiskSizeRange model + instance_profile_disk_size_range_model_json = {} + instance_profile_disk_size_range_model_json['default'] = 100 + instance_profile_disk_size_range_model_json['max'] = 1000 + instance_profile_disk_size_range_model_json['min'] = 100 + instance_profile_disk_size_range_model_json['step'] = 10 + instance_profile_disk_size_range_model_json['type'] = 'range' + + # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation + instance_profile_disk_size_range_model = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json) + assert instance_profile_disk_size_range_model != False + + # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation + instance_profile_disk_size_range_model_dict = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json).__dict__ + instance_profile_disk_size_range_model2 = InstanceProfileDiskSizeRange(**instance_profile_disk_size_range_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_disk_size_range_model == instance_profile_disk_size_range_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_disk_size_range_model_json2 = instance_profile_disk_size_range_model.to_dict() + assert instance_profile_disk_size_range_model_json2 == instance_profile_disk_size_range_model_json class TestInstanceProfileIdentityByHref(): """ @@ -40550,29 +39500,23 @@ def test_instance_profile_identity_by_href_serialization(self): # Construct a json representation of a InstanceProfileIdentityByHref model instance_profile_identity_by_href_model_json = {} - instance_profile_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation - instance_profile_identity_by_href_model = InstanceProfileIdentityByHref.from_dict( - instance_profile_identity_by_href_model_json) + instance_profile_identity_by_href_model = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json) assert instance_profile_identity_by_href_model != False # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation - instance_profile_identity_by_href_model_dict = InstanceProfileIdentityByHref.from_dict( - instance_profile_identity_by_href_model_json).__dict__ - instance_profile_identity_by_href_model2 = InstanceProfileIdentityByHref( - **instance_profile_identity_by_href_model_dict) + instance_profile_identity_by_href_model_dict = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json).__dict__ + instance_profile_identity_by_href_model2 = InstanceProfileIdentityByHref(**instance_profile_identity_by_href_model_dict) # Verify the model instances are equivalent assert instance_profile_identity_by_href_model == instance_profile_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_identity_by_href_model_json2 = instance_profile_identity_by_href_model.to_dict( - ) + instance_profile_identity_by_href_model_json2 = instance_profile_identity_by_href_model.to_dict() assert instance_profile_identity_by_href_model_json2 == instance_profile_identity_by_href_model_json - class TestInstanceProfileIdentityByName(): """ Test Class for InstanceProfileIdentityByName @@ -40588,25 +39532,20 @@ def test_instance_profile_identity_by_name_serialization(self): instance_profile_identity_by_name_model_json['name'] = 'bc1-4x16' # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation - instance_profile_identity_by_name_model = InstanceProfileIdentityByName.from_dict( - instance_profile_identity_by_name_model_json) + instance_profile_identity_by_name_model = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json) assert instance_profile_identity_by_name_model != False # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation - instance_profile_identity_by_name_model_dict = InstanceProfileIdentityByName.from_dict( - instance_profile_identity_by_name_model_json).__dict__ - instance_profile_identity_by_name_model2 = InstanceProfileIdentityByName( - **instance_profile_identity_by_name_model_dict) + instance_profile_identity_by_name_model_dict = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json).__dict__ + instance_profile_identity_by_name_model2 = InstanceProfileIdentityByName(**instance_profile_identity_by_name_model_dict) # Verify the model instances are equivalent assert instance_profile_identity_by_name_model == instance_profile_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_identity_by_name_model_json2 = instance_profile_identity_by_name_model.to_dict( - ) + instance_profile_identity_by_name_model_json2 = instance_profile_identity_by_name_model.to_dict() assert instance_profile_identity_by_name_model_json2 == instance_profile_identity_by_name_model_json - class TestInstanceProfileMemoryDependent(): """ Test Class for InstanceProfileMemoryDependent @@ -40622,25 +39561,20 @@ def test_instance_profile_memory_dependent_serialization(self): instance_profile_memory_dependent_model_json['type'] = 'dependent' # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation - instance_profile_memory_dependent_model = InstanceProfileMemoryDependent.from_dict( - instance_profile_memory_dependent_model_json) + instance_profile_memory_dependent_model = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json) assert instance_profile_memory_dependent_model != False # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation - instance_profile_memory_dependent_model_dict = InstanceProfileMemoryDependent.from_dict( - instance_profile_memory_dependent_model_json).__dict__ - instance_profile_memory_dependent_model2 = InstanceProfileMemoryDependent( - **instance_profile_memory_dependent_model_dict) + instance_profile_memory_dependent_model_dict = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json).__dict__ + instance_profile_memory_dependent_model2 = InstanceProfileMemoryDependent(**instance_profile_memory_dependent_model_dict) # Verify the model instances are equivalent assert instance_profile_memory_dependent_model == instance_profile_memory_dependent_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_memory_dependent_model_json2 = instance_profile_memory_dependent_model.to_dict( - ) + instance_profile_memory_dependent_model_json2 = instance_profile_memory_dependent_model.to_dict() assert instance_profile_memory_dependent_model_json2 == instance_profile_memory_dependent_model_json - class TestInstanceProfileMemoryEnum(): """ Test Class for InstanceProfileMemoryEnum @@ -40658,25 +39592,20 @@ def test_instance_profile_memory_enum_serialization(self): instance_profile_memory_enum_model_json['values'] = [8, 16, 32] # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation - instance_profile_memory_enum_model = InstanceProfileMemoryEnum.from_dict( - instance_profile_memory_enum_model_json) + instance_profile_memory_enum_model = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json) assert instance_profile_memory_enum_model != False # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation - instance_profile_memory_enum_model_dict = InstanceProfileMemoryEnum.from_dict( - instance_profile_memory_enum_model_json).__dict__ - instance_profile_memory_enum_model2 = InstanceProfileMemoryEnum( - **instance_profile_memory_enum_model_dict) + instance_profile_memory_enum_model_dict = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json).__dict__ + instance_profile_memory_enum_model2 = InstanceProfileMemoryEnum(**instance_profile_memory_enum_model_dict) # Verify the model instances are equivalent assert instance_profile_memory_enum_model == instance_profile_memory_enum_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_memory_enum_model_json2 = instance_profile_memory_enum_model.to_dict( - ) + instance_profile_memory_enum_model_json2 = instance_profile_memory_enum_model.to_dict() assert instance_profile_memory_enum_model_json2 == instance_profile_memory_enum_model_json - class TestInstanceProfileMemoryFixed(): """ Test Class for InstanceProfileMemoryFixed @@ -40693,25 +39622,20 @@ def test_instance_profile_memory_fixed_serialization(self): instance_profile_memory_fixed_model_json['value'] = 16 # Construct a model instance of InstanceProfileMemoryFixed by calling from_dict on the json representation - instance_profile_memory_fixed_model = InstanceProfileMemoryFixed.from_dict( - instance_profile_memory_fixed_model_json) + instance_profile_memory_fixed_model = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json) assert instance_profile_memory_fixed_model != False # Construct a model instance of InstanceProfileMemoryFixed by calling from_dict on the json representation - instance_profile_memory_fixed_model_dict = InstanceProfileMemoryFixed.from_dict( - instance_profile_memory_fixed_model_json).__dict__ - instance_profile_memory_fixed_model2 = InstanceProfileMemoryFixed( - **instance_profile_memory_fixed_model_dict) + instance_profile_memory_fixed_model_dict = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json).__dict__ + instance_profile_memory_fixed_model2 = InstanceProfileMemoryFixed(**instance_profile_memory_fixed_model_dict) # Verify the model instances are equivalent assert instance_profile_memory_fixed_model == instance_profile_memory_fixed_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_memory_fixed_model_json2 = instance_profile_memory_fixed_model.to_dict( - ) + instance_profile_memory_fixed_model_json2 = instance_profile_memory_fixed_model.to_dict() assert instance_profile_memory_fixed_model_json2 == instance_profile_memory_fixed_model_json - class TestInstanceProfileMemoryRange(): """ Test Class for InstanceProfileMemoryRange @@ -40731,25 +39655,20 @@ def test_instance_profile_memory_range_serialization(self): instance_profile_memory_range_model_json['type'] = 'range' # Construct a model instance of InstanceProfileMemoryRange by calling from_dict on the json representation - instance_profile_memory_range_model = InstanceProfileMemoryRange.from_dict( - instance_profile_memory_range_model_json) + instance_profile_memory_range_model = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json) assert instance_profile_memory_range_model != False # Construct a model instance of InstanceProfileMemoryRange by calling from_dict on the json representation - instance_profile_memory_range_model_dict = InstanceProfileMemoryRange.from_dict( - instance_profile_memory_range_model_json).__dict__ - instance_profile_memory_range_model2 = InstanceProfileMemoryRange( - **instance_profile_memory_range_model_dict) + instance_profile_memory_range_model_dict = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json).__dict__ + instance_profile_memory_range_model2 = InstanceProfileMemoryRange(**instance_profile_memory_range_model_dict) # Verify the model instances are equivalent assert instance_profile_memory_range_model == instance_profile_memory_range_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_memory_range_model_json2 = instance_profile_memory_range_model.to_dict( - ) + instance_profile_memory_range_model_json2 = instance_profile_memory_range_model.to_dict() assert instance_profile_memory_range_model_json2 == instance_profile_memory_range_model_json - class TestInstanceProfilePortSpeedDependent(): """ Test Class for InstanceProfilePortSpeedDependent @@ -40765,25 +39684,20 @@ def test_instance_profile_port_speed_dependent_serialization(self): instance_profile_port_speed_dependent_model_json['type'] = 'dependent' # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation - instance_profile_port_speed_dependent_model = InstanceProfilePortSpeedDependent.from_dict( - instance_profile_port_speed_dependent_model_json) + instance_profile_port_speed_dependent_model = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json) assert instance_profile_port_speed_dependent_model != False # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation - instance_profile_port_speed_dependent_model_dict = InstanceProfilePortSpeedDependent.from_dict( - instance_profile_port_speed_dependent_model_json).__dict__ - instance_profile_port_speed_dependent_model2 = InstanceProfilePortSpeedDependent( - **instance_profile_port_speed_dependent_model_dict) + instance_profile_port_speed_dependent_model_dict = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json).__dict__ + instance_profile_port_speed_dependent_model2 = InstanceProfilePortSpeedDependent(**instance_profile_port_speed_dependent_model_dict) # Verify the model instances are equivalent assert instance_profile_port_speed_dependent_model == instance_profile_port_speed_dependent_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_port_speed_dependent_model_json2 = instance_profile_port_speed_dependent_model.to_dict( - ) + instance_profile_port_speed_dependent_model_json2 = instance_profile_port_speed_dependent_model.to_dict() assert instance_profile_port_speed_dependent_model_json2 == instance_profile_port_speed_dependent_model_json - class TestInstanceProfilePortSpeedFixed(): """ Test Class for InstanceProfilePortSpeedFixed @@ -40800,25 +39714,20 @@ def test_instance_profile_port_speed_fixed_serialization(self): instance_profile_port_speed_fixed_model_json['value'] = 1000 # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation - instance_profile_port_speed_fixed_model = InstanceProfilePortSpeedFixed.from_dict( - instance_profile_port_speed_fixed_model_json) + instance_profile_port_speed_fixed_model = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json) assert instance_profile_port_speed_fixed_model != False # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation - instance_profile_port_speed_fixed_model_dict = InstanceProfilePortSpeedFixed.from_dict( - instance_profile_port_speed_fixed_model_json).__dict__ - instance_profile_port_speed_fixed_model2 = InstanceProfilePortSpeedFixed( - **instance_profile_port_speed_fixed_model_dict) + instance_profile_port_speed_fixed_model_dict = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json).__dict__ + instance_profile_port_speed_fixed_model2 = InstanceProfilePortSpeedFixed(**instance_profile_port_speed_fixed_model_dict) # Verify the model instances are equivalent assert instance_profile_port_speed_fixed_model == instance_profile_port_speed_fixed_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_port_speed_fixed_model_json2 = instance_profile_port_speed_fixed_model.to_dict( - ) + instance_profile_port_speed_fixed_model_json2 = instance_profile_port_speed_fixed_model.to_dict() assert instance_profile_port_speed_fixed_model_json2 == instance_profile_port_speed_fixed_model_json - class TestInstanceProfileVCPUDependent(): """ Test Class for InstanceProfileVCPUDependent @@ -40834,25 +39743,20 @@ def test_instance_profile_vcpu_dependent_serialization(self): instance_profile_vcpu_dependent_model_json['type'] = 'dependent' # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation - instance_profile_vcpu_dependent_model = InstanceProfileVCPUDependent.from_dict( - instance_profile_vcpu_dependent_model_json) + instance_profile_vcpu_dependent_model = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json) assert instance_profile_vcpu_dependent_model != False # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation - instance_profile_vcpu_dependent_model_dict = InstanceProfileVCPUDependent.from_dict( - instance_profile_vcpu_dependent_model_json).__dict__ - instance_profile_vcpu_dependent_model2 = InstanceProfileVCPUDependent( - **instance_profile_vcpu_dependent_model_dict) + instance_profile_vcpu_dependent_model_dict = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json).__dict__ + instance_profile_vcpu_dependent_model2 = InstanceProfileVCPUDependent(**instance_profile_vcpu_dependent_model_dict) # Verify the model instances are equivalent assert instance_profile_vcpu_dependent_model == instance_profile_vcpu_dependent_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_vcpu_dependent_model_json2 = instance_profile_vcpu_dependent_model.to_dict( - ) + instance_profile_vcpu_dependent_model_json2 = instance_profile_vcpu_dependent_model.to_dict() assert instance_profile_vcpu_dependent_model_json2 == instance_profile_vcpu_dependent_model_json - class TestInstanceProfileVCPUEnum(): """ Test Class for InstanceProfileVCPUEnum @@ -40870,25 +39774,20 @@ def test_instance_profile_vcpu_enum_serialization(self): instance_profile_vcpu_enum_model_json['values'] = [2, 4, 16] # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation - instance_profile_vcpu_enum_model = InstanceProfileVCPUEnum.from_dict( - instance_profile_vcpu_enum_model_json) + instance_profile_vcpu_enum_model = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json) assert instance_profile_vcpu_enum_model != False # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation - instance_profile_vcpu_enum_model_dict = InstanceProfileVCPUEnum.from_dict( - instance_profile_vcpu_enum_model_json).__dict__ - instance_profile_vcpu_enum_model2 = InstanceProfileVCPUEnum( - **instance_profile_vcpu_enum_model_dict) + instance_profile_vcpu_enum_model_dict = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json).__dict__ + instance_profile_vcpu_enum_model2 = InstanceProfileVCPUEnum(**instance_profile_vcpu_enum_model_dict) # Verify the model instances are equivalent assert instance_profile_vcpu_enum_model == instance_profile_vcpu_enum_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_vcpu_enum_model_json2 = instance_profile_vcpu_enum_model.to_dict( - ) + instance_profile_vcpu_enum_model_json2 = instance_profile_vcpu_enum_model.to_dict() assert instance_profile_vcpu_enum_model_json2 == instance_profile_vcpu_enum_model_json - class TestInstanceProfileVCPUFixed(): """ Test Class for InstanceProfileVCPUFixed @@ -40905,25 +39804,20 @@ def test_instance_profile_vcpu_fixed_serialization(self): instance_profile_vcpu_fixed_model_json['value'] = 16 # Construct a model instance of InstanceProfileVCPUFixed by calling from_dict on the json representation - instance_profile_vcpu_fixed_model = InstanceProfileVCPUFixed.from_dict( - instance_profile_vcpu_fixed_model_json) + instance_profile_vcpu_fixed_model = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json) assert instance_profile_vcpu_fixed_model != False # Construct a model instance of InstanceProfileVCPUFixed by calling from_dict on the json representation - instance_profile_vcpu_fixed_model_dict = InstanceProfileVCPUFixed.from_dict( - instance_profile_vcpu_fixed_model_json).__dict__ - instance_profile_vcpu_fixed_model2 = InstanceProfileVCPUFixed( - **instance_profile_vcpu_fixed_model_dict) + instance_profile_vcpu_fixed_model_dict = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json).__dict__ + instance_profile_vcpu_fixed_model2 = InstanceProfileVCPUFixed(**instance_profile_vcpu_fixed_model_dict) # Verify the model instances are equivalent assert instance_profile_vcpu_fixed_model == instance_profile_vcpu_fixed_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_vcpu_fixed_model_json2 = instance_profile_vcpu_fixed_model.to_dict( - ) + instance_profile_vcpu_fixed_model_json2 = instance_profile_vcpu_fixed_model.to_dict() assert instance_profile_vcpu_fixed_model_json2 == instance_profile_vcpu_fixed_model_json - class TestInstanceProfileVCPURange(): """ Test Class for InstanceProfileVCPURange @@ -40943,25 +39837,20 @@ def test_instance_profile_vcpu_range_serialization(self): instance_profile_vcpu_range_model_json['type'] = 'range' # Construct a model instance of InstanceProfileVCPURange by calling from_dict on the json representation - instance_profile_vcpu_range_model = InstanceProfileVCPURange.from_dict( - instance_profile_vcpu_range_model_json) + instance_profile_vcpu_range_model = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json) assert instance_profile_vcpu_range_model != False # Construct a model instance of InstanceProfileVCPURange by calling from_dict on the json representation - instance_profile_vcpu_range_model_dict = InstanceProfileVCPURange.from_dict( - instance_profile_vcpu_range_model_json).__dict__ - instance_profile_vcpu_range_model2 = InstanceProfileVCPURange( - **instance_profile_vcpu_range_model_dict) + instance_profile_vcpu_range_model_dict = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json).__dict__ + instance_profile_vcpu_range_model2 = InstanceProfileVCPURange(**instance_profile_vcpu_range_model_dict) # Verify the model instances are equivalent assert instance_profile_vcpu_range_model == instance_profile_vcpu_range_model2 # Convert model instance back to dict and verify no loss of data - instance_profile_vcpu_range_model_json2 = instance_profile_vcpu_range_model.to_dict( - ) + instance_profile_vcpu_range_model_json2 = instance_profile_vcpu_range_model.to_dict() assert instance_profile_vcpu_range_model_json2 == instance_profile_vcpu_range_model_json - class TestInstancePrototypeInstanceByImage(): """ Test Class for InstancePrototypeInstanceByImage @@ -40974,129 +39863,97 @@ def test_instance_prototype_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstancePrototypeInstanceByImage model instance_prototype_instance_by_image_model_json = {} - instance_prototype_instance_by_image_model_json['keys'] = [ - key_identity_model - ] + instance_prototype_instance_by_image_model_json['keys'] = [key_identity_model] instance_prototype_instance_by_image_model_json['name'] = 'my-instance' - instance_prototype_instance_by_image_model_json[ - 'network_interfaces'] = [network_interface_prototype_model] - instance_prototype_instance_by_image_model_json[ - 'profile'] = instance_profile_identity_model - instance_prototype_instance_by_image_model_json[ - 'resource_group'] = resource_group_identity_model - instance_prototype_instance_by_image_model_json[ - 'user_data'] = 'testString' - instance_prototype_instance_by_image_model_json[ - 'volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_prototype_instance_by_image_model_json[ - 'vpc'] = vpc_identity_model - instance_prototype_instance_by_image_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_prototype_instance_by_image_model_json[ - 'image'] = image_identity_model - instance_prototype_instance_by_image_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_prototype_instance_by_image_model_json[ - 'zone'] = zone_identity_model + instance_prototype_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model + instance_prototype_instance_by_image_model_json['profile'] = instance_profile_identity_model + instance_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model + instance_prototype_instance_by_image_model_json['user_data'] = 'testString' + instance_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model + instance_prototype_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_instance_by_image_model_json['image'] = image_identity_model + instance_prototype_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model + instance_prototype_instance_by_image_model_json['zone'] = zone_identity_model # Construct a model instance of InstancePrototypeInstanceByImage by calling from_dict on the json representation - instance_prototype_instance_by_image_model = InstancePrototypeInstanceByImage.from_dict( - instance_prototype_instance_by_image_model_json) + instance_prototype_instance_by_image_model = InstancePrototypeInstanceByImage.from_dict(instance_prototype_instance_by_image_model_json) assert instance_prototype_instance_by_image_model != False # Construct a model instance of InstancePrototypeInstanceByImage by calling from_dict on the json representation - instance_prototype_instance_by_image_model_dict = InstancePrototypeInstanceByImage.from_dict( - instance_prototype_instance_by_image_model_json).__dict__ - instance_prototype_instance_by_image_model2 = InstancePrototypeInstanceByImage( - **instance_prototype_instance_by_image_model_dict) + instance_prototype_instance_by_image_model_dict = InstancePrototypeInstanceByImage.from_dict(instance_prototype_instance_by_image_model_json).__dict__ + instance_prototype_instance_by_image_model2 = InstancePrototypeInstanceByImage(**instance_prototype_instance_by_image_model_dict) # Verify the model instances are equivalent assert instance_prototype_instance_by_image_model == instance_prototype_instance_by_image_model2 # Convert model instance back to dict and verify no loss of data - instance_prototype_instance_by_image_model_json2 = instance_prototype_instance_by_image_model.to_dict( - ) + instance_prototype_instance_by_image_model_json2 = instance_prototype_instance_by_image_model.to_dict() assert instance_prototype_instance_by_image_model_json2 == instance_prototype_instance_by_image_model_json - class TestInstancePrototypeInstanceBySourceTemplate(): """ Test Class for InstancePrototypeInstanceBySourceTemplate @@ -41109,136 +39966,101 @@ def test_instance_prototype_instance_by_source_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - instance_template_identity_model = {} # InstanceTemplateIdentityById - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model = {} # InstanceTemplateIdentityById + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstancePrototypeInstanceBySourceTemplate model instance_prototype_instance_by_source_template_model_json = {} - instance_prototype_instance_by_source_template_model_json['keys'] = [ - key_identity_model - ] - instance_prototype_instance_by_source_template_model_json[ - 'name'] = 'my-instance' - instance_prototype_instance_by_source_template_model_json[ - 'network_interfaces'] = [network_interface_prototype_model] - instance_prototype_instance_by_source_template_model_json[ - 'profile'] = instance_profile_identity_model - instance_prototype_instance_by_source_template_model_json[ - 'resource_group'] = resource_group_identity_model - instance_prototype_instance_by_source_template_model_json[ - 'user_data'] = 'testString' - instance_prototype_instance_by_source_template_model_json[ - 'volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_prototype_instance_by_source_template_model_json[ - 'vpc'] = vpc_identity_model - instance_prototype_instance_by_source_template_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_prototype_instance_by_source_template_model_json[ - 'image'] = image_identity_model - instance_prototype_instance_by_source_template_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_prototype_instance_by_source_template_model_json[ - 'source_template'] = instance_template_identity_model - instance_prototype_instance_by_source_template_model_json[ - 'zone'] = zone_identity_model + instance_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model] + instance_prototype_instance_by_source_template_model_json['name'] = 'my-instance' + instance_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model + instance_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model + instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model + instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString' + instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model + instance_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_instance_by_source_template_model_json['image'] = image_identity_model + instance_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model + instance_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model + instance_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict( - instance_prototype_instance_by_source_template_model_json) + instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json) assert instance_prototype_instance_by_source_template_model != False # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict( - instance_prototype_instance_by_source_template_model_json).__dict__ - instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate( - **instance_prototype_instance_by_source_template_model_dict) + instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json).__dict__ + instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate(**instance_prototype_instance_by_source_template_model_dict) # Verify the model instances are equivalent assert instance_prototype_instance_by_source_template_model == instance_prototype_instance_by_source_template_model2 # Convert model instance back to dict and verify no loss of data - instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict( - ) + instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict() assert instance_prototype_instance_by_source_template_model_json2 == instance_prototype_instance_by_source_template_model_json - class TestInstanceTemplateIdentityByCRN(): """ Test Class for InstanceTemplateIdentityByCRN @@ -41251,29 +40073,23 @@ def test_instance_template_identity_by_crn_serialization(self): # Construct a json representation of a InstanceTemplateIdentityByCRN model instance_template_identity_by_crn_model_json = {} - instance_template_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation - instance_template_identity_by_crn_model = InstanceTemplateIdentityByCRN.from_dict( - instance_template_identity_by_crn_model_json) + instance_template_identity_by_crn_model = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json) assert instance_template_identity_by_crn_model != False # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation - instance_template_identity_by_crn_model_dict = InstanceTemplateIdentityByCRN.from_dict( - instance_template_identity_by_crn_model_json).__dict__ - instance_template_identity_by_crn_model2 = InstanceTemplateIdentityByCRN( - **instance_template_identity_by_crn_model_dict) + instance_template_identity_by_crn_model_dict = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json).__dict__ + instance_template_identity_by_crn_model2 = InstanceTemplateIdentityByCRN(**instance_template_identity_by_crn_model_dict) # Verify the model instances are equivalent assert instance_template_identity_by_crn_model == instance_template_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - instance_template_identity_by_crn_model_json2 = instance_template_identity_by_crn_model.to_dict( - ) + instance_template_identity_by_crn_model_json2 = instance_template_identity_by_crn_model.to_dict() assert instance_template_identity_by_crn_model_json2 == instance_template_identity_by_crn_model_json - class TestInstanceTemplateIdentityByHref(): """ Test Class for InstanceTemplateIdentityByHref @@ -41286,29 +40102,23 @@ def test_instance_template_identity_by_href_serialization(self): # Construct a json representation of a InstanceTemplateIdentityByHref model instance_template_identity_by_href_model_json = {} - instance_template_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation - instance_template_identity_by_href_model = InstanceTemplateIdentityByHref.from_dict( - instance_template_identity_by_href_model_json) + instance_template_identity_by_href_model = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json) assert instance_template_identity_by_href_model != False # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation - instance_template_identity_by_href_model_dict = InstanceTemplateIdentityByHref.from_dict( - instance_template_identity_by_href_model_json).__dict__ - instance_template_identity_by_href_model2 = InstanceTemplateIdentityByHref( - **instance_template_identity_by_href_model_dict) + instance_template_identity_by_href_model_dict = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json).__dict__ + instance_template_identity_by_href_model2 = InstanceTemplateIdentityByHref(**instance_template_identity_by_href_model_dict) # Verify the model instances are equivalent assert instance_template_identity_by_href_model == instance_template_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - instance_template_identity_by_href_model_json2 = instance_template_identity_by_href_model.to_dict( - ) + instance_template_identity_by_href_model_json2 = instance_template_identity_by_href_model.to_dict() assert instance_template_identity_by_href_model_json2 == instance_template_identity_by_href_model_json - class TestInstanceTemplateIdentityById(): """ Test Class for InstanceTemplateIdentityById @@ -41321,29 +40131,23 @@ def test_instance_template_identity_by_id_serialization(self): # Construct a json representation of a InstanceTemplateIdentityById model instance_template_identity_by_id_model_json = {} - instance_template_identity_by_id_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a model instance of InstanceTemplateIdentityById by calling from_dict on the json representation - instance_template_identity_by_id_model = InstanceTemplateIdentityById.from_dict( - instance_template_identity_by_id_model_json) + instance_template_identity_by_id_model = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json) assert instance_template_identity_by_id_model != False # Construct a model instance of InstanceTemplateIdentityById by calling from_dict on the json representation - instance_template_identity_by_id_model_dict = InstanceTemplateIdentityById.from_dict( - instance_template_identity_by_id_model_json).__dict__ - instance_template_identity_by_id_model2 = InstanceTemplateIdentityById( - **instance_template_identity_by_id_model_dict) + instance_template_identity_by_id_model_dict = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json).__dict__ + instance_template_identity_by_id_model2 = InstanceTemplateIdentityById(**instance_template_identity_by_id_model_dict) # Verify the model instances are equivalent assert instance_template_identity_by_id_model == instance_template_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - instance_template_identity_by_id_model_json2 = instance_template_identity_by_id_model.to_dict( - ) + instance_template_identity_by_id_model_json2 = instance_template_identity_by_id_model.to_dict() assert instance_template_identity_by_id_model_json2 == instance_template_identity_by_id_model_json - class TestInstanceTemplatePrototypeInstanceByImage(): """ Test Class for InstanceTemplatePrototypeInstanceByImage @@ -41356,274 +40160,204 @@ def test_instance_template_prototype_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstanceTemplatePrototypeInstanceByImage model instance_template_prototype_instance_by_image_model_json = {} - instance_template_prototype_instance_by_image_model_json['keys'] = [ - key_identity_model - ] - instance_template_prototype_instance_by_image_model_json[ - 'name'] = 'my-instance' - instance_template_prototype_instance_by_image_model_json[ - 'network_interfaces'] = [network_interface_prototype_model] - instance_template_prototype_instance_by_image_model_json[ - 'profile'] = instance_profile_identity_model - instance_template_prototype_instance_by_image_model_json[ - 'resource_group'] = resource_group_identity_model - instance_template_prototype_instance_by_image_model_json[ - 'user_data'] = 'testString' - instance_template_prototype_instance_by_image_model_json[ - 'volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_template_prototype_instance_by_image_model_json[ - 'vpc'] = vpc_identity_model - instance_template_prototype_instance_by_image_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_prototype_instance_by_image_model_json[ - 'image'] = image_identity_model - instance_template_prototype_instance_by_image_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_template_prototype_instance_by_image_model_json[ - 'zone'] = zone_identity_model + instance_template_prototype_instance_by_image_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_image_model_json['name'] = 'my-instance' + instance_template_prototype_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_instance_by_image_model_json['profile'] = instance_profile_identity_model + instance_template_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_image_model_json['user_data'] = 'testString' + instance_template_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model + instance_template_prototype_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_instance_by_image_model_json['image'] = image_identity_model + instance_template_prototype_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_instance_by_image_model_json['zone'] = zone_identity_model # Construct a model instance of InstanceTemplatePrototypeInstanceByImage by calling from_dict on the json representation - instance_template_prototype_instance_by_image_model = InstanceTemplatePrototypeInstanceByImage.from_dict( - instance_template_prototype_instance_by_image_model_json) + instance_template_prototype_instance_by_image_model = InstanceTemplatePrototypeInstanceByImage.from_dict(instance_template_prototype_instance_by_image_model_json) assert instance_template_prototype_instance_by_image_model != False # Construct a model instance of InstanceTemplatePrototypeInstanceByImage by calling from_dict on the json representation - instance_template_prototype_instance_by_image_model_dict = InstanceTemplatePrototypeInstanceByImage.from_dict( - instance_template_prototype_instance_by_image_model_json).__dict__ - instance_template_prototype_instance_by_image_model2 = InstanceTemplatePrototypeInstanceByImage( - **instance_template_prototype_instance_by_image_model_dict) + instance_template_prototype_instance_by_image_model_dict = InstanceTemplatePrototypeInstanceByImage.from_dict(instance_template_prototype_instance_by_image_model_json).__dict__ + instance_template_prototype_instance_by_image_model2 = InstanceTemplatePrototypeInstanceByImage(**instance_template_prototype_instance_by_image_model_dict) # Verify the model instances are equivalent assert instance_template_prototype_instance_by_image_model == instance_template_prototype_instance_by_image_model2 # Convert model instance back to dict and verify no loss of data - instance_template_prototype_instance_by_image_model_json2 = instance_template_prototype_instance_by_image_model.to_dict( - ) + instance_template_prototype_instance_by_image_model_json2 = instance_template_prototype_instance_by_image_model.to_dict() assert instance_template_prototype_instance_by_image_model_json2 == instance_template_prototype_instance_by_image_model_json - class TestInstanceTemplatePrototypeInstanceBySourceTemplate(): """ Test Class for InstanceTemplatePrototypeInstanceBySourceTemplate """ - def test_instance_template_prototype_instance_by_source_template_serialization( - self): + def test_instance_template_prototype_instance_by_source_template_serialization(self): """ Test serialization/deserialization for InstanceTemplatePrototypeInstanceBySourceTemplate """ # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - instance_template_identity_model = {} # InstanceTemplateIdentityById - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model = {} # InstanceTemplateIdentityById + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstanceTemplatePrototypeInstanceBySourceTemplate model instance_template_prototype_instance_by_source_template_model_json = {} - instance_template_prototype_instance_by_source_template_model_json[ - 'keys'] = [key_identity_model] - instance_template_prototype_instance_by_source_template_model_json[ - 'name'] = 'my-instance' - instance_template_prototype_instance_by_source_template_model_json[ - 'network_interfaces'] = [network_interface_prototype_model] - instance_template_prototype_instance_by_source_template_model_json[ - 'profile'] = instance_profile_identity_model - instance_template_prototype_instance_by_source_template_model_json[ - 'resource_group'] = resource_group_identity_model - instance_template_prototype_instance_by_source_template_model_json[ - 'user_data'] = 'testString' - instance_template_prototype_instance_by_source_template_model_json[ - 'volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_template_prototype_instance_by_source_template_model_json[ - 'vpc'] = vpc_identity_model - instance_template_prototype_instance_by_source_template_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_prototype_instance_by_source_template_model_json[ - 'image'] = image_identity_model - instance_template_prototype_instance_by_source_template_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_template_prototype_instance_by_source_template_model_json[ - 'source_template'] = instance_template_identity_model - instance_template_prototype_instance_by_source_template_model_json[ - 'zone'] = zone_identity_model + instance_template_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_source_template_model_json['name'] = 'my-instance' + instance_template_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model + instance_template_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_source_template_model_json['user_data'] = 'testString' + instance_template_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model + instance_template_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_instance_by_source_template_model_json['image'] = image_identity_model + instance_template_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model + instance_template_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model # Construct a model instance of InstanceTemplatePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_prototype_instance_by_source_template_model = InstanceTemplatePrototypeInstanceBySourceTemplate.from_dict( - instance_template_prototype_instance_by_source_template_model_json) + instance_template_prototype_instance_by_source_template_model = InstanceTemplatePrototypeInstanceBySourceTemplate.from_dict(instance_template_prototype_instance_by_source_template_model_json) assert instance_template_prototype_instance_by_source_template_model != False # Construct a model instance of InstanceTemplatePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_prototype_instance_by_source_template_model_dict = InstanceTemplatePrototypeInstanceBySourceTemplate.from_dict( - instance_template_prototype_instance_by_source_template_model_json - ).__dict__ - instance_template_prototype_instance_by_source_template_model2 = InstanceTemplatePrototypeInstanceBySourceTemplate( - ** - instance_template_prototype_instance_by_source_template_model_dict) + instance_template_prototype_instance_by_source_template_model_dict = InstanceTemplatePrototypeInstanceBySourceTemplate.from_dict(instance_template_prototype_instance_by_source_template_model_json).__dict__ + instance_template_prototype_instance_by_source_template_model2 = InstanceTemplatePrototypeInstanceBySourceTemplate(**instance_template_prototype_instance_by_source_template_model_dict) # Verify the model instances are equivalent assert instance_template_prototype_instance_by_source_template_model == instance_template_prototype_instance_by_source_template_model2 # Convert model instance back to dict and verify no loss of data - instance_template_prototype_instance_by_source_template_model_json2 = instance_template_prototype_instance_by_source_template_model.to_dict( - ) + instance_template_prototype_instance_by_source_template_model_json2 = instance_template_prototype_instance_by_source_template_model.to_dict() assert instance_template_prototype_instance_by_source_template_model_json2 == instance_template_prototype_instance_by_source_template_model_json - class TestInstanceTemplateInstanceByImage(): """ Test Class for InstanceTemplateInstanceByImage @@ -41636,142 +40370,103 @@ def test_instance_template_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstanceTemplateInstanceByImage model instance_template_instance_by_image_model_json = {} - instance_template_instance_by_image_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - instance_template_instance_by_image_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_image_model_json['keys'] = [ - key_identity_model - ] - instance_template_instance_by_image_model_json[ - 'name'] = 'my-instance-template' - instance_template_instance_by_image_model_json['network_interfaces'] = [ - network_interface_prototype_model - ] - instance_template_instance_by_image_model_json[ - 'profile'] = instance_profile_identity_model - instance_template_instance_by_image_model_json[ - 'resource_group'] = resource_group_reference_model - instance_template_instance_by_image_model_json[ - 'user_data'] = 'testString' - instance_template_instance_by_image_model_json['volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_template_instance_by_image_model_json[ - 'vpc'] = vpc_identity_model - instance_template_instance_by_image_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_image_model_json[ - 'image'] = image_identity_model - instance_template_instance_by_image_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_image_model_json[ - 'zone'] = zone_identity_model + instance_template_instance_by_image_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_template_instance_by_image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_image_model_json['keys'] = [key_identity_model] + instance_template_instance_by_image_model_json['name'] = 'my-instance-template' + instance_template_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_image_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_image_model_json['user_data'] = 'testString' + instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_image_model_json['image'] = image_identity_model + instance_template_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_image_model_json['zone'] = zone_identity_model # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model = InstanceTemplateInstanceByImage.from_dict( - instance_template_instance_by_image_model_json) + instance_template_instance_by_image_model = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json) assert instance_template_instance_by_image_model != False # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model_dict = InstanceTemplateInstanceByImage.from_dict( - instance_template_instance_by_image_model_json).__dict__ - instance_template_instance_by_image_model2 = InstanceTemplateInstanceByImage( - **instance_template_instance_by_image_model_dict) + instance_template_instance_by_image_model_dict = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json).__dict__ + instance_template_instance_by_image_model2 = InstanceTemplateInstanceByImage(**instance_template_instance_by_image_model_dict) # Verify the model instances are equivalent assert instance_template_instance_by_image_model == instance_template_instance_by_image_model2 # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict( - ) + instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict() assert instance_template_instance_by_image_model_json2 == instance_template_instance_by_image_model_json - class TestInstanceTemplateInstanceBySourceTemplate(): """ Test Class for InstanceTemplateInstanceBySourceTemplate @@ -41784,148 +40479,107 @@ def test_instance_template_instance_by_source_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - network_interface_prototype_model = {} # NetworkInterfacePrototype + network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [ - security_group_identity_model - ] + network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model - instance_profile_identity_model = {} # InstanceProfileIdentityByName + instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + instance_profile_identity_model = {} # InstanceProfileIdentityByName instance_profile_identity_model['name'] = 'cc1-16x32' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - volume_attachment_volume_prototype_instance_context_model = { - } # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = { - } # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model[ - 'volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById + volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById + volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext + volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model + + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = { - } # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext volume_prototype_instance_by_image_context_model['capacity'] = 100 - volume_prototype_instance_by_image_context_model[ - 'encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model[ - 'profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = { - } # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model[ - 'delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model[ - 'name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model[ - 'volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - instance_template_identity_model = {} # InstanceTemplateIdentityById - instance_template_identity_model[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_identity_model = {} # InstanceTemplateIdentityById + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a InstanceTemplateInstanceBySourceTemplate model instance_template_instance_by_source_template_model_json = {} - instance_template_instance_by_source_template_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - instance_template_instance_by_source_template_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_source_template_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_source_template_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_source_template_model_json['keys'] = [ - key_identity_model - ] - instance_template_instance_by_source_template_model_json[ - 'name'] = 'my-instance-template' - instance_template_instance_by_source_template_model_json[ - 'network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_source_template_model_json[ - 'profile'] = instance_profile_identity_model - instance_template_instance_by_source_template_model_json[ - 'resource_group'] = resource_group_reference_model - instance_template_instance_by_source_template_model_json[ - 'user_data'] = 'testString' - instance_template_instance_by_source_template_model_json[ - 'volume_attachments'] = [ - volume_attachment_prototype_instance_context_model - ] - instance_template_instance_by_source_template_model_json[ - 'vpc'] = vpc_identity_model - instance_template_instance_by_source_template_model_json[ - 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_source_template_model_json[ - 'image'] = image_identity_model - instance_template_instance_by_source_template_model_json[ - 'primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_source_template_model_json[ - 'source_template'] = instance_template_identity_model - instance_template_instance_by_source_template_model_json[ - 'zone'] = zone_identity_model + instance_template_instance_by_source_template_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_template_instance_by_source_template_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_source_template_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_source_template_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_source_template_model_json['keys'] = [key_identity_model] + instance_template_instance_by_source_template_model_json['name'] = 'my-instance-template' + instance_template_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_source_template_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_source_template_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_source_template_model_json['user_data'] = 'testString' + instance_template_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_source_template_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_source_template_model_json['image'] = image_identity_model + instance_template_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_source_template_model_json['source_template'] = instance_template_identity_model + instance_template_instance_by_source_template_model_json['zone'] = zone_identity_model # Construct a model instance of InstanceTemplateInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_instance_by_source_template_model = InstanceTemplateInstanceBySourceTemplate.from_dict( - instance_template_instance_by_source_template_model_json) + instance_template_instance_by_source_template_model = InstanceTemplateInstanceBySourceTemplate.from_dict(instance_template_instance_by_source_template_model_json) assert instance_template_instance_by_source_template_model != False # Construct a model instance of InstanceTemplateInstanceBySourceTemplate by calling from_dict on the json representation - instance_template_instance_by_source_template_model_dict = InstanceTemplateInstanceBySourceTemplate.from_dict( - instance_template_instance_by_source_template_model_json).__dict__ - instance_template_instance_by_source_template_model2 = InstanceTemplateInstanceBySourceTemplate( - **instance_template_instance_by_source_template_model_dict) + instance_template_instance_by_source_template_model_dict = InstanceTemplateInstanceBySourceTemplate.from_dict(instance_template_instance_by_source_template_model_json).__dict__ + instance_template_instance_by_source_template_model2 = InstanceTemplateInstanceBySourceTemplate(**instance_template_instance_by_source_template_model_dict) # Verify the model instances are equivalent assert instance_template_instance_by_source_template_model == instance_template_instance_by_source_template_model2 # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_source_template_model_json2 = instance_template_instance_by_source_template_model.to_dict( - ) + instance_template_instance_by_source_template_model_json2 = instance_template_instance_by_source_template_model.to_dict() assert instance_template_instance_by_source_template_model_json2 == instance_template_instance_by_source_template_model_json - class TestKeyIdentityByCRN(): """ Test Class for KeyIdentityByCRN @@ -41938,19 +40592,15 @@ def test_key_identity_by_crn_serialization(self): # Construct a json representation of a KeyIdentityByCRN model key_identity_by_crn_model_json = {} - key_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation - key_identity_by_crn_model = KeyIdentityByCRN.from_dict( - key_identity_by_crn_model_json) + key_identity_by_crn_model = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json) assert key_identity_by_crn_model != False # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation - key_identity_by_crn_model_dict = KeyIdentityByCRN.from_dict( - key_identity_by_crn_model_json).__dict__ - key_identity_by_crn_model2 = KeyIdentityByCRN( - **key_identity_by_crn_model_dict) + key_identity_by_crn_model_dict = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json).__dict__ + key_identity_by_crn_model2 = KeyIdentityByCRN(**key_identity_by_crn_model_dict) # Verify the model instances are equivalent assert key_identity_by_crn_model == key_identity_by_crn_model2 @@ -41959,7 +40609,6 @@ def test_key_identity_by_crn_serialization(self): key_identity_by_crn_model_json2 = key_identity_by_crn_model.to_dict() assert key_identity_by_crn_model_json2 == key_identity_by_crn_model_json - class TestKeyIdentityByHref(): """ Test Class for KeyIdentityByHref @@ -41972,19 +40621,15 @@ def test_key_identity_by_href_serialization(self): # Construct a json representation of a KeyIdentityByHref model key_identity_by_href_model_json = {} - key_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation - key_identity_by_href_model = KeyIdentityByHref.from_dict( - key_identity_by_href_model_json) + key_identity_by_href_model = KeyIdentityByHref.from_dict(key_identity_by_href_model_json) assert key_identity_by_href_model != False # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation - key_identity_by_href_model_dict = KeyIdentityByHref.from_dict( - key_identity_by_href_model_json).__dict__ - key_identity_by_href_model2 = KeyIdentityByHref( - **key_identity_by_href_model_dict) + key_identity_by_href_model_dict = KeyIdentityByHref.from_dict(key_identity_by_href_model_json).__dict__ + key_identity_by_href_model2 = KeyIdentityByHref(**key_identity_by_href_model_dict) # Verify the model instances are equivalent assert key_identity_by_href_model == key_identity_by_href_model2 @@ -41993,7 +40638,6 @@ def test_key_identity_by_href_serialization(self): key_identity_by_href_model_json2 = key_identity_by_href_model.to_dict() assert key_identity_by_href_model_json2 == key_identity_by_href_model_json - class TestKeyIdentityById(): """ Test Class for KeyIdentityById @@ -42006,19 +40650,15 @@ def test_key_identity_by_id_serialization(self): # Construct a json representation of a KeyIdentityById model key_identity_by_id_model_json = {} - key_identity_by_id_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' # Construct a model instance of KeyIdentityById by calling from_dict on the json representation - key_identity_by_id_model = KeyIdentityById.from_dict( - key_identity_by_id_model_json) + key_identity_by_id_model = KeyIdentityById.from_dict(key_identity_by_id_model_json) assert key_identity_by_id_model != False # Construct a model instance of KeyIdentityById by calling from_dict on the json representation - key_identity_by_id_model_dict = KeyIdentityById.from_dict( - key_identity_by_id_model_json).__dict__ - key_identity_by_id_model2 = KeyIdentityById( - **key_identity_by_id_model_dict) + key_identity_by_id_model_dict = KeyIdentityById.from_dict(key_identity_by_id_model_json).__dict__ + key_identity_by_id_model2 = KeyIdentityById(**key_identity_by_id_model_dict) # Verify the model instances are equivalent assert key_identity_by_id_model == key_identity_by_id_model2 @@ -42027,7 +40667,6 @@ def test_key_identity_by_id_serialization(self): key_identity_by_id_model_json2 = key_identity_by_id_model.to_dict() assert key_identity_by_id_model_json2 == key_identity_by_id_model_json - class TestKeyIdentityKeyIdentityByFingerprint(): """ Test Class for KeyIdentityKeyIdentityByFingerprint @@ -42040,125 +40679,91 @@ def test_key_identity_key_identity_by_fingerprint_serialization(self): # Construct a json representation of a KeyIdentityKeyIdentityByFingerprint model key_identity_key_identity_by_fingerprint_model_json = {} - key_identity_key_identity_by_fingerprint_model_json[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_identity_key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' # Construct a model instance of KeyIdentityKeyIdentityByFingerprint by calling from_dict on the json representation - key_identity_key_identity_by_fingerprint_model = KeyIdentityKeyIdentityByFingerprint.from_dict( - key_identity_key_identity_by_fingerprint_model_json) + key_identity_key_identity_by_fingerprint_model = KeyIdentityKeyIdentityByFingerprint.from_dict(key_identity_key_identity_by_fingerprint_model_json) assert key_identity_key_identity_by_fingerprint_model != False # Construct a model instance of KeyIdentityKeyIdentityByFingerprint by calling from_dict on the json representation - key_identity_key_identity_by_fingerprint_model_dict = KeyIdentityKeyIdentityByFingerprint.from_dict( - key_identity_key_identity_by_fingerprint_model_json).__dict__ - key_identity_key_identity_by_fingerprint_model2 = KeyIdentityKeyIdentityByFingerprint( - **key_identity_key_identity_by_fingerprint_model_dict) + key_identity_key_identity_by_fingerprint_model_dict = KeyIdentityKeyIdentityByFingerprint.from_dict(key_identity_key_identity_by_fingerprint_model_json).__dict__ + key_identity_key_identity_by_fingerprint_model2 = KeyIdentityKeyIdentityByFingerprint(**key_identity_key_identity_by_fingerprint_model_dict) # Verify the model instances are equivalent assert key_identity_key_identity_by_fingerprint_model == key_identity_key_identity_by_fingerprint_model2 # Convert model instance back to dict and verify no loss of data - key_identity_key_identity_by_fingerprint_model_json2 = key_identity_key_identity_by_fingerprint_model.to_dict( - ) + key_identity_key_identity_by_fingerprint_model_json2 = key_identity_key_identity_by_fingerprint_model.to_dict() assert key_identity_key_identity_by_fingerprint_model_json2 == key_identity_key_identity_by_fingerprint_model_json - class TestKeyReferenceInstanceInitializationContextKeyIdentityByFingerprint(): """ Test Class for KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint """ - def test_key_reference_instance_initialization_context_key_identity_by_fingerprint_serialization( - self): + def test_key_reference_instance_initialization_context_key_identity_by_fingerprint_serialization(self): """ Test serialization/deserialization for KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint """ # Construct a json representation of a KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint model key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json = {} - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' # Construct a model instance of KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint by calling from_dict on the json representation - key_reference_instance_initialization_context_key_identity_by_fingerprint_model = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict( - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json - ) + key_reference_instance_initialization_context_key_identity_by_fingerprint_model = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict(key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json) assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model != False # Construct a model instance of KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint by calling from_dict on the json representation - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict( - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json - ).__dict__ - key_reference_instance_initialization_context_key_identity_by_fingerprint_model2 = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint( - ** - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict - ) + key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint.from_dict(key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json).__dict__ + key_reference_instance_initialization_context_key_identity_by_fingerprint_model2 = KeyReferenceInstanceInitializationContextKeyIdentityByFingerprint(**key_reference_instance_initialization_context_key_identity_by_fingerprint_model_dict) # Verify the model instances are equivalent assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model == key_reference_instance_initialization_context_key_identity_by_fingerprint_model2 # Convert model instance back to dict and verify no loss of data - key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json2 = key_reference_instance_initialization_context_key_identity_by_fingerprint_model.to_dict( - ) + key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json2 = key_reference_instance_initialization_context_key_identity_by_fingerprint_model.to_dict() assert key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json2 == key_reference_instance_initialization_context_key_identity_by_fingerprint_model_json - class TestKeyReferenceInstanceInitializationContextKeyReference(): """ Test Class for KeyReferenceInstanceInitializationContextKeyReference """ - def test_key_reference_instance_initialization_context_key_reference_serialization( - self): + def test_key_reference_instance_initialization_context_key_reference_serialization(self): """ Test serialization/deserialization for KeyReferenceInstanceInitializationContextKeyReference """ # Construct dict forms of any model objects needed in order to build this model. - key_reference_deleted_model = {} # KeyReferenceDeleted - key_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + key_reference_deleted_model = {} # KeyReferenceDeleted + key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a KeyReferenceInstanceInitializationContextKeyReference model key_reference_instance_initialization_context_key_reference_model_json = {} - key_reference_instance_initialization_context_key_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json[ - 'deleted'] = key_reference_deleted_model - key_reference_instance_initialization_context_key_reference_model_json[ - 'fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_instance_initialization_context_key_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json[ - 'id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - key_reference_instance_initialization_context_key_reference_model_json[ - 'name'] = 'my-key' + key_reference_instance_initialization_context_key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_key_reference_model_json['deleted'] = key_reference_deleted_model + key_reference_instance_initialization_context_key_reference_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' + key_reference_instance_initialization_context_key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_key_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + key_reference_instance_initialization_context_key_reference_model_json['name'] = 'my-key' # Construct a model instance of KeyReferenceInstanceInitializationContextKeyReference by calling from_dict on the json representation - key_reference_instance_initialization_context_key_reference_model = KeyReferenceInstanceInitializationContextKeyReference.from_dict( - key_reference_instance_initialization_context_key_reference_model_json - ) + key_reference_instance_initialization_context_key_reference_model = KeyReferenceInstanceInitializationContextKeyReference.from_dict(key_reference_instance_initialization_context_key_reference_model_json) assert key_reference_instance_initialization_context_key_reference_model != False # Construct a model instance of KeyReferenceInstanceInitializationContextKeyReference by calling from_dict on the json representation - key_reference_instance_initialization_context_key_reference_model_dict = KeyReferenceInstanceInitializationContextKeyReference.from_dict( - key_reference_instance_initialization_context_key_reference_model_json - ).__dict__ - key_reference_instance_initialization_context_key_reference_model2 = KeyReferenceInstanceInitializationContextKeyReference( - ** - key_reference_instance_initialization_context_key_reference_model_dict - ) + key_reference_instance_initialization_context_key_reference_model_dict = KeyReferenceInstanceInitializationContextKeyReference.from_dict(key_reference_instance_initialization_context_key_reference_model_json).__dict__ + key_reference_instance_initialization_context_key_reference_model2 = KeyReferenceInstanceInitializationContextKeyReference(**key_reference_instance_initialization_context_key_reference_model_dict) # Verify the model instances are equivalent assert key_reference_instance_initialization_context_key_reference_model == key_reference_instance_initialization_context_key_reference_model2 # Convert model instance back to dict and verify no loss of data - key_reference_instance_initialization_context_key_reference_model_json2 = key_reference_instance_initialization_context_key_reference_model.to_dict( - ) + key_reference_instance_initialization_context_key_reference_model_json2 = key_reference_instance_initialization_context_key_reference_model.to_dict() assert key_reference_instance_initialization_context_key_reference_model_json2 == key_reference_instance_initialization_context_key_reference_model_json - class TestLoadBalancerIdentityByCRN(): """ Test Class for LoadBalancerIdentityByCRN @@ -42171,29 +40776,23 @@ def test_load_balancer_identity_by_crn_serialization(self): # Construct a json representation of a LoadBalancerIdentityByCRN model load_balancer_identity_by_crn_model_json = {} - load_balancer_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a model instance of LoadBalancerIdentityByCRN by calling from_dict on the json representation - load_balancer_identity_by_crn_model = LoadBalancerIdentityByCRN.from_dict( - load_balancer_identity_by_crn_model_json) + load_balancer_identity_by_crn_model = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json) assert load_balancer_identity_by_crn_model != False # Construct a model instance of LoadBalancerIdentityByCRN by calling from_dict on the json representation - load_balancer_identity_by_crn_model_dict = LoadBalancerIdentityByCRN.from_dict( - load_balancer_identity_by_crn_model_json).__dict__ - load_balancer_identity_by_crn_model2 = LoadBalancerIdentityByCRN( - **load_balancer_identity_by_crn_model_dict) + load_balancer_identity_by_crn_model_dict = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json).__dict__ + load_balancer_identity_by_crn_model2 = LoadBalancerIdentityByCRN(**load_balancer_identity_by_crn_model_dict) # Verify the model instances are equivalent assert load_balancer_identity_by_crn_model == load_balancer_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_identity_by_crn_model_json2 = load_balancer_identity_by_crn_model.to_dict( - ) + load_balancer_identity_by_crn_model_json2 = load_balancer_identity_by_crn_model.to_dict() assert load_balancer_identity_by_crn_model_json2 == load_balancer_identity_by_crn_model_json - class TestLoadBalancerIdentityByHref(): """ Test Class for LoadBalancerIdentityByHref @@ -42206,29 +40805,23 @@ def test_load_balancer_identity_by_href_serialization(self): # Construct a json representation of a LoadBalancerIdentityByHref model load_balancer_identity_by_href_model_json = {} - load_balancer_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation - load_balancer_identity_by_href_model = LoadBalancerIdentityByHref.from_dict( - load_balancer_identity_by_href_model_json) + load_balancer_identity_by_href_model = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json) assert load_balancer_identity_by_href_model != False # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation - load_balancer_identity_by_href_model_dict = LoadBalancerIdentityByHref.from_dict( - load_balancer_identity_by_href_model_json).__dict__ - load_balancer_identity_by_href_model2 = LoadBalancerIdentityByHref( - **load_balancer_identity_by_href_model_dict) + load_balancer_identity_by_href_model_dict = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json).__dict__ + load_balancer_identity_by_href_model2 = LoadBalancerIdentityByHref(**load_balancer_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_identity_by_href_model == load_balancer_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_identity_by_href_model_json2 = load_balancer_identity_by_href_model.to_dict( - ) + load_balancer_identity_by_href_model_json2 = load_balancer_identity_by_href_model.to_dict() assert load_balancer_identity_by_href_model_json2 == load_balancer_identity_by_href_model_json - class TestLoadBalancerIdentityById(): """ Test Class for LoadBalancerIdentityById @@ -42241,211 +40834,150 @@ def test_load_balancer_identity_by_id_serialization(self): # Construct a json representation of a LoadBalancerIdentityById model load_balancer_identity_by_id_model_json = {} - load_balancer_identity_by_id_model_json[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + load_balancer_identity_by_id_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation - load_balancer_identity_by_id_model = LoadBalancerIdentityById.from_dict( - load_balancer_identity_by_id_model_json) + load_balancer_identity_by_id_model = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json) assert load_balancer_identity_by_id_model != False # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation - load_balancer_identity_by_id_model_dict = LoadBalancerIdentityById.from_dict( - load_balancer_identity_by_id_model_json).__dict__ - load_balancer_identity_by_id_model2 = LoadBalancerIdentityById( - **load_balancer_identity_by_id_model_dict) + load_balancer_identity_by_id_model_dict = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json).__dict__ + load_balancer_identity_by_id_model2 = LoadBalancerIdentityById(**load_balancer_identity_by_id_model_dict) # Verify the model instances are equivalent assert load_balancer_identity_by_id_model == load_balancer_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_identity_by_id_model_json2 = load_balancer_identity_by_id_model.to_dict( - ) + load_balancer_identity_by_id_model_json2 = load_balancer_identity_by_id_model.to_dict() assert load_balancer_identity_by_id_model_json2 == load_balancer_identity_by_id_model_json - -class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch( -): +class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(): """ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch """ - def test_load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_serialization( - self): + def test_load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch model load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json = {} - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json[ - 'http_status_code'] = 301 - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json[ - 'url'] = 'https://www.redirect.com' + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['http_status_code'] = 301 + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['url'] = 'https://www.redirect.com' # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json - ) + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json) assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json - ).__dict__ - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch( - ** - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict - ) + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json).__dict__ + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(**load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model.to_dict( - ) + load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model.to_dict() assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json - -class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype( -): +class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(): """ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype """ - def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_serialization( - self): + def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype model load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json = {} - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json[ - 'http_status_code'] = 301 - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json[ - 'url'] = 'https://www.redirect.com' + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['http_status_code'] = 301 + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['url'] = 'https://www.redirect.com' # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json - ) + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json) assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json - ).__dict__ - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype( - ** - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict - ) + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json).__dict__ + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(**load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model.to_dict( - ) + load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model.to_dict() assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json - -class TestLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL( -): +class TestLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(): """ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL """ - def test_load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_serialization( - self): + def test_load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL """ # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL model load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json = {} - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json[ - 'http_status_code'] = 301 - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json[ - 'url'] = 'https://www.redirect.com' + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['http_status_code'] = 301 + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['url'] = 'https://www.redirect.com' # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict( - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json - ) + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json) assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict( - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json - ).__dict__ - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL( - ** - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict - ) + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json).__dict__ + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(**load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model.to_dict( - ) + load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model.to_dict() assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json - class TestLoadBalancerListenerPolicyTargetLoadBalancerPoolReference(): """ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference """ - def test_load_balancer_listener_policy_target_load_balancer_pool_reference_serialization( - self): + def test_load_balancer_listener_policy_target_load_balancer_pool_reference_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference """ # Construct dict forms of any model objects needed in order to build this model. - load_balancer_pool_reference_deleted_model = { - } # LoadBalancerPoolReferenceDeleted - load_balancer_pool_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted + load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference model load_balancer_listener_policy_target_load_balancer_pool_reference_model_json = {} - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json[ - 'deleted'] = load_balancer_pool_reference_deleted_model - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json[ - 'name'] = 'my-load-balancer-pool' + load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model + load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool' # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation - load_balancer_listener_policy_target_load_balancer_pool_reference_model = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict( - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json - ) + load_balancer_listener_policy_target_load_balancer_pool_reference_model = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json) assert load_balancer_listener_policy_target_load_balancer_pool_reference_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation - load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict( - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json - ).__dict__ - load_balancer_listener_policy_target_load_balancer_pool_reference_model2 = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference( - ** - load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict - ) + load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json).__dict__ + load_balancer_listener_policy_target_load_balancer_pool_reference_model2 = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(**load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_load_balancer_pool_reference_model == load_balancer_listener_policy_target_load_balancer_pool_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 = load_balancer_listener_policy_target_load_balancer_pool_reference_model.to_dict( - ) + load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 = load_balancer_listener_policy_target_load_balancer_pool_reference_model.to_dict() assert load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 == load_balancer_listener_policy_target_load_balancer_pool_reference_model_json - class TestLoadBalancerPoolIdentityByHref(): """ Test Class for LoadBalancerPoolIdentityByHref @@ -42458,29 +40990,23 @@ def test_load_balancer_pool_identity_by_href_serialization(self): # Construct a json representation of a LoadBalancerPoolIdentityByHref model load_balancer_pool_identity_by_href_model_json = {} - load_balancer_pool_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_pool_identity_by_href_model = LoadBalancerPoolIdentityByHref.from_dict( - load_balancer_pool_identity_by_href_model_json) + load_balancer_pool_identity_by_href_model = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json) assert load_balancer_pool_identity_by_href_model != False # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_pool_identity_by_href_model_dict = LoadBalancerPoolIdentityByHref.from_dict( - load_balancer_pool_identity_by_href_model_json).__dict__ - load_balancer_pool_identity_by_href_model2 = LoadBalancerPoolIdentityByHref( - **load_balancer_pool_identity_by_href_model_dict) + load_balancer_pool_identity_by_href_model_dict = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json).__dict__ + load_balancer_pool_identity_by_href_model2 = LoadBalancerPoolIdentityByHref(**load_balancer_pool_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_identity_by_href_model == load_balancer_pool_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_identity_by_href_model_json2 = load_balancer_pool_identity_by_href_model.to_dict( - ) + load_balancer_pool_identity_by_href_model_json2 = load_balancer_pool_identity_by_href_model.to_dict() assert load_balancer_pool_identity_by_href_model_json2 == load_balancer_pool_identity_by_href_model_json - class TestLoadBalancerPoolIdentityById(): """ Test Class for LoadBalancerPoolIdentityById @@ -42493,29 +41019,23 @@ def test_load_balancer_pool_identity_by_id_serialization(self): # Construct a json representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_by_id_model_json = {} - load_balancer_pool_identity_by_id_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_pool_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_pool_identity_by_id_model = LoadBalancerPoolIdentityById.from_dict( - load_balancer_pool_identity_by_id_model_json) + load_balancer_pool_identity_by_id_model = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json) assert load_balancer_pool_identity_by_id_model != False # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_pool_identity_by_id_model_dict = LoadBalancerPoolIdentityById.from_dict( - load_balancer_pool_identity_by_id_model_json).__dict__ - load_balancer_pool_identity_by_id_model2 = LoadBalancerPoolIdentityById( - **load_balancer_pool_identity_by_id_model_dict) + load_balancer_pool_identity_by_id_model_dict = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json).__dict__ + load_balancer_pool_identity_by_id_model2 = LoadBalancerPoolIdentityById(**load_balancer_pool_identity_by_id_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_identity_by_id_model == load_balancer_pool_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_identity_by_id_model_json2 = load_balancer_pool_identity_by_id_model.to_dict( - ) + load_balancer_pool_identity_by_id_model_json2 = load_balancer_pool_identity_by_id_model.to_dict() assert load_balancer_pool_identity_by_id_model_json2 == load_balancer_pool_identity_by_id_model_json - class TestLoadBalancerPoolMemberTargetPrototypeIP(): """ Test Class for LoadBalancerPoolMemberTargetPrototypeIP @@ -42528,29 +41048,23 @@ def test_load_balancer_pool_member_target_prototype_ip_serialization(self): # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeIP model load_balancer_pool_member_target_prototype_ip_model_json = {} - load_balancer_pool_member_target_prototype_ip_model_json[ - 'address'] = '192.168.3.4' + load_balancer_pool_member_target_prototype_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_ip_model = LoadBalancerPoolMemberTargetPrototypeIP.from_dict( - load_balancer_pool_member_target_prototype_ip_model_json) + load_balancer_pool_member_target_prototype_ip_model = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json) assert load_balancer_pool_member_target_prototype_ip_model != False # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_ip_model_dict = LoadBalancerPoolMemberTargetPrototypeIP.from_dict( - load_balancer_pool_member_target_prototype_ip_model_json).__dict__ - load_balancer_pool_member_target_prototype_ip_model2 = LoadBalancerPoolMemberTargetPrototypeIP( - **load_balancer_pool_member_target_prototype_ip_model_dict) + load_balancer_pool_member_target_prototype_ip_model_dict = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json).__dict__ + load_balancer_pool_member_target_prototype_ip_model2 = LoadBalancerPoolMemberTargetPrototypeIP(**load_balancer_pool_member_target_prototype_ip_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_prototype_ip_model == load_balancer_pool_member_target_prototype_ip_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_prototype_ip_model_json2 = load_balancer_pool_member_target_prototype_ip_model.to_dict( - ) + load_balancer_pool_member_target_prototype_ip_model_json2 = load_balancer_pool_member_target_prototype_ip_model.to_dict() assert load_balancer_pool_member_target_prototype_ip_model_json2 == load_balancer_pool_member_target_prototype_ip_model_json - class TestLoadBalancerPoolMemberTargetIP(): """ Test Class for LoadBalancerPoolMemberTargetIP @@ -42563,80 +41077,61 @@ def test_load_balancer_pool_member_target_ip_serialization(self): # Construct a json representation of a LoadBalancerPoolMemberTargetIP model load_balancer_pool_member_target_ip_model_json = {} - load_balancer_pool_member_target_ip_model_json[ - 'address'] = '192.168.3.4' + load_balancer_pool_member_target_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation - load_balancer_pool_member_target_ip_model = LoadBalancerPoolMemberTargetIP.from_dict( - load_balancer_pool_member_target_ip_model_json) + load_balancer_pool_member_target_ip_model = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json) assert load_balancer_pool_member_target_ip_model != False # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation - load_balancer_pool_member_target_ip_model_dict = LoadBalancerPoolMemberTargetIP.from_dict( - load_balancer_pool_member_target_ip_model_json).__dict__ - load_balancer_pool_member_target_ip_model2 = LoadBalancerPoolMemberTargetIP( - **load_balancer_pool_member_target_ip_model_dict) + load_balancer_pool_member_target_ip_model_dict = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json).__dict__ + load_balancer_pool_member_target_ip_model2 = LoadBalancerPoolMemberTargetIP(**load_balancer_pool_member_target_ip_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_ip_model == load_balancer_pool_member_target_ip_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_ip_model_json2 = load_balancer_pool_member_target_ip_model.to_dict( - ) + load_balancer_pool_member_target_ip_model_json2 = load_balancer_pool_member_target_ip_model.to_dict() assert load_balancer_pool_member_target_ip_model_json2 == load_balancer_pool_member_target_ip_model_json - class TestLoadBalancerPoolMemberTargetInstanceReference(): """ Test Class for LoadBalancerPoolMemberTargetInstanceReference """ - def test_load_balancer_pool_member_target_instance_reference_serialization( - self): + def test_load_balancer_pool_member_target_instance_reference_serialization(self): """ Test serialization/deserialization for LoadBalancerPoolMemberTargetInstanceReference """ # Construct dict forms of any model objects needed in order to build this model. - instance_reference_deleted_model = {} # InstanceReferenceDeleted - instance_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + instance_reference_deleted_model = {} # InstanceReferenceDeleted + instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a LoadBalancerPoolMemberTargetInstanceReference model load_balancer_pool_member_target_instance_reference_model_json = {} - load_balancer_pool_member_target_instance_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_instance_reference_model_json[ - 'deleted'] = instance_reference_deleted_model - load_balancer_pool_member_target_instance_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_instance_reference_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - load_balancer_pool_member_target_instance_reference_model_json[ - 'name'] = 'my-instance' + load_balancer_pool_member_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model + load_balancer_pool_member_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation - load_balancer_pool_member_target_instance_reference_model = LoadBalancerPoolMemberTargetInstanceReference.from_dict( - load_balancer_pool_member_target_instance_reference_model_json) + load_balancer_pool_member_target_instance_reference_model = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json) assert load_balancer_pool_member_target_instance_reference_model != False # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation - load_balancer_pool_member_target_instance_reference_model_dict = LoadBalancerPoolMemberTargetInstanceReference.from_dict( - load_balancer_pool_member_target_instance_reference_model_json - ).__dict__ - load_balancer_pool_member_target_instance_reference_model2 = LoadBalancerPoolMemberTargetInstanceReference( - **load_balancer_pool_member_target_instance_reference_model_dict) + load_balancer_pool_member_target_instance_reference_model_dict = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json).__dict__ + load_balancer_pool_member_target_instance_reference_model2 = LoadBalancerPoolMemberTargetInstanceReference(**load_balancer_pool_member_target_instance_reference_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_instance_reference_model == load_balancer_pool_member_target_instance_reference_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_instance_reference_model_json2 = load_balancer_pool_member_target_instance_reference_model.to_dict( - ) + load_balancer_pool_member_target_instance_reference_model_json2 = load_balancer_pool_member_target_instance_reference_model.to_dict() assert load_balancer_pool_member_target_instance_reference_model_json2 == load_balancer_pool_member_target_instance_reference_model_json - class TestLoadBalancerProfileIdentityByHref(): """ Test Class for LoadBalancerProfileIdentityByHref @@ -42649,29 +41144,23 @@ def test_load_balancer_profile_identity_by_href_serialization(self): # Construct a json representation of a LoadBalancerProfileIdentityByHref model load_balancer_profile_identity_by_href_model_json = {} - load_balancer_profile_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' + load_balancer_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation - load_balancer_profile_identity_by_href_model = LoadBalancerProfileIdentityByHref.from_dict( - load_balancer_profile_identity_by_href_model_json) + load_balancer_profile_identity_by_href_model = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json) assert load_balancer_profile_identity_by_href_model != False # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation - load_balancer_profile_identity_by_href_model_dict = LoadBalancerProfileIdentityByHref.from_dict( - load_balancer_profile_identity_by_href_model_json).__dict__ - load_balancer_profile_identity_by_href_model2 = LoadBalancerProfileIdentityByHref( - **load_balancer_profile_identity_by_href_model_dict) + load_balancer_profile_identity_by_href_model_dict = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json).__dict__ + load_balancer_profile_identity_by_href_model2 = LoadBalancerProfileIdentityByHref(**load_balancer_profile_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_identity_by_href_model == load_balancer_profile_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_identity_by_href_model_json2 = load_balancer_profile_identity_by_href_model.to_dict( - ) + load_balancer_profile_identity_by_href_model_json2 = load_balancer_profile_identity_by_href_model.to_dict() assert load_balancer_profile_identity_by_href_model_json2 == load_balancer_profile_identity_by_href_model_json - class TestLoadBalancerProfileIdentityByName(): """ Test Class for LoadBalancerProfileIdentityByName @@ -42684,108 +41173,82 @@ def test_load_balancer_profile_identity_by_name_serialization(self): # Construct a json representation of a LoadBalancerProfileIdentityByName model load_balancer_profile_identity_by_name_model_json = {} - load_balancer_profile_identity_by_name_model_json[ - 'name'] = 'network-fixed' + load_balancer_profile_identity_by_name_model_json['name'] = 'network-fixed' # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation - load_balancer_profile_identity_by_name_model = LoadBalancerProfileIdentityByName.from_dict( - load_balancer_profile_identity_by_name_model_json) + load_balancer_profile_identity_by_name_model = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json) assert load_balancer_profile_identity_by_name_model != False # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation - load_balancer_profile_identity_by_name_model_dict = LoadBalancerProfileIdentityByName.from_dict( - load_balancer_profile_identity_by_name_model_json).__dict__ - load_balancer_profile_identity_by_name_model2 = LoadBalancerProfileIdentityByName( - **load_balancer_profile_identity_by_name_model_dict) + load_balancer_profile_identity_by_name_model_dict = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json).__dict__ + load_balancer_profile_identity_by_name_model2 = LoadBalancerProfileIdentityByName(**load_balancer_profile_identity_by_name_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_identity_by_name_model == load_balancer_profile_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_identity_by_name_model_json2 = load_balancer_profile_identity_by_name_model.to_dict( - ) + load_balancer_profile_identity_by_name_model_json2 = load_balancer_profile_identity_by_name_model.to_dict() assert load_balancer_profile_identity_by_name_model_json2 == load_balancer_profile_identity_by_name_model_json - class TestLoadBalancerProfileSecurityGroupsSupportedDependent(): """ Test Class for LoadBalancerProfileSecurityGroupsSupportedDependent """ - def test_load_balancer_profile_security_groups_supported_dependent_serialization( - self): + def test_load_balancer_profile_security_groups_supported_dependent_serialization(self): """ Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedDependent """ # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedDependent model load_balancer_profile_security_groups_supported_dependent_model_json = {} - load_balancer_profile_security_groups_supported_dependent_model_json[ - 'type'] = 'dependent' + load_balancer_profile_security_groups_supported_dependent_model_json['type'] = 'dependent' # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation - load_balancer_profile_security_groups_supported_dependent_model = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict( - load_balancer_profile_security_groups_supported_dependent_model_json - ) + load_balancer_profile_security_groups_supported_dependent_model = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json) assert load_balancer_profile_security_groups_supported_dependent_model != False # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation - load_balancer_profile_security_groups_supported_dependent_model_dict = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict( - load_balancer_profile_security_groups_supported_dependent_model_json - ).__dict__ - load_balancer_profile_security_groups_supported_dependent_model2 = LoadBalancerProfileSecurityGroupsSupportedDependent( - ** - load_balancer_profile_security_groups_supported_dependent_model_dict - ) + load_balancer_profile_security_groups_supported_dependent_model_dict = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json).__dict__ + load_balancer_profile_security_groups_supported_dependent_model2 = LoadBalancerProfileSecurityGroupsSupportedDependent(**load_balancer_profile_security_groups_supported_dependent_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_security_groups_supported_dependent_model == load_balancer_profile_security_groups_supported_dependent_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_security_groups_supported_dependent_model_json2 = load_balancer_profile_security_groups_supported_dependent_model.to_dict( - ) + load_balancer_profile_security_groups_supported_dependent_model_json2 = load_balancer_profile_security_groups_supported_dependent_model.to_dict() assert load_balancer_profile_security_groups_supported_dependent_model_json2 == load_balancer_profile_security_groups_supported_dependent_model_json - class TestLoadBalancerProfileSecurityGroupsSupportedFixed(): """ Test Class for LoadBalancerProfileSecurityGroupsSupportedFixed """ - def test_load_balancer_profile_security_groups_supported_fixed_serialization( - self): + def test_load_balancer_profile_security_groups_supported_fixed_serialization(self): """ Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedFixed """ # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedFixed model load_balancer_profile_security_groups_supported_fixed_model_json = {} - load_balancer_profile_security_groups_supported_fixed_model_json[ - 'type'] = 'fixed' - load_balancer_profile_security_groups_supported_fixed_model_json[ - 'value'] = True + load_balancer_profile_security_groups_supported_fixed_model_json['type'] = 'fixed' + load_balancer_profile_security_groups_supported_fixed_model_json['value'] = True # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation - load_balancer_profile_security_groups_supported_fixed_model = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict( - load_balancer_profile_security_groups_supported_fixed_model_json) + load_balancer_profile_security_groups_supported_fixed_model = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json) assert load_balancer_profile_security_groups_supported_fixed_model != False # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation - load_balancer_profile_security_groups_supported_fixed_model_dict = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict( - load_balancer_profile_security_groups_supported_fixed_model_json - ).__dict__ - load_balancer_profile_security_groups_supported_fixed_model2 = LoadBalancerProfileSecurityGroupsSupportedFixed( - **load_balancer_profile_security_groups_supported_fixed_model_dict) + load_balancer_profile_security_groups_supported_fixed_model_dict = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json).__dict__ + load_balancer_profile_security_groups_supported_fixed_model2 = LoadBalancerProfileSecurityGroupsSupportedFixed(**load_balancer_profile_security_groups_supported_fixed_model_dict) # Verify the model instances are equivalent assert load_balancer_profile_security_groups_supported_fixed_model == load_balancer_profile_security_groups_supported_fixed_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_profile_security_groups_supported_fixed_model_json2 = load_balancer_profile_security_groups_supported_fixed_model.to_dict( - ) + load_balancer_profile_security_groups_supported_fixed_model_json2 = load_balancer_profile_security_groups_supported_fixed_model.to_dict() assert load_balancer_profile_security_groups_supported_fixed_model_json2 == load_balancer_profile_security_groups_supported_fixed_model_json - class TestNetworkACLIdentityByCRN(): """ Test Class for NetworkACLIdentityByCRN @@ -42798,29 +41261,23 @@ def test_network_acl_identity_by_crn_serialization(self): # Construct a json representation of a NetworkACLIdentityByCRN model network_acl_identity_by_crn_model_json = {} - network_acl_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation - network_acl_identity_by_crn_model = NetworkACLIdentityByCRN.from_dict( - network_acl_identity_by_crn_model_json) + network_acl_identity_by_crn_model = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json) assert network_acl_identity_by_crn_model != False # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation - network_acl_identity_by_crn_model_dict = NetworkACLIdentityByCRN.from_dict( - network_acl_identity_by_crn_model_json).__dict__ - network_acl_identity_by_crn_model2 = NetworkACLIdentityByCRN( - **network_acl_identity_by_crn_model_dict) + network_acl_identity_by_crn_model_dict = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json).__dict__ + network_acl_identity_by_crn_model2 = NetworkACLIdentityByCRN(**network_acl_identity_by_crn_model_dict) # Verify the model instances are equivalent assert network_acl_identity_by_crn_model == network_acl_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - network_acl_identity_by_crn_model_json2 = network_acl_identity_by_crn_model.to_dict( - ) + network_acl_identity_by_crn_model_json2 = network_acl_identity_by_crn_model.to_dict() assert network_acl_identity_by_crn_model_json2 == network_acl_identity_by_crn_model_json - class TestNetworkACLIdentityByHref(): """ Test Class for NetworkACLIdentityByHref @@ -42833,29 +41290,23 @@ def test_network_acl_identity_by_href_serialization(self): # Construct a json representation of a NetworkACLIdentityByHref model network_acl_identity_by_href_model_json = {} - network_acl_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation - network_acl_identity_by_href_model = NetworkACLIdentityByHref.from_dict( - network_acl_identity_by_href_model_json) + network_acl_identity_by_href_model = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json) assert network_acl_identity_by_href_model != False # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation - network_acl_identity_by_href_model_dict = NetworkACLIdentityByHref.from_dict( - network_acl_identity_by_href_model_json).__dict__ - network_acl_identity_by_href_model2 = NetworkACLIdentityByHref( - **network_acl_identity_by_href_model_dict) + network_acl_identity_by_href_model_dict = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json).__dict__ + network_acl_identity_by_href_model2 = NetworkACLIdentityByHref(**network_acl_identity_by_href_model_dict) # Verify the model instances are equivalent assert network_acl_identity_by_href_model == network_acl_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - network_acl_identity_by_href_model_json2 = network_acl_identity_by_href_model.to_dict( - ) + network_acl_identity_by_href_model_json2 = network_acl_identity_by_href_model.to_dict() assert network_acl_identity_by_href_model_json2 == network_acl_identity_by_href_model_json - class TestNetworkACLIdentityById(): """ Test Class for NetworkACLIdentityById @@ -42868,29 +41319,23 @@ def test_network_acl_identity_by_id_serialization(self): # Construct a json representation of a NetworkACLIdentityById model network_acl_identity_by_id_model_json = {} - network_acl_identity_by_id_model_json[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_by_id_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation - network_acl_identity_by_id_model = NetworkACLIdentityById.from_dict( - network_acl_identity_by_id_model_json) + network_acl_identity_by_id_model = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json) assert network_acl_identity_by_id_model != False # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation - network_acl_identity_by_id_model_dict = NetworkACLIdentityById.from_dict( - network_acl_identity_by_id_model_json).__dict__ - network_acl_identity_by_id_model2 = NetworkACLIdentityById( - **network_acl_identity_by_id_model_dict) + network_acl_identity_by_id_model_dict = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json).__dict__ + network_acl_identity_by_id_model2 = NetworkACLIdentityById(**network_acl_identity_by_id_model_dict) # Verify the model instances are equivalent assert network_acl_identity_by_id_model == network_acl_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - network_acl_identity_by_id_model_json2 = network_acl_identity_by_id_model.to_dict( - ) + network_acl_identity_by_id_model_json2 = network_acl_identity_by_id_model.to_dict() assert network_acl_identity_by_id_model_json2 == network_acl_identity_by_id_model_json - class TestNetworkACLPrototypeNetworkACLByRules(): """ Test Class for NetworkACLPrototypeNetworkACLByRules @@ -42903,854 +41348,591 @@ def test_network_acl_prototype_network_acl_by_rules_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - vpc_identity_model = {} # VPCIdentityById + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61' - network_acl_rule_prototype_network_acl_context_model = { - } # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll + network_acl_rule_prototype_network_acl_context_model = {} # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_model[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_model[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_model[ - 'source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' network_acl_rule_prototype_network_acl_context_model['protocol'] = 'all' # Construct a json representation of a NetworkACLPrototypeNetworkACLByRules model network_acl_prototype_network_acl_by_rules_model_json = {} - network_acl_prototype_network_acl_by_rules_model_json[ - 'name'] = 'my-network-acl' - network_acl_prototype_network_acl_by_rules_model_json[ - 'resource_group'] = resource_group_identity_model - network_acl_prototype_network_acl_by_rules_model_json[ - 'vpc'] = vpc_identity_model - network_acl_prototype_network_acl_by_rules_model_json['rules'] = [ - network_acl_rule_prototype_network_acl_context_model - ] + network_acl_prototype_network_acl_by_rules_model_json['name'] = 'my-network-acl' + network_acl_prototype_network_acl_by_rules_model_json['resource_group'] = resource_group_identity_model + network_acl_prototype_network_acl_by_rules_model_json['vpc'] = vpc_identity_model + network_acl_prototype_network_acl_by_rules_model_json['rules'] = [network_acl_rule_prototype_network_acl_context_model] # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation - network_acl_prototype_network_acl_by_rules_model = NetworkACLPrototypeNetworkACLByRules.from_dict( - network_acl_prototype_network_acl_by_rules_model_json) + network_acl_prototype_network_acl_by_rules_model = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json) assert network_acl_prototype_network_acl_by_rules_model != False # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation - network_acl_prototype_network_acl_by_rules_model_dict = NetworkACLPrototypeNetworkACLByRules.from_dict( - network_acl_prototype_network_acl_by_rules_model_json).__dict__ - network_acl_prototype_network_acl_by_rules_model2 = NetworkACLPrototypeNetworkACLByRules( - **network_acl_prototype_network_acl_by_rules_model_dict) + network_acl_prototype_network_acl_by_rules_model_dict = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json).__dict__ + network_acl_prototype_network_acl_by_rules_model2 = NetworkACLPrototypeNetworkACLByRules(**network_acl_prototype_network_acl_by_rules_model_dict) # Verify the model instances are equivalent assert network_acl_prototype_network_acl_by_rules_model == network_acl_prototype_network_acl_by_rules_model2 # Convert model instance back to dict and verify no loss of data - network_acl_prototype_network_acl_by_rules_model_json2 = network_acl_prototype_network_acl_by_rules_model.to_dict( - ) + network_acl_prototype_network_acl_by_rules_model_json2 = network_acl_prototype_network_acl_by_rules_model.to_dict() assert network_acl_prototype_network_acl_by_rules_model_json2 == network_acl_prototype_network_acl_by_rules_model_json - class TestNetworkACLPrototypeNetworkACLBySourceNetworkACL(): """ Test Class for NetworkACLPrototypeNetworkACLBySourceNetworkACL """ - def test_network_acl_prototype_network_acl_by_source_network_acl_serialization( - self): + def test_network_acl_prototype_network_acl_by_source_network_acl_serialization(self): """ Test serialization/deserialization for NetworkACLPrototypeNetworkACLBySourceNetworkACL """ # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - vpc_identity_model = {} # VPCIdentityById + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61' - network_acl_identity_model = {} # NetworkACLIdentityById - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model = {} # NetworkACLIdentityById + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' # Construct a json representation of a NetworkACLPrototypeNetworkACLBySourceNetworkACL model network_acl_prototype_network_acl_by_source_network_acl_model_json = {} - network_acl_prototype_network_acl_by_source_network_acl_model_json[ - 'name'] = 'my-network-acl' - network_acl_prototype_network_acl_by_source_network_acl_model_json[ - 'resource_group'] = resource_group_identity_model - network_acl_prototype_network_acl_by_source_network_acl_model_json[ - 'vpc'] = vpc_identity_model - network_acl_prototype_network_acl_by_source_network_acl_model_json[ - 'source_network_acl'] = network_acl_identity_model + network_acl_prototype_network_acl_by_source_network_acl_model_json['name'] = 'my-network-acl' + network_acl_prototype_network_acl_by_source_network_acl_model_json['resource_group'] = resource_group_identity_model + network_acl_prototype_network_acl_by_source_network_acl_model_json['vpc'] = vpc_identity_model + network_acl_prototype_network_acl_by_source_network_acl_model_json['source_network_acl'] = network_acl_identity_model # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation - network_acl_prototype_network_acl_by_source_network_acl_model = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict( - network_acl_prototype_network_acl_by_source_network_acl_model_json) + network_acl_prototype_network_acl_by_source_network_acl_model = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json) assert network_acl_prototype_network_acl_by_source_network_acl_model != False # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation - network_acl_prototype_network_acl_by_source_network_acl_model_dict = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict( - network_acl_prototype_network_acl_by_source_network_acl_model_json - ).__dict__ - network_acl_prototype_network_acl_by_source_network_acl_model2 = NetworkACLPrototypeNetworkACLBySourceNetworkACL( - ** - network_acl_prototype_network_acl_by_source_network_acl_model_dict) + network_acl_prototype_network_acl_by_source_network_acl_model_dict = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json).__dict__ + network_acl_prototype_network_acl_by_source_network_acl_model2 = NetworkACLPrototypeNetworkACLBySourceNetworkACL(**network_acl_prototype_network_acl_by_source_network_acl_model_dict) # Verify the model instances are equivalent assert network_acl_prototype_network_acl_by_source_network_acl_model == network_acl_prototype_network_acl_by_source_network_acl_model2 # Convert model instance back to dict and verify no loss of data - network_acl_prototype_network_acl_by_source_network_acl_model_json2 = network_acl_prototype_network_acl_by_source_network_acl_model.to_dict( - ) + network_acl_prototype_network_acl_by_source_network_acl_model_json2 = network_acl_prototype_network_acl_by_source_network_acl_model.to_dict() assert network_acl_prototype_network_acl_by_source_network_acl_model_json2 == network_acl_prototype_network_acl_by_source_network_acl_model_json - class TestNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(): """ Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref """ - def test_network_acl_rule_before_patch_network_acl_rule_identity_by_href_serialization( - self): + def test_network_acl_rule_before_patch_network_acl_rule_identity_by_href_serialization(self): """ Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref """ # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref model network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json = {} - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict( - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json) assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model != False # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict( - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json - ).__dict__ - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref( - ** - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json).__dict__ + network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(**network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict) # Verify the model instances are equivalent assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_href_model.to_dict( - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_href_model.to_dict() assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json - class TestNetworkACLRuleBeforePatchNetworkACLRuleIdentityById(): """ Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById """ - def test_network_acl_rule_before_patch_network_acl_rule_identity_by_id_serialization( - self): + def test_network_acl_rule_before_patch_network_acl_rule_identity_by_id_serialization(self): """ Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById """ # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json = {} - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict( - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json) assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model != False # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict( - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json - ).__dict__ - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById( - ** - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json).__dict__ + network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(**network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict) # Verify the model instances are equivalent assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_id_model.to_dict( - ) + network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_id_model.to_dict() assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json - class TestNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(): """ Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref """ - def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_href_serialization( - self): + def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_href_serialization(self): """ Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref """ # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref model network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json = {} - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict( - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json) assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model != False # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict( - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json - ).__dict__ - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref( - ** - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json).__dict__ + network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(**network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict) # Verify the model instances are equivalent assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model.to_dict( - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model.to_dict() assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json - class TestNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(): """ Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById """ - def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_id_serialization( - self): + def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_id_serialization(self): """ Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById """ # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json = {} - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict( - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json) assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model != False # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict( - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json - ).__dict__ - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById( - ** - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json).__dict__ + network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(**network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict) # Verify the model instances are equivalent assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model.to_dict( - ) + network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model.to_dict() assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json - class TestNetworkACLRuleItemNetworkACLRuleProtocolAll(): """ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolAll """ - def test_network_acl_rule_item_network_acl_rule_protocol_all_serialization( - self): + def test_network_acl_rule_item_network_acl_rule_protocol_all_serialization(self): """ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolAll """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolAll model network_acl_rule_item_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'action'] = 'allow' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'source'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_all_model_json[ - 'protocol'] = 'all' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['action'] = 'allow' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_item_network_acl_rule_protocol_all_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_item_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_all_model = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_item_network_acl_rule_protocol_all_model_json) + network_acl_rule_item_network_acl_rule_protocol_all_model = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json) assert network_acl_rule_item_network_acl_rule_protocol_all_model != False # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_all_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_item_network_acl_rule_protocol_all_model_json - ).__dict__ - network_acl_rule_item_network_acl_rule_protocol_all_model2 = NetworkACLRuleItemNetworkACLRuleProtocolAll( - **network_acl_rule_item_network_acl_rule_protocol_all_model_dict) + network_acl_rule_item_network_acl_rule_protocol_all_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json).__dict__ + network_acl_rule_item_network_acl_rule_protocol_all_model2 = NetworkACLRuleItemNetworkACLRuleProtocolAll(**network_acl_rule_item_network_acl_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert network_acl_rule_item_network_acl_rule_protocol_all_model == network_acl_rule_item_network_acl_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_item_network_acl_rule_protocol_all_model_json2 = network_acl_rule_item_network_acl_rule_protocol_all_model.to_dict( - ) + network_acl_rule_item_network_acl_rule_protocol_all_model_json2 = network_acl_rule_item_network_acl_rule_protocol_all_model.to_dict() assert network_acl_rule_item_network_acl_rule_protocol_all_model_json2 == network_acl_rule_item_network_acl_rule_protocol_all_model_json - class TestNetworkACLRuleItemNetworkACLRuleProtocolICMP(): """ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolICMP """ - def test_network_acl_rule_item_network_acl_rule_protocol_icmp_serialization( - self): + def test_network_acl_rule_item_network_acl_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolICMP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolICMP model network_acl_rule_item_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'action'] = 'allow' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'source'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'code'] = 0 - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json[ - 'type'] = 8 + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['code'] = 0 + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_icmp_model = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json) + network_acl_rule_item_network_acl_rule_protocol_icmp_model = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json) assert network_acl_rule_item_network_acl_rule_protocol_icmp_model != False # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json - ).__dict__ - network_acl_rule_item_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolICMP( - **network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict) + network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json).__dict__ + network_acl_rule_item_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolICMP(**network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_item_network_acl_rule_protocol_icmp_model == network_acl_rule_item_network_acl_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_icmp_model.to_dict( - ) + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_icmp_model.to_dict() assert network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_icmp_model_json - class TestNetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(): """ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP """ - def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization( - self): + def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP model network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'action'] = 'allow' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'source'] = '192.168.3.0/24' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_max'] = 22 - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_min'] = 22 - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_max'] = 65535 - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_min'] = 49152 + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json) + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json) assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model != False # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json - ).__dict__ - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP( - **network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict) + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json).__dict__ + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(**network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_tcpudp_model.to_dict( - ) + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json - class TestNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll(): """ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_serialization( - self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll """ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll model network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json[ - 'protocol'] = 'all' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json) assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll( - ** - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model.to_dict( - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model.to_dict() assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json - class TestNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP(): """ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_serialization( - self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP """ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP model network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'code'] = 0 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json[ - 'type'] = 8 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['code'] = 0 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json) assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP( - ** - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model.to_dict( - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model.to_dict() assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json - -class TestNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP( -): +class TestNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP(): """ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_serialization( - self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP """ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_min'] = 49152 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json) assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP( - ** - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model.to_dict( - ) + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json - class TestNetworkACLRulePrototypeNetworkACLRuleProtocolAll(): """ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolAll """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_all_serialization( - self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_all_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolAll """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_before_prototype_model = { - } # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById - network_acl_rule_before_prototype_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolAll model network_acl_rule_prototype_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json[ - 'protocol'] = 'all' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json) + network_acl_rule_prototype_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_model_json) assert network_acl_rule_prototype_network_acl_rule_protocol_all_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAll( - ** - network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict) + network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAll(**network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_rule_protocol_all_model == network_acl_rule_prototype_network_acl_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_model.to_dict( - ) + network_acl_rule_prototype_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_model.to_dict() assert network_acl_rule_prototype_network_acl_rule_protocol_all_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_all_model_json - class TestNetworkACLRulePrototypeNetworkACLRuleProtocolICMP(): """ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolICMP """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_serialization( - self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolICMP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_before_prototype_model = { - } # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById - network_acl_rule_before_prototype_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'code'] = 0 - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json[ - 'type'] = 8 + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['code'] = 0 + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json - ) + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json) assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP( - ** - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict - ) + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP(**network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model == network_acl_rule_prototype_network_acl_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_model.to_dict( - ) + network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_model.to_dict() assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json - class TestNetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP(): """ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_serialization( - self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_before_prototype_model = { - } # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById - network_acl_rule_before_prototype_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP model network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_min'] = 49152 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json - ) + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json) assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model != False # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json - ).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP( - ** - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict - ) + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP(**network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model.to_dict( - ) + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json - class TestNetworkACLRuleNetworkACLRuleProtocolAll(): """ Test Class for NetworkACLRuleNetworkACLRuleProtocolAll @@ -43763,220 +41945,150 @@ def test_network_acl_rule_network_acl_rule_protocol_all_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolAll model network_acl_rule_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'action'] = 'allow' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'source'] = '192.168.3.0/24' - network_acl_rule_network_acl_rule_protocol_all_model_json[ - 'protocol'] = 'all' + network_acl_rule_network_acl_rule_protocol_all_model_json['action'] = 'allow' + network_acl_rule_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_network_acl_rule_protocol_all_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' + network_acl_rule_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4' + network_acl_rule_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_all_model = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_network_acl_rule_protocol_all_model_json) + network_acl_rule_network_acl_rule_protocol_all_model = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json) assert network_acl_rule_network_acl_rule_protocol_all_model != False # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_all_model_dict = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict( - network_acl_rule_network_acl_rule_protocol_all_model_json).__dict__ - network_acl_rule_network_acl_rule_protocol_all_model2 = NetworkACLRuleNetworkACLRuleProtocolAll( - **network_acl_rule_network_acl_rule_protocol_all_model_dict) + network_acl_rule_network_acl_rule_protocol_all_model_dict = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json).__dict__ + network_acl_rule_network_acl_rule_protocol_all_model2 = NetworkACLRuleNetworkACLRuleProtocolAll(**network_acl_rule_network_acl_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert network_acl_rule_network_acl_rule_protocol_all_model == network_acl_rule_network_acl_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_network_acl_rule_protocol_all_model_json2 = network_acl_rule_network_acl_rule_protocol_all_model.to_dict( - ) + network_acl_rule_network_acl_rule_protocol_all_model_json2 = network_acl_rule_network_acl_rule_protocol_all_model.to_dict() assert network_acl_rule_network_acl_rule_protocol_all_model_json2 == network_acl_rule_network_acl_rule_protocol_all_model_json - class TestNetworkACLRuleNetworkACLRuleProtocolICMP(): """ Test Class for NetworkACLRuleNetworkACLRuleProtocolICMP """ - def test_network_acl_rule_network_acl_rule_protocol_icmp_serialization( - self): + def test_network_acl_rule_network_acl_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolICMP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolICMP model network_acl_rule_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'action'] = 'allow' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'source'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_network_acl_rule_protocol_icmp_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24' network_acl_rule_network_acl_rule_protocol_icmp_model_json['code'] = 0 - network_acl_rule_network_acl_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' network_acl_rule_network_acl_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_icmp_model = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_network_acl_rule_protocol_icmp_model_json) + network_acl_rule_network_acl_rule_protocol_icmp_model = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json) assert network_acl_rule_network_acl_rule_protocol_icmp_model != False # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict( - network_acl_rule_network_acl_rule_protocol_icmp_model_json).__dict__ - network_acl_rule_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleNetworkACLRuleProtocolICMP( - **network_acl_rule_network_acl_rule_protocol_icmp_model_dict) + network_acl_rule_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json).__dict__ + network_acl_rule_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleNetworkACLRuleProtocolICMP(**network_acl_rule_network_acl_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_network_acl_rule_protocol_icmp_model == network_acl_rule_network_acl_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_network_acl_rule_protocol_icmp_model.to_dict( - ) + network_acl_rule_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_network_acl_rule_protocol_icmp_model.to_dict() assert network_acl_rule_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_network_acl_rule_protocol_icmp_model_json - class TestNetworkACLRuleNetworkACLRuleProtocolTCPUDP(): """ Test Class for NetworkACLRuleNetworkACLRuleProtocolTCPUDP """ - def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization( - self): + def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolTCPUDP """ # Construct dict forms of any model objects needed in order to build this model. - network_acl_rule_reference_deleted_model = { - } # NetworkACLRuleReferenceDeleted - network_acl_rule_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model[ - 'deleted'] = network_acl_rule_reference_deleted_model - network_acl_rule_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted + network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolTCPUDP model network_acl_rule_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'action'] = 'allow' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'before'] = network_acl_rule_reference_model - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'destination'] = '192.168.3.0/24' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'name'] = 'my-rule-2' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'source'] = '192.168.3.0/24' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_max'] = 22 - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'destination_port_min'] = 22 - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_max'] = 65535 - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json[ - 'source_port_min'] = 49152 + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json) + network_acl_rule_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json) assert network_acl_rule_network_acl_rule_protocol_tcpudp_model != False # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict( - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json - ).__dict__ - network_acl_rule_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleNetworkACLRuleProtocolTCPUDP( - **network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict) + network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json).__dict__ + network_acl_rule_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleNetworkACLRuleProtocolTCPUDP(**network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert network_acl_rule_network_acl_rule_protocol_tcpudp_model == network_acl_rule_network_acl_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_network_acl_rule_protocol_tcpudp_model.to_dict( - ) + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_network_acl_rule_protocol_tcpudp_model_json - class TestOperatingSystemIdentityByHref(): """ Test Class for OperatingSystemIdentityByHref @@ -43989,29 +42101,23 @@ def test_operating_system_identity_by_href_serialization(self): # Construct a json representation of a OperatingSystemIdentityByHref model operating_system_identity_by_href_model_json = {} - operating_system_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' + operating_system_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation - operating_system_identity_by_href_model = OperatingSystemIdentityByHref.from_dict( - operating_system_identity_by_href_model_json) + operating_system_identity_by_href_model = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json) assert operating_system_identity_by_href_model != False # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation - operating_system_identity_by_href_model_dict = OperatingSystemIdentityByHref.from_dict( - operating_system_identity_by_href_model_json).__dict__ - operating_system_identity_by_href_model2 = OperatingSystemIdentityByHref( - **operating_system_identity_by_href_model_dict) + operating_system_identity_by_href_model_dict = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json).__dict__ + operating_system_identity_by_href_model2 = OperatingSystemIdentityByHref(**operating_system_identity_by_href_model_dict) # Verify the model instances are equivalent assert operating_system_identity_by_href_model == operating_system_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - operating_system_identity_by_href_model_json2 = operating_system_identity_by_href_model.to_dict( - ) + operating_system_identity_by_href_model_json2 = operating_system_identity_by_href_model.to_dict() assert operating_system_identity_by_href_model_json2 == operating_system_identity_by_href_model_json - class TestOperatingSystemIdentityByName(): """ Test Class for OperatingSystemIdentityByName @@ -44027,72 +42133,55 @@ def test_operating_system_identity_by_name_serialization(self): operating_system_identity_by_name_model_json['name'] = 'ubuntu-16-amd64' # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation - operating_system_identity_by_name_model = OperatingSystemIdentityByName.from_dict( - operating_system_identity_by_name_model_json) + operating_system_identity_by_name_model = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json) assert operating_system_identity_by_name_model != False # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation - operating_system_identity_by_name_model_dict = OperatingSystemIdentityByName.from_dict( - operating_system_identity_by_name_model_json).__dict__ - operating_system_identity_by_name_model2 = OperatingSystemIdentityByName( - **operating_system_identity_by_name_model_dict) + operating_system_identity_by_name_model_dict = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json).__dict__ + operating_system_identity_by_name_model2 = OperatingSystemIdentityByName(**operating_system_identity_by_name_model_dict) # Verify the model instances are equivalent assert operating_system_identity_by_name_model == operating_system_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - operating_system_identity_by_name_model_json2 = operating_system_identity_by_name_model.to_dict( - ) + operating_system_identity_by_name_model_json2 = operating_system_identity_by_name_model.to_dict() assert operating_system_identity_by_name_model_json2 == operating_system_identity_by_name_model_json - class TestPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext """ - def test_public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_serialization( - self): + def test_public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_serialization(self): """ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext """ # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext model public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json[ - 'name'] = 'my-floating-ip' - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json[ - 'resource_group'] = resource_group_identity_model + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['name'] = 'my-floating-ip' + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['resource_group'] = resource_group_identity_model # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict( - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json - ) + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json) assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model != False # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict( - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json - ).__dict__ - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2 = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext( - ** - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict - ) + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json).__dict__ + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2 = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(**public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model == public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json2 = public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model.to_dict( - ) + public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json2 = public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model.to_dict() assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json2 == public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json - class TestPublicGatewayIdentityByCRN(): """ Test Class for PublicGatewayIdentityByCRN @@ -44105,29 +42194,23 @@ def test_public_gateway_identity_by_crn_serialization(self): # Construct a json representation of a PublicGatewayIdentityByCRN model public_gateway_identity_by_crn_model_json = {} - public_gateway_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a model instance of PublicGatewayIdentityByCRN by calling from_dict on the json representation - public_gateway_identity_by_crn_model = PublicGatewayIdentityByCRN.from_dict( - public_gateway_identity_by_crn_model_json) + public_gateway_identity_by_crn_model = PublicGatewayIdentityByCRN.from_dict(public_gateway_identity_by_crn_model_json) assert public_gateway_identity_by_crn_model != False # Construct a model instance of PublicGatewayIdentityByCRN by calling from_dict on the json representation - public_gateway_identity_by_crn_model_dict = PublicGatewayIdentityByCRN.from_dict( - public_gateway_identity_by_crn_model_json).__dict__ - public_gateway_identity_by_crn_model2 = PublicGatewayIdentityByCRN( - **public_gateway_identity_by_crn_model_dict) + public_gateway_identity_by_crn_model_dict = PublicGatewayIdentityByCRN.from_dict(public_gateway_identity_by_crn_model_json).__dict__ + public_gateway_identity_by_crn_model2 = PublicGatewayIdentityByCRN(**public_gateway_identity_by_crn_model_dict) # Verify the model instances are equivalent assert public_gateway_identity_by_crn_model == public_gateway_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_identity_by_crn_model_json2 = public_gateway_identity_by_crn_model.to_dict( - ) + public_gateway_identity_by_crn_model_json2 = public_gateway_identity_by_crn_model.to_dict() assert public_gateway_identity_by_crn_model_json2 == public_gateway_identity_by_crn_model_json - class TestPublicGatewayIdentityByHref(): """ Test Class for PublicGatewayIdentityByHref @@ -44140,29 +42223,23 @@ def test_public_gateway_identity_by_href_serialization(self): # Construct a json representation of a PublicGatewayIdentityByHref model public_gateway_identity_by_href_model_json = {} - public_gateway_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a model instance of PublicGatewayIdentityByHref by calling from_dict on the json representation - public_gateway_identity_by_href_model = PublicGatewayIdentityByHref.from_dict( - public_gateway_identity_by_href_model_json) + public_gateway_identity_by_href_model = PublicGatewayIdentityByHref.from_dict(public_gateway_identity_by_href_model_json) assert public_gateway_identity_by_href_model != False # Construct a model instance of PublicGatewayIdentityByHref by calling from_dict on the json representation - public_gateway_identity_by_href_model_dict = PublicGatewayIdentityByHref.from_dict( - public_gateway_identity_by_href_model_json).__dict__ - public_gateway_identity_by_href_model2 = PublicGatewayIdentityByHref( - **public_gateway_identity_by_href_model_dict) + public_gateway_identity_by_href_model_dict = PublicGatewayIdentityByHref.from_dict(public_gateway_identity_by_href_model_json).__dict__ + public_gateway_identity_by_href_model2 = PublicGatewayIdentityByHref(**public_gateway_identity_by_href_model_dict) # Verify the model instances are equivalent assert public_gateway_identity_by_href_model == public_gateway_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_identity_by_href_model_json2 = public_gateway_identity_by_href_model.to_dict( - ) + public_gateway_identity_by_href_model_json2 = public_gateway_identity_by_href_model.to_dict() assert public_gateway_identity_by_href_model_json2 == public_gateway_identity_by_href_model_json - class TestPublicGatewayIdentityById(): """ Test Class for PublicGatewayIdentityById @@ -44175,29 +42252,23 @@ def test_public_gateway_identity_by_id_serialization(self): # Construct a json representation of a PublicGatewayIdentityById model public_gateway_identity_by_id_model_json = {} - public_gateway_identity_by_id_model_json[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_by_id_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' # Construct a model instance of PublicGatewayIdentityById by calling from_dict on the json representation - public_gateway_identity_by_id_model = PublicGatewayIdentityById.from_dict( - public_gateway_identity_by_id_model_json) + public_gateway_identity_by_id_model = PublicGatewayIdentityById.from_dict(public_gateway_identity_by_id_model_json) assert public_gateway_identity_by_id_model != False # Construct a model instance of PublicGatewayIdentityById by calling from_dict on the json representation - public_gateway_identity_by_id_model_dict = PublicGatewayIdentityById.from_dict( - public_gateway_identity_by_id_model_json).__dict__ - public_gateway_identity_by_id_model2 = PublicGatewayIdentityById( - **public_gateway_identity_by_id_model_dict) + public_gateway_identity_by_id_model_dict = PublicGatewayIdentityById.from_dict(public_gateway_identity_by_id_model_json).__dict__ + public_gateway_identity_by_id_model2 = PublicGatewayIdentityById(**public_gateway_identity_by_id_model_dict) # Verify the model instances are equivalent assert public_gateway_identity_by_id_model == public_gateway_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_identity_by_id_model_json2 = public_gateway_identity_by_id_model.to_dict( - ) + public_gateway_identity_by_id_model_json2 = public_gateway_identity_by_id_model.to_dict() assert public_gateway_identity_by_id_model_json2 == public_gateway_identity_by_id_model_json - class TestReservedIPTargetEndpointGatewayReference(): """ Test Class for ReservedIPTargetEndpointGatewayReference @@ -44210,46 +42281,33 @@ def test_reserved_ip_target_endpoint_gateway_reference_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - endpoint_gateway_reference_deleted_model = { - } # EndpointGatewayReferenceDeleted - endpoint_gateway_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a ReservedIPTargetEndpointGatewayReference model reserved_ip_target_endpoint_gateway_reference_model_json = {} - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'deleted'] = endpoint_gateway_reference_deleted_model - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'name'] = 'my-endpoint-gateway' - reserved_ip_target_endpoint_gateway_reference_model_json[ - 'resource_type'] = 'endpoint_gateway' + reserved_ip_target_endpoint_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_endpoint_gateway_reference_model_json['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_endpoint_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_endpoint_gateway_reference_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_endpoint_gateway_reference_model_json['name'] = 'my-endpoint-gateway' + reserved_ip_target_endpoint_gateway_reference_model_json['resource_type'] = 'endpoint_gateway' # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation - reserved_ip_target_endpoint_gateway_reference_model = ReservedIPTargetEndpointGatewayReference.from_dict( - reserved_ip_target_endpoint_gateway_reference_model_json) + reserved_ip_target_endpoint_gateway_reference_model = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json) assert reserved_ip_target_endpoint_gateway_reference_model != False # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation - reserved_ip_target_endpoint_gateway_reference_model_dict = ReservedIPTargetEndpointGatewayReference.from_dict( - reserved_ip_target_endpoint_gateway_reference_model_json).__dict__ - reserved_ip_target_endpoint_gateway_reference_model2 = ReservedIPTargetEndpointGatewayReference( - **reserved_ip_target_endpoint_gateway_reference_model_dict) + reserved_ip_target_endpoint_gateway_reference_model_dict = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json).__dict__ + reserved_ip_target_endpoint_gateway_reference_model2 = ReservedIPTargetEndpointGatewayReference(**reserved_ip_target_endpoint_gateway_reference_model_dict) # Verify the model instances are equivalent assert reserved_ip_target_endpoint_gateway_reference_model == reserved_ip_target_endpoint_gateway_reference_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_target_endpoint_gateway_reference_model_json2 = reserved_ip_target_endpoint_gateway_reference_model.to_dict( - ) + reserved_ip_target_endpoint_gateway_reference_model_json2 = reserved_ip_target_endpoint_gateway_reference_model.to_dict() assert reserved_ip_target_endpoint_gateway_reference_model_json2 == reserved_ip_target_endpoint_gateway_reference_model_json - class TestResourceGroupIdentityById(): """ Test Class for ResourceGroupIdentityById @@ -44262,29 +42320,23 @@ def test_resource_group_identity_by_id_serialization(self): # Construct a json representation of a ResourceGroupIdentityById model resource_group_identity_by_id_model_json = {} - resource_group_identity_by_id_model_json[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_identity_by_id_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation - resource_group_identity_by_id_model = ResourceGroupIdentityById.from_dict( - resource_group_identity_by_id_model_json) + resource_group_identity_by_id_model = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json) assert resource_group_identity_by_id_model != False # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation - resource_group_identity_by_id_model_dict = ResourceGroupIdentityById.from_dict( - resource_group_identity_by_id_model_json).__dict__ - resource_group_identity_by_id_model2 = ResourceGroupIdentityById( - **resource_group_identity_by_id_model_dict) + resource_group_identity_by_id_model_dict = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json).__dict__ + resource_group_identity_by_id_model2 = ResourceGroupIdentityById(**resource_group_identity_by_id_model_dict) # Verify the model instances are equivalent assert resource_group_identity_by_id_model == resource_group_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - resource_group_identity_by_id_model_json2 = resource_group_identity_by_id_model.to_dict( - ) + resource_group_identity_by_id_model_json2 = resource_group_identity_by_id_model.to_dict() assert resource_group_identity_by_id_model_json2 == resource_group_identity_by_id_model_json - class TestRouteNextHopIP(): """ Test Class for RouteNextHopIP @@ -44300,15 +42352,12 @@ def test_route_next_hop_ip_serialization(self): route_next_hop_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation - route_next_hop_ip_model = RouteNextHopIP.from_dict( - route_next_hop_ip_model_json) + route_next_hop_ip_model = RouteNextHopIP.from_dict(route_next_hop_ip_model_json) assert route_next_hop_ip_model != False # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation - route_next_hop_ip_model_dict = RouteNextHopIP.from_dict( - route_next_hop_ip_model_json).__dict__ - route_next_hop_ip_model2 = RouteNextHopIP( - **route_next_hop_ip_model_dict) + route_next_hop_ip_model_dict = RouteNextHopIP.from_dict(route_next_hop_ip_model_json).__dict__ + route_next_hop_ip_model2 = RouteNextHopIP(**route_next_hop_ip_model_dict) # Verify the model instances are equivalent assert route_next_hop_ip_model == route_next_hop_ip_model2 @@ -44317,7 +42366,6 @@ def test_route_next_hop_ip_serialization(self): route_next_hop_ip_model_json2 = route_next_hop_ip_model.to_dict() assert route_next_hop_ip_model_json2 == route_next_hop_ip_model_json - class TestRouteNextHopPrototypeRouteNextHopIP(): """ Test Class for RouteNextHopPrototypeRouteNextHopIP @@ -44330,80 +42378,61 @@ def test_route_next_hop_prototype_route_next_hop_ip_serialization(self): # Construct a json representation of a RouteNextHopPrototypeRouteNextHopIP model route_next_hop_prototype_route_next_hop_ip_model_json = {} - route_next_hop_prototype_route_next_hop_ip_model_json[ - 'address'] = '192.168.3.4' + route_next_hop_prototype_route_next_hop_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of RouteNextHopPrototypeRouteNextHopIP by calling from_dict on the json representation - route_next_hop_prototype_route_next_hop_ip_model = RouteNextHopPrototypeRouteNextHopIP.from_dict( - route_next_hop_prototype_route_next_hop_ip_model_json) + route_next_hop_prototype_route_next_hop_ip_model = RouteNextHopPrototypeRouteNextHopIP.from_dict(route_next_hop_prototype_route_next_hop_ip_model_json) assert route_next_hop_prototype_route_next_hop_ip_model != False # Construct a model instance of RouteNextHopPrototypeRouteNextHopIP by calling from_dict on the json representation - route_next_hop_prototype_route_next_hop_ip_model_dict = RouteNextHopPrototypeRouteNextHopIP.from_dict( - route_next_hop_prototype_route_next_hop_ip_model_json).__dict__ - route_next_hop_prototype_route_next_hop_ip_model2 = RouteNextHopPrototypeRouteNextHopIP( - **route_next_hop_prototype_route_next_hop_ip_model_dict) + route_next_hop_prototype_route_next_hop_ip_model_dict = RouteNextHopPrototypeRouteNextHopIP.from_dict(route_next_hop_prototype_route_next_hop_ip_model_json).__dict__ + route_next_hop_prototype_route_next_hop_ip_model2 = RouteNextHopPrototypeRouteNextHopIP(**route_next_hop_prototype_route_next_hop_ip_model_dict) # Verify the model instances are equivalent assert route_next_hop_prototype_route_next_hop_ip_model == route_next_hop_prototype_route_next_hop_ip_model2 # Convert model instance back to dict and verify no loss of data - route_next_hop_prototype_route_next_hop_ip_model_json2 = route_next_hop_prototype_route_next_hop_ip_model.to_dict( - ) + route_next_hop_prototype_route_next_hop_ip_model_json2 = route_next_hop_prototype_route_next_hop_ip_model.to_dict() assert route_next_hop_prototype_route_next_hop_ip_model_json2 == route_next_hop_prototype_route_next_hop_ip_model_json - class TestRouteNextHopVPNGatewayConnectionReference(): """ Test Class for RouteNextHopVPNGatewayConnectionReference """ - def test_route_next_hop_vpn_gateway_connection_reference_serialization( - self): + def test_route_next_hop_vpn_gateway_connection_reference_serialization(self): """ Test serialization/deserialization for RouteNextHopVPNGatewayConnectionReference """ # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a RouteNextHopVPNGatewayConnectionReference model route_next_hop_vpn_gateway_connection_reference_model_json = {} - route_next_hop_vpn_gateway_connection_reference_model_json[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - route_next_hop_vpn_gateway_connection_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - route_next_hop_vpn_gateway_connection_reference_model_json[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' - route_next_hop_vpn_gateway_connection_reference_model_json[ - 'name'] = 'my-vpn-connection' - route_next_hop_vpn_gateway_connection_reference_model_json[ - 'resource_type'] = 'vpn_gateway_connection' + route_next_hop_vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model + route_next_hop_vpn_gateway_connection_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + route_next_hop_vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + route_next_hop_vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection' + route_next_hop_vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection' # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation - route_next_hop_vpn_gateway_connection_reference_model = RouteNextHopVPNGatewayConnectionReference.from_dict( - route_next_hop_vpn_gateway_connection_reference_model_json) + route_next_hop_vpn_gateway_connection_reference_model = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json) assert route_next_hop_vpn_gateway_connection_reference_model != False # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation - route_next_hop_vpn_gateway_connection_reference_model_dict = RouteNextHopVPNGatewayConnectionReference.from_dict( - route_next_hop_vpn_gateway_connection_reference_model_json).__dict__ - route_next_hop_vpn_gateway_connection_reference_model2 = RouteNextHopVPNGatewayConnectionReference( - **route_next_hop_vpn_gateway_connection_reference_model_dict) + route_next_hop_vpn_gateway_connection_reference_model_dict = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json).__dict__ + route_next_hop_vpn_gateway_connection_reference_model2 = RouteNextHopVPNGatewayConnectionReference(**route_next_hop_vpn_gateway_connection_reference_model_dict) # Verify the model instances are equivalent assert route_next_hop_vpn_gateway_connection_reference_model == route_next_hop_vpn_gateway_connection_reference_model2 # Convert model instance back to dict and verify no loss of data - route_next_hop_vpn_gateway_connection_reference_model_json2 = route_next_hop_vpn_gateway_connection_reference_model.to_dict( - ) + route_next_hop_vpn_gateway_connection_reference_model_json2 = route_next_hop_vpn_gateway_connection_reference_model.to_dict() assert route_next_hop_vpn_gateway_connection_reference_model_json2 == route_next_hop_vpn_gateway_connection_reference_model_json - class TestRoutingTableIdentityByHref(): """ Test Class for RoutingTableIdentityByHref @@ -44416,29 +42445,23 @@ def test_routing_table_identity_by_href_serialization(self): # Construct a json representation of a RoutingTableIdentityByHref model routing_table_identity_by_href_model_json = {} - routing_table_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840' # Construct a model instance of RoutingTableIdentityByHref by calling from_dict on the json representation - routing_table_identity_by_href_model = RoutingTableIdentityByHref.from_dict( - routing_table_identity_by_href_model_json) + routing_table_identity_by_href_model = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json) assert routing_table_identity_by_href_model != False # Construct a model instance of RoutingTableIdentityByHref by calling from_dict on the json representation - routing_table_identity_by_href_model_dict = RoutingTableIdentityByHref.from_dict( - routing_table_identity_by_href_model_json).__dict__ - routing_table_identity_by_href_model2 = RoutingTableIdentityByHref( - **routing_table_identity_by_href_model_dict) + routing_table_identity_by_href_model_dict = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json).__dict__ + routing_table_identity_by_href_model2 = RoutingTableIdentityByHref(**routing_table_identity_by_href_model_dict) # Verify the model instances are equivalent assert routing_table_identity_by_href_model == routing_table_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - routing_table_identity_by_href_model_json2 = routing_table_identity_by_href_model.to_dict( - ) + routing_table_identity_by_href_model_json2 = routing_table_identity_by_href_model.to_dict() assert routing_table_identity_by_href_model_json2 == routing_table_identity_by_href_model_json - class TestRoutingTableIdentityById(): """ Test Class for RoutingTableIdentityById @@ -44451,29 +42474,23 @@ def test_routing_table_identity_by_id_serialization(self): # Construct a json representation of a RoutingTableIdentityById model routing_table_identity_by_id_model_json = {} - routing_table_identity_by_id_model_json[ - 'id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + routing_table_identity_by_id_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' # Construct a model instance of RoutingTableIdentityById by calling from_dict on the json representation - routing_table_identity_by_id_model = RoutingTableIdentityById.from_dict( - routing_table_identity_by_id_model_json) + routing_table_identity_by_id_model = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json) assert routing_table_identity_by_id_model != False # Construct a model instance of RoutingTableIdentityById by calling from_dict on the json representation - routing_table_identity_by_id_model_dict = RoutingTableIdentityById.from_dict( - routing_table_identity_by_id_model_json).__dict__ - routing_table_identity_by_id_model2 = RoutingTableIdentityById( - **routing_table_identity_by_id_model_dict) + routing_table_identity_by_id_model_dict = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json).__dict__ + routing_table_identity_by_id_model2 = RoutingTableIdentityById(**routing_table_identity_by_id_model_dict) # Verify the model instances are equivalent assert routing_table_identity_by_id_model == routing_table_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - routing_table_identity_by_id_model_json2 = routing_table_identity_by_id_model.to_dict( - ) + routing_table_identity_by_id_model_json2 = routing_table_identity_by_id_model.to_dict() assert routing_table_identity_by_id_model_json2 == routing_table_identity_by_id_model_json - class TestSecurityGroupIdentityByCRN(): """ Test Class for SecurityGroupIdentityByCRN @@ -44486,29 +42503,23 @@ def test_security_group_identity_by_crn_serialization(self): # Construct a json representation of a SecurityGroupIdentityByCRN model security_group_identity_by_crn_model_json = {} - security_group_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_identity_by_crn_model = SecurityGroupIdentityByCRN.from_dict( - security_group_identity_by_crn_model_json) + security_group_identity_by_crn_model = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json) assert security_group_identity_by_crn_model != False # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_identity_by_crn_model_dict = SecurityGroupIdentityByCRN.from_dict( - security_group_identity_by_crn_model_json).__dict__ - security_group_identity_by_crn_model2 = SecurityGroupIdentityByCRN( - **security_group_identity_by_crn_model_dict) + security_group_identity_by_crn_model_dict = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json).__dict__ + security_group_identity_by_crn_model2 = SecurityGroupIdentityByCRN(**security_group_identity_by_crn_model_dict) # Verify the model instances are equivalent assert security_group_identity_by_crn_model == security_group_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - security_group_identity_by_crn_model_json2 = security_group_identity_by_crn_model.to_dict( - ) + security_group_identity_by_crn_model_json2 = security_group_identity_by_crn_model.to_dict() assert security_group_identity_by_crn_model_json2 == security_group_identity_by_crn_model_json - class TestSecurityGroupIdentityByHref(): """ Test Class for SecurityGroupIdentityByHref @@ -44521,29 +42532,23 @@ def test_security_group_identity_by_href_serialization(self): # Construct a json representation of a SecurityGroupIdentityByHref model security_group_identity_by_href_model_json = {} - security_group_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_identity_by_href_model = SecurityGroupIdentityByHref.from_dict( - security_group_identity_by_href_model_json) + security_group_identity_by_href_model = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json) assert security_group_identity_by_href_model != False # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_identity_by_href_model_dict = SecurityGroupIdentityByHref.from_dict( - security_group_identity_by_href_model_json).__dict__ - security_group_identity_by_href_model2 = SecurityGroupIdentityByHref( - **security_group_identity_by_href_model_dict) + security_group_identity_by_href_model_dict = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json).__dict__ + security_group_identity_by_href_model2 = SecurityGroupIdentityByHref(**security_group_identity_by_href_model_dict) # Verify the model instances are equivalent assert security_group_identity_by_href_model == security_group_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - security_group_identity_by_href_model_json2 = security_group_identity_by_href_model.to_dict( - ) + security_group_identity_by_href_model_json2 = security_group_identity_by_href_model.to_dict() assert security_group_identity_by_href_model_json2 == security_group_identity_by_href_model_json - class TestSecurityGroupIdentityById(): """ Test Class for SecurityGroupIdentityById @@ -44556,193 +42561,138 @@ def test_security_group_identity_by_id_serialization(self): # Construct a json representation of a SecurityGroupIdentityById model security_group_identity_by_id_model_json = {} - security_group_identity_by_id_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_by_id_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation - security_group_identity_by_id_model = SecurityGroupIdentityById.from_dict( - security_group_identity_by_id_model_json) + security_group_identity_by_id_model = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json) assert security_group_identity_by_id_model != False # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation - security_group_identity_by_id_model_dict = SecurityGroupIdentityById.from_dict( - security_group_identity_by_id_model_json).__dict__ - security_group_identity_by_id_model2 = SecurityGroupIdentityById( - **security_group_identity_by_id_model_dict) + security_group_identity_by_id_model_dict = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json).__dict__ + security_group_identity_by_id_model2 = SecurityGroupIdentityById(**security_group_identity_by_id_model_dict) # Verify the model instances are equivalent assert security_group_identity_by_id_model == security_group_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - security_group_identity_by_id_model_json2 = security_group_identity_by_id_model.to_dict( - ) + security_group_identity_by_id_model_json2 = security_group_identity_by_id_model.to_dict() assert security_group_identity_by_id_model_json2 == security_group_identity_by_id_model_json - class TestSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(): """ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll """ - def test_security_group_rule_prototype_security_group_rule_protocol_all_serialization( - self): + def test_security_group_rule_prototype_security_group_rule_protocol_all_serialization(self): """ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_prototype_model = { - } # SecurityGroupRuleRemotePrototypeIP + security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP security_group_rule_remote_prototype_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model security_group_rule_prototype_security_group_rule_protocol_all_model_json = {} - security_group_rule_prototype_security_group_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - security_group_rule_prototype_security_group_rule_protocol_all_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_prototype_security_group_rule_protocol_all_model_json[ - 'remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_security_group_rule_protocol_all_model_json[ - 'protocol'] = 'all' + security_group_rule_prototype_security_group_rule_protocol_all_model_json['direction'] = 'inbound' + security_group_rule_prototype_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4' + security_group_rule_prototype_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_security_group_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_all_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict( - security_group_rule_prototype_security_group_rule_protocol_all_model_json - ) + security_group_rule_prototype_security_group_rule_protocol_all_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json) assert security_group_rule_prototype_security_group_rule_protocol_all_model != False # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_all_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict( - security_group_rule_prototype_security_group_rule_protocol_all_model_json - ).__dict__ - security_group_rule_prototype_security_group_rule_protocol_all_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll( - ** - security_group_rule_prototype_security_group_rule_protocol_all_model_dict - ) + security_group_rule_prototype_security_group_rule_protocol_all_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json).__dict__ + security_group_rule_prototype_security_group_rule_protocol_all_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(**security_group_rule_prototype_security_group_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert security_group_rule_prototype_security_group_rule_protocol_all_model == security_group_rule_prototype_security_group_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_prototype_security_group_rule_protocol_all_model_json2 = security_group_rule_prototype_security_group_rule_protocol_all_model.to_dict( - ) + security_group_rule_prototype_security_group_rule_protocol_all_model_json2 = security_group_rule_prototype_security_group_rule_protocol_all_model.to_dict() assert security_group_rule_prototype_security_group_rule_protocol_all_model_json2 == security_group_rule_prototype_security_group_rule_protocol_all_model_json - class TestSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(): """ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP """ - def test_security_group_rule_prototype_security_group_rule_protocol_icmp_serialization( - self): + def test_security_group_rule_prototype_security_group_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_prototype_model = { - } # SecurityGroupRuleRemotePrototypeIP + security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP security_group_rule_remote_prototype_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model security_group_rule_prototype_security_group_rule_protocol_icmp_model_json = {} - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'code'] = 0 - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json[ - 'type'] = 8 + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound' + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['code'] = 0 + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp' + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_icmp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict( - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json - ) + security_group_rule_prototype_security_group_rule_protocol_icmp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json) assert security_group_rule_prototype_security_group_rule_protocol_icmp_model != False # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict( - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json - ).__dict__ - security_group_rule_prototype_security_group_rule_protocol_icmp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP( - ** - security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict - ) + security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json).__dict__ + security_group_rule_prototype_security_group_rule_protocol_icmp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(**security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert security_group_rule_prototype_security_group_rule_protocol_icmp_model == security_group_rule_prototype_security_group_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_icmp_model.to_dict( - ) + security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_icmp_model.to_dict() assert security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_icmp_model_json - class TestSecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(): """ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP """ - def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_serialization( - self): + def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_prototype_model = { - } # SecurityGroupRuleRemotePrototypeIP + security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP security_group_rule_remote_prototype_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP model security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json = {} - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'port_max'] = 22 - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'port_min'] = 22 - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_prototype_model + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22 + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22 + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp' # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict( - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json - ) + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json) assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model != False # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict( - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json - ).__dict__ - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP( - ** - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict - ) + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json).__dict__ + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(**security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_tcpudp_model.to_dict( - ) + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_tcpudp_model.to_dict() assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json - class TestSecurityGroupRuleRemotePatchCIDR(): """ Test Class for SecurityGroupRuleRemotePatchCIDR @@ -44755,29 +42705,23 @@ def test_security_group_rule_remote_patch_cidr_serialization(self): # Construct a json representation of a SecurityGroupRuleRemotePatchCIDR model security_group_rule_remote_patch_cidr_model_json = {} - security_group_rule_remote_patch_cidr_model_json[ - 'cidr_block'] = '192.168.3.0/24' + security_group_rule_remote_patch_cidr_model_json['cidr_block'] = '192.168.3.0/24' # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation - security_group_rule_remote_patch_cidr_model = SecurityGroupRuleRemotePatchCIDR.from_dict( - security_group_rule_remote_patch_cidr_model_json) + security_group_rule_remote_patch_cidr_model = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json) assert security_group_rule_remote_patch_cidr_model != False # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation - security_group_rule_remote_patch_cidr_model_dict = SecurityGroupRuleRemotePatchCIDR.from_dict( - security_group_rule_remote_patch_cidr_model_json).__dict__ - security_group_rule_remote_patch_cidr_model2 = SecurityGroupRuleRemotePatchCIDR( - **security_group_rule_remote_patch_cidr_model_dict) + security_group_rule_remote_patch_cidr_model_dict = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json).__dict__ + security_group_rule_remote_patch_cidr_model2 = SecurityGroupRuleRemotePatchCIDR(**security_group_rule_remote_patch_cidr_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_patch_cidr_model == security_group_rule_remote_patch_cidr_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_patch_cidr_model_json2 = security_group_rule_remote_patch_cidr_model.to_dict( - ) + security_group_rule_remote_patch_cidr_model_json2 = security_group_rule_remote_patch_cidr_model.to_dict() assert security_group_rule_remote_patch_cidr_model_json2 == security_group_rule_remote_patch_cidr_model_json - class TestSecurityGroupRuleRemotePatchIP(): """ Test Class for SecurityGroupRuleRemotePatchIP @@ -44790,29 +42734,23 @@ def test_security_group_rule_remote_patch_ip_serialization(self): # Construct a json representation of a SecurityGroupRuleRemotePatchIP model security_group_rule_remote_patch_ip_model_json = {} - security_group_rule_remote_patch_ip_model_json[ - 'address'] = '192.168.3.4' + security_group_rule_remote_patch_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation - security_group_rule_remote_patch_ip_model = SecurityGroupRuleRemotePatchIP.from_dict( - security_group_rule_remote_patch_ip_model_json) + security_group_rule_remote_patch_ip_model = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json) assert security_group_rule_remote_patch_ip_model != False # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation - security_group_rule_remote_patch_ip_model_dict = SecurityGroupRuleRemotePatchIP.from_dict( - security_group_rule_remote_patch_ip_model_json).__dict__ - security_group_rule_remote_patch_ip_model2 = SecurityGroupRuleRemotePatchIP( - **security_group_rule_remote_patch_ip_model_dict) + security_group_rule_remote_patch_ip_model_dict = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json).__dict__ + security_group_rule_remote_patch_ip_model2 = SecurityGroupRuleRemotePatchIP(**security_group_rule_remote_patch_ip_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_patch_ip_model == security_group_rule_remote_patch_ip_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_patch_ip_model_json2 = security_group_rule_remote_patch_ip_model.to_dict( - ) + security_group_rule_remote_patch_ip_model_json2 = security_group_rule_remote_patch_ip_model.to_dict() assert security_group_rule_remote_patch_ip_model_json2 == security_group_rule_remote_patch_ip_model_json - class TestSecurityGroupRuleRemotePrototypeCIDR(): """ Test Class for SecurityGroupRuleRemotePrototypeCIDR @@ -44825,29 +42763,23 @@ def test_security_group_rule_remote_prototype_cidr_serialization(self): # Construct a json representation of a SecurityGroupRuleRemotePrototypeCIDR model security_group_rule_remote_prototype_cidr_model_json = {} - security_group_rule_remote_prototype_cidr_model_json[ - 'cidr_block'] = '192.168.3.0/24' + security_group_rule_remote_prototype_cidr_model_json['cidr_block'] = '192.168.3.0/24' # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation - security_group_rule_remote_prototype_cidr_model = SecurityGroupRuleRemotePrototypeCIDR.from_dict( - security_group_rule_remote_prototype_cidr_model_json) + security_group_rule_remote_prototype_cidr_model = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json) assert security_group_rule_remote_prototype_cidr_model != False # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation - security_group_rule_remote_prototype_cidr_model_dict = SecurityGroupRuleRemotePrototypeCIDR.from_dict( - security_group_rule_remote_prototype_cidr_model_json).__dict__ - security_group_rule_remote_prototype_cidr_model2 = SecurityGroupRuleRemotePrototypeCIDR( - **security_group_rule_remote_prototype_cidr_model_dict) + security_group_rule_remote_prototype_cidr_model_dict = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json).__dict__ + security_group_rule_remote_prototype_cidr_model2 = SecurityGroupRuleRemotePrototypeCIDR(**security_group_rule_remote_prototype_cidr_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_prototype_cidr_model == security_group_rule_remote_prototype_cidr_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_prototype_cidr_model_json2 = security_group_rule_remote_prototype_cidr_model.to_dict( - ) + security_group_rule_remote_prototype_cidr_model_json2 = security_group_rule_remote_prototype_cidr_model.to_dict() assert security_group_rule_remote_prototype_cidr_model_json2 == security_group_rule_remote_prototype_cidr_model_json - class TestSecurityGroupRuleRemotePrototypeIP(): """ Test Class for SecurityGroupRuleRemotePrototypeIP @@ -44860,29 +42792,23 @@ def test_security_group_rule_remote_prototype_ip_serialization(self): # Construct a json representation of a SecurityGroupRuleRemotePrototypeIP model security_group_rule_remote_prototype_ip_model_json = {} - security_group_rule_remote_prototype_ip_model_json[ - 'address'] = '192.168.3.4' + security_group_rule_remote_prototype_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation - security_group_rule_remote_prototype_ip_model = SecurityGroupRuleRemotePrototypeIP.from_dict( - security_group_rule_remote_prototype_ip_model_json) + security_group_rule_remote_prototype_ip_model = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json) assert security_group_rule_remote_prototype_ip_model != False # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation - security_group_rule_remote_prototype_ip_model_dict = SecurityGroupRuleRemotePrototypeIP.from_dict( - security_group_rule_remote_prototype_ip_model_json).__dict__ - security_group_rule_remote_prototype_ip_model2 = SecurityGroupRuleRemotePrototypeIP( - **security_group_rule_remote_prototype_ip_model_dict) + security_group_rule_remote_prototype_ip_model_dict = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json).__dict__ + security_group_rule_remote_prototype_ip_model2 = SecurityGroupRuleRemotePrototypeIP(**security_group_rule_remote_prototype_ip_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_prototype_ip_model == security_group_rule_remote_prototype_ip_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_prototype_ip_model_json2 = security_group_rule_remote_prototype_ip_model.to_dict( - ) + security_group_rule_remote_prototype_ip_model_json2 = security_group_rule_remote_prototype_ip_model.to_dict() assert security_group_rule_remote_prototype_ip_model_json2 == security_group_rule_remote_prototype_ip_model_json - class TestSecurityGroupRuleRemoteCIDR(): """ Test Class for SecurityGroupRuleRemoteCIDR @@ -44895,29 +42821,23 @@ def test_security_group_rule_remote_cidr_serialization(self): # Construct a json representation of a SecurityGroupRuleRemoteCIDR model security_group_rule_remote_cidr_model_json = {} - security_group_rule_remote_cidr_model_json[ - 'cidr_block'] = '192.168.3.0/24' + security_group_rule_remote_cidr_model_json['cidr_block'] = '192.168.3.0/24' # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation - security_group_rule_remote_cidr_model = SecurityGroupRuleRemoteCIDR.from_dict( - security_group_rule_remote_cidr_model_json) + security_group_rule_remote_cidr_model = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json) assert security_group_rule_remote_cidr_model != False # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation - security_group_rule_remote_cidr_model_dict = SecurityGroupRuleRemoteCIDR.from_dict( - security_group_rule_remote_cidr_model_json).__dict__ - security_group_rule_remote_cidr_model2 = SecurityGroupRuleRemoteCIDR( - **security_group_rule_remote_cidr_model_dict) + security_group_rule_remote_cidr_model_dict = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json).__dict__ + security_group_rule_remote_cidr_model2 = SecurityGroupRuleRemoteCIDR(**security_group_rule_remote_cidr_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_cidr_model == security_group_rule_remote_cidr_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_cidr_model_json2 = security_group_rule_remote_cidr_model.to_dict( - ) + security_group_rule_remote_cidr_model_json2 = security_group_rule_remote_cidr_model.to_dict() assert security_group_rule_remote_cidr_model_json2 == security_group_rule_remote_cidr_model_json - class TestSecurityGroupRuleRemoteIP(): """ Test Class for SecurityGroupRuleRemoteIP @@ -44933,350 +42853,255 @@ def test_security_group_rule_remote_ip_serialization(self): security_group_rule_remote_ip_model_json['address'] = '192.168.3.4' # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation - security_group_rule_remote_ip_model = SecurityGroupRuleRemoteIP.from_dict( - security_group_rule_remote_ip_model_json) + security_group_rule_remote_ip_model = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json) assert security_group_rule_remote_ip_model != False # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation - security_group_rule_remote_ip_model_dict = SecurityGroupRuleRemoteIP.from_dict( - security_group_rule_remote_ip_model_json).__dict__ - security_group_rule_remote_ip_model2 = SecurityGroupRuleRemoteIP( - **security_group_rule_remote_ip_model_dict) + security_group_rule_remote_ip_model_dict = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json).__dict__ + security_group_rule_remote_ip_model2 = SecurityGroupRuleRemoteIP(**security_group_rule_remote_ip_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_ip_model == security_group_rule_remote_ip_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_ip_model_json2 = security_group_rule_remote_ip_model.to_dict( - ) + security_group_rule_remote_ip_model_json2 = security_group_rule_remote_ip_model.to_dict() assert security_group_rule_remote_ip_model_json2 == security_group_rule_remote_ip_model_json - class TestSecurityGroupRuleRemoteSecurityGroupReference(): """ Test Class for SecurityGroupRuleRemoteSecurityGroupReference """ - def test_security_group_rule_remote_security_group_reference_serialization( - self): + def test_security_group_rule_remote_security_group_reference_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemoteSecurityGroupReference """ # Construct dict forms of any model objects needed in order to build this model. - security_group_reference_deleted_model = { - } # SecurityGroupReferenceDeleted - security_group_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a SecurityGroupRuleRemoteSecurityGroupReference model security_group_rule_remote_security_group_reference_model_json = {} - security_group_rule_remote_security_group_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_rule_remote_security_group_reference_model_json[ - 'deleted'] = security_group_reference_deleted_model - security_group_rule_remote_security_group_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_rule_remote_security_group_reference_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_rule_remote_security_group_reference_model_json[ - 'name'] = 'my-security-group' + security_group_rule_remote_security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_security_group_reference_model_json['deleted'] = security_group_reference_deleted_model + security_group_rule_remote_security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_security_group_reference_model_json['name'] = 'my-security-group' # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation - security_group_rule_remote_security_group_reference_model = SecurityGroupRuleRemoteSecurityGroupReference.from_dict( - security_group_rule_remote_security_group_reference_model_json) + security_group_rule_remote_security_group_reference_model = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json) assert security_group_rule_remote_security_group_reference_model != False # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation - security_group_rule_remote_security_group_reference_model_dict = SecurityGroupRuleRemoteSecurityGroupReference.from_dict( - security_group_rule_remote_security_group_reference_model_json - ).__dict__ - security_group_rule_remote_security_group_reference_model2 = SecurityGroupRuleRemoteSecurityGroupReference( - **security_group_rule_remote_security_group_reference_model_dict) + security_group_rule_remote_security_group_reference_model_dict = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json).__dict__ + security_group_rule_remote_security_group_reference_model2 = SecurityGroupRuleRemoteSecurityGroupReference(**security_group_rule_remote_security_group_reference_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_security_group_reference_model == security_group_rule_remote_security_group_reference_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_security_group_reference_model_json2 = security_group_rule_remote_security_group_reference_model.to_dict( - ) + security_group_rule_remote_security_group_reference_model_json2 = security_group_rule_remote_security_group_reference_model.to_dict() assert security_group_rule_remote_security_group_reference_model_json2 == security_group_rule_remote_security_group_reference_model_json - class TestSecurityGroupRuleSecurityGroupRuleProtocolAll(): """ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolAll """ - def test_security_group_rule_security_group_rule_protocol_all_serialization( - self): + def test_security_group_rule_security_group_rule_protocol_all_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolAll """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolAll model security_group_rule_security_group_rule_protocol_all_model_json = {} - security_group_rule_security_group_rule_protocol_all_model_json[ - 'direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_all_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_all_model_json[ - 'id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_all_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_security_group_rule_protocol_all_model_json[ - 'remote'] = security_group_rule_remote_model - security_group_rule_security_group_rule_protocol_all_model_json[ - 'protocol'] = 'all' + security_group_rule_security_group_rule_protocol_all_model_json['direction'] = 'inbound' + security_group_rule_security_group_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_all_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4' + security_group_rule_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_model + security_group_rule_security_group_rule_protocol_all_model_json['protocol'] = 'all' # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_all_model = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict( - security_group_rule_security_group_rule_protocol_all_model_json) + security_group_rule_security_group_rule_protocol_all_model = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json) assert security_group_rule_security_group_rule_protocol_all_model != False # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_all_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict( - security_group_rule_security_group_rule_protocol_all_model_json - ).__dict__ - security_group_rule_security_group_rule_protocol_all_model2 = SecurityGroupRuleSecurityGroupRuleProtocolAll( - **security_group_rule_security_group_rule_protocol_all_model_dict) + security_group_rule_security_group_rule_protocol_all_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json).__dict__ + security_group_rule_security_group_rule_protocol_all_model2 = SecurityGroupRuleSecurityGroupRuleProtocolAll(**security_group_rule_security_group_rule_protocol_all_model_dict) # Verify the model instances are equivalent assert security_group_rule_security_group_rule_protocol_all_model == security_group_rule_security_group_rule_protocol_all_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_security_group_rule_protocol_all_model_json2 = security_group_rule_security_group_rule_protocol_all_model.to_dict( - ) + security_group_rule_security_group_rule_protocol_all_model_json2 = security_group_rule_security_group_rule_protocol_all_model.to_dict() assert security_group_rule_security_group_rule_protocol_all_model_json2 == security_group_rule_security_group_rule_protocol_all_model_json - class TestSecurityGroupRuleSecurityGroupRuleProtocolICMP(): """ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolICMP """ - def test_security_group_rule_security_group_rule_protocol_icmp_serialization( - self): + def test_security_group_rule_security_group_rule_protocol_icmp_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolICMP """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolICMP model security_group_rule_security_group_rule_protocol_icmp_model_json = {} - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'remote'] = security_group_rule_remote_model - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'code'] = 0 - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'protocol'] = 'icmp' - security_group_rule_security_group_rule_protocol_icmp_model_json[ - 'type'] = 8 + security_group_rule_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound' + security_group_rule_security_group_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_icmp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' + security_group_rule_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_model + security_group_rule_security_group_rule_protocol_icmp_model_json['code'] = 0 + security_group_rule_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp' + security_group_rule_security_group_rule_protocol_icmp_model_json['type'] = 8 # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_icmp_model = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict( - security_group_rule_security_group_rule_protocol_icmp_model_json) + security_group_rule_security_group_rule_protocol_icmp_model = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json) assert security_group_rule_security_group_rule_protocol_icmp_model != False # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_icmp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict( - security_group_rule_security_group_rule_protocol_icmp_model_json - ).__dict__ - security_group_rule_security_group_rule_protocol_icmp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolICMP( - **security_group_rule_security_group_rule_protocol_icmp_model_dict) + security_group_rule_security_group_rule_protocol_icmp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json).__dict__ + security_group_rule_security_group_rule_protocol_icmp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolICMP(**security_group_rule_security_group_rule_protocol_icmp_model_dict) # Verify the model instances are equivalent assert security_group_rule_security_group_rule_protocol_icmp_model == security_group_rule_security_group_rule_protocol_icmp_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_security_group_rule_protocol_icmp_model_json2 = security_group_rule_security_group_rule_protocol_icmp_model.to_dict( - ) + security_group_rule_security_group_rule_protocol_icmp_model_json2 = security_group_rule_security_group_rule_protocol_icmp_model.to_dict() assert security_group_rule_security_group_rule_protocol_icmp_model_json2 == security_group_rule_security_group_rule_protocol_icmp_model_json - class TestSecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(): """ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP """ - def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization( - self): + def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP """ # Construct dict forms of any model objects needed in order to build this model. - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP security_group_rule_remote_model['address'] = '192.168.3.4' # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP model security_group_rule_security_group_rule_protocol_tcpudp_model_json = {} - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'ip_version'] = 'ipv4' - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'remote'] = security_group_rule_remote_model - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'port_max'] = 22 - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'port_min'] = 22 - security_group_rule_security_group_rule_protocol_tcpudp_model_json[ - 'protocol'] = 'udp' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_model + security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22 + security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22 + security_group_rule_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp' # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_tcpudp_model = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict( - security_group_rule_security_group_rule_protocol_tcpudp_model_json) + security_group_rule_security_group_rule_protocol_tcpudp_model = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json) assert security_group_rule_security_group_rule_protocol_tcpudp_model != False # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation - security_group_rule_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict( - security_group_rule_security_group_rule_protocol_tcpudp_model_json - ).__dict__ - security_group_rule_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP( - ** - security_group_rule_security_group_rule_protocol_tcpudp_model_dict) + security_group_rule_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json).__dict__ + security_group_rule_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(**security_group_rule_security_group_rule_protocol_tcpudp_model_dict) # Verify the model instances are equivalent assert security_group_rule_security_group_rule_protocol_tcpudp_model == security_group_rule_security_group_rule_protocol_tcpudp_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_security_group_rule_protocol_tcpudp_model.to_dict( - ) + security_group_rule_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_security_group_rule_protocol_tcpudp_model.to_dict() assert security_group_rule_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_security_group_rule_protocol_tcpudp_model_json - class TestSecurityGroupTargetReferenceLoadBalancerReference(): """ Test Class for SecurityGroupTargetReferenceLoadBalancerReference """ - def test_security_group_target_reference_load_balancer_reference_serialization( - self): + def test_security_group_target_reference_load_balancer_reference_serialization(self): """ Test serialization/deserialization for SecurityGroupTargetReferenceLoadBalancerReference """ # Construct dict forms of any model objects needed in order to build this model. - load_balancer_reference_deleted_model = { - } # LoadBalancerReferenceDeleted - load_balancer_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted + load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a SecurityGroupTargetReferenceLoadBalancerReference model security_group_target_reference_load_balancer_reference_model_json = {} - security_group_target_reference_load_balancer_reference_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - security_group_target_reference_load_balancer_reference_model_json[ - 'deleted'] = load_balancer_reference_deleted_model - security_group_target_reference_load_balancer_reference_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - security_group_target_reference_load_balancer_reference_model_json[ - 'id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - security_group_target_reference_load_balancer_reference_model_json[ - 'name'] = 'my-load-balancer' + security_group_target_reference_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + security_group_target_reference_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model + security_group_target_reference_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + security_group_target_reference_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + security_group_target_reference_load_balancer_reference_model_json['name'] = 'my-load-balancer' # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation - security_group_target_reference_load_balancer_reference_model = SecurityGroupTargetReferenceLoadBalancerReference.from_dict( - security_group_target_reference_load_balancer_reference_model_json) + security_group_target_reference_load_balancer_reference_model = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json) assert security_group_target_reference_load_balancer_reference_model != False # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation - security_group_target_reference_load_balancer_reference_model_dict = SecurityGroupTargetReferenceLoadBalancerReference.from_dict( - security_group_target_reference_load_balancer_reference_model_json - ).__dict__ - security_group_target_reference_load_balancer_reference_model2 = SecurityGroupTargetReferenceLoadBalancerReference( - ** - security_group_target_reference_load_balancer_reference_model_dict) + security_group_target_reference_load_balancer_reference_model_dict = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json).__dict__ + security_group_target_reference_load_balancer_reference_model2 = SecurityGroupTargetReferenceLoadBalancerReference(**security_group_target_reference_load_balancer_reference_model_dict) # Verify the model instances are equivalent assert security_group_target_reference_load_balancer_reference_model == security_group_target_reference_load_balancer_reference_model2 # Convert model instance back to dict and verify no loss of data - security_group_target_reference_load_balancer_reference_model_json2 = security_group_target_reference_load_balancer_reference_model.to_dict( - ) + security_group_target_reference_load_balancer_reference_model_json2 = security_group_target_reference_load_balancer_reference_model.to_dict() assert security_group_target_reference_load_balancer_reference_model_json2 == security_group_target_reference_load_balancer_reference_model_json - class TestSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(): """ Test Class for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext """ - def test_security_group_target_reference_network_interface_reference_target_context_serialization( - self): + def test_security_group_target_reference_network_interface_reference_target_context_serialization(self): """ Test serialization/deserialization for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext """ # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_target_context_deleted_model = { - } # NetworkInterfaceReferenceTargetContextDeleted - network_interface_reference_target_context_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' # Construct a json representation of a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext model security_group_target_reference_network_interface_reference_target_context_model_json = {} - security_group_target_reference_network_interface_reference_target_context_model_json[ - 'deleted'] = network_interface_reference_target_context_deleted_model - security_group_target_reference_network_interface_reference_target_context_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_network_interface_reference_target_context_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_network_interface_reference_target_context_model_json[ - 'name'] = 'my-network-interface' - security_group_target_reference_network_interface_reference_target_context_model_json[ - 'resource_type'] = 'network_interface' + security_group_target_reference_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model + security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + security_group_target_reference_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation - security_group_target_reference_network_interface_reference_target_context_model = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict( - security_group_target_reference_network_interface_reference_target_context_model_json - ) + security_group_target_reference_network_interface_reference_target_context_model = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json) assert security_group_target_reference_network_interface_reference_target_context_model != False # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation - security_group_target_reference_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict( - security_group_target_reference_network_interface_reference_target_context_model_json - ).__dict__ - security_group_target_reference_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext( - ** - security_group_target_reference_network_interface_reference_target_context_model_dict - ) + security_group_target_reference_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json).__dict__ + security_group_target_reference_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(**security_group_target_reference_network_interface_reference_target_context_model_dict) # Verify the model instances are equivalent assert security_group_target_reference_network_interface_reference_target_context_model == security_group_target_reference_network_interface_reference_target_context_model2 # Convert model instance back to dict and verify no loss of data - security_group_target_reference_network_interface_reference_target_context_model_json2 = security_group_target_reference_network_interface_reference_target_context_model.to_dict( - ) + security_group_target_reference_network_interface_reference_target_context_model_json2 = security_group_target_reference_network_interface_reference_target_context_model.to_dict() assert security_group_target_reference_network_interface_reference_target_context_model_json2 == security_group_target_reference_network_interface_reference_target_context_model_json - class TestSubnetIdentityByCRN(): """ Test Class for SubnetIdentityByCRN @@ -45289,29 +43114,23 @@ def test_subnet_identity_by_crn_serialization(self): # Construct a json representation of a SubnetIdentityByCRN model subnet_identity_by_crn_model_json = {} - subnet_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation - subnet_identity_by_crn_model = SubnetIdentityByCRN.from_dict( - subnet_identity_by_crn_model_json) + subnet_identity_by_crn_model = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json) assert subnet_identity_by_crn_model != False # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation - subnet_identity_by_crn_model_dict = SubnetIdentityByCRN.from_dict( - subnet_identity_by_crn_model_json).__dict__ - subnet_identity_by_crn_model2 = SubnetIdentityByCRN( - **subnet_identity_by_crn_model_dict) + subnet_identity_by_crn_model_dict = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json).__dict__ + subnet_identity_by_crn_model2 = SubnetIdentityByCRN(**subnet_identity_by_crn_model_dict) # Verify the model instances are equivalent assert subnet_identity_by_crn_model == subnet_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - subnet_identity_by_crn_model_json2 = subnet_identity_by_crn_model.to_dict( - ) + subnet_identity_by_crn_model_json2 = subnet_identity_by_crn_model.to_dict() assert subnet_identity_by_crn_model_json2 == subnet_identity_by_crn_model_json - class TestSubnetIdentityByHref(): """ Test Class for SubnetIdentityByHref @@ -45324,29 +43143,23 @@ def test_subnet_identity_by_href_serialization(self): # Construct a json representation of a SubnetIdentityByHref model subnet_identity_by_href_model_json = {} - subnet_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation - subnet_identity_by_href_model = SubnetIdentityByHref.from_dict( - subnet_identity_by_href_model_json) + subnet_identity_by_href_model = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json) assert subnet_identity_by_href_model != False # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation - subnet_identity_by_href_model_dict = SubnetIdentityByHref.from_dict( - subnet_identity_by_href_model_json).__dict__ - subnet_identity_by_href_model2 = SubnetIdentityByHref( - **subnet_identity_by_href_model_dict) + subnet_identity_by_href_model_dict = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json).__dict__ + subnet_identity_by_href_model2 = SubnetIdentityByHref(**subnet_identity_by_href_model_dict) # Verify the model instances are equivalent assert subnet_identity_by_href_model == subnet_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - subnet_identity_by_href_model_json2 = subnet_identity_by_href_model.to_dict( - ) + subnet_identity_by_href_model_json2 = subnet_identity_by_href_model.to_dict() assert subnet_identity_by_href_model_json2 == subnet_identity_by_href_model_json - class TestSubnetIdentityById(): """ Test Class for SubnetIdentityById @@ -45359,29 +43172,23 @@ def test_subnet_identity_by_id_serialization(self): # Construct a json representation of a SubnetIdentityById model subnet_identity_by_id_model_json = {} - subnet_identity_by_id_model_json[ - 'id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation - subnet_identity_by_id_model = SubnetIdentityById.from_dict( - subnet_identity_by_id_model_json) + subnet_identity_by_id_model = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json) assert subnet_identity_by_id_model != False # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation - subnet_identity_by_id_model_dict = SubnetIdentityById.from_dict( - subnet_identity_by_id_model_json).__dict__ - subnet_identity_by_id_model2 = SubnetIdentityById( - **subnet_identity_by_id_model_dict) + subnet_identity_by_id_model_dict = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json).__dict__ + subnet_identity_by_id_model2 = SubnetIdentityById(**subnet_identity_by_id_model_dict) # Verify the model instances are equivalent assert subnet_identity_by_id_model == subnet_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - subnet_identity_by_id_model_json2 = subnet_identity_by_id_model.to_dict( - ) + subnet_identity_by_id_model_json2 = subnet_identity_by_id_model.to_dict() assert subnet_identity_by_id_model_json2 == subnet_identity_by_id_model_json - class TestSubnetPrototypeSubnetByCIDR(): """ Test Class for SubnetPrototypeSubnetByCIDR @@ -45394,64 +43201,51 @@ def test_subnet_prototype_subnet_by_cidr_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_identity_model = {} # NetworkACLIdentityById - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model = {} # NetworkACLIdentityById + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' - public_gateway_identity_model = {} # PublicGatewayIdentityById - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model = {} # PublicGatewayIdentityById + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - routing_table_identity_model = {} # RoutingTableIdentityById - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model = {} # RoutingTableIdentityById + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' - vpc_identity_model = {} # VPCIdentityById + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a SubnetPrototypeSubnetByCIDR model subnet_prototype_subnet_by_cidr_model_json = {} subnet_prototype_subnet_by_cidr_model_json['ip_version'] = 'ipv4' subnet_prototype_subnet_by_cidr_model_json['name'] = 'my-subnet' - subnet_prototype_subnet_by_cidr_model_json[ - 'network_acl'] = network_acl_identity_model - subnet_prototype_subnet_by_cidr_model_json[ - 'public_gateway'] = public_gateway_identity_model - subnet_prototype_subnet_by_cidr_model_json[ - 'resource_group'] = resource_group_identity_model - subnet_prototype_subnet_by_cidr_model_json[ - 'routing_table'] = routing_table_identity_model + subnet_prototype_subnet_by_cidr_model_json['network_acl'] = network_acl_identity_model + subnet_prototype_subnet_by_cidr_model_json['public_gateway'] = public_gateway_identity_model + subnet_prototype_subnet_by_cidr_model_json['resource_group'] = resource_group_identity_model + subnet_prototype_subnet_by_cidr_model_json['routing_table'] = routing_table_identity_model subnet_prototype_subnet_by_cidr_model_json['vpc'] = vpc_identity_model - subnet_prototype_subnet_by_cidr_model_json[ - 'ipv4_cidr_block'] = '10.0.0.0/24' + subnet_prototype_subnet_by_cidr_model_json['ipv4_cidr_block'] = '10.0.0.0/24' subnet_prototype_subnet_by_cidr_model_json['zone'] = zone_identity_model # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation - subnet_prototype_subnet_by_cidr_model = SubnetPrototypeSubnetByCIDR.from_dict( - subnet_prototype_subnet_by_cidr_model_json) + subnet_prototype_subnet_by_cidr_model = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json) assert subnet_prototype_subnet_by_cidr_model != False # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation - subnet_prototype_subnet_by_cidr_model_dict = SubnetPrototypeSubnetByCIDR.from_dict( - subnet_prototype_subnet_by_cidr_model_json).__dict__ - subnet_prototype_subnet_by_cidr_model2 = SubnetPrototypeSubnetByCIDR( - **subnet_prototype_subnet_by_cidr_model_dict) + subnet_prototype_subnet_by_cidr_model_dict = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json).__dict__ + subnet_prototype_subnet_by_cidr_model2 = SubnetPrototypeSubnetByCIDR(**subnet_prototype_subnet_by_cidr_model_dict) # Verify the model instances are equivalent assert subnet_prototype_subnet_by_cidr_model == subnet_prototype_subnet_by_cidr_model2 # Convert model instance back to dict and verify no loss of data - subnet_prototype_subnet_by_cidr_model_json2 = subnet_prototype_subnet_by_cidr_model.to_dict( - ) + subnet_prototype_subnet_by_cidr_model_json2 = subnet_prototype_subnet_by_cidr_model.to_dict() assert subnet_prototype_subnet_by_cidr_model_json2 == subnet_prototype_subnet_by_cidr_model_json - class TestSubnetPrototypeSubnetByTotalCount(): """ Test Class for SubnetPrototypeSubnetByTotalCount @@ -45464,66 +43258,51 @@ def test_subnet_prototype_subnet_by_total_count_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_identity_model = {} # NetworkACLIdentityById - network_acl_identity_model[ - 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_identity_model = {} # NetworkACLIdentityById + network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' - public_gateway_identity_model = {} # PublicGatewayIdentityById - public_gateway_identity_model[ - 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' + public_gateway_identity_model = {} # PublicGatewayIdentityById + public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - routing_table_identity_model = {} # RoutingTableIdentityById - routing_table_identity_model[ - 'id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' + routing_table_identity_model = {} # RoutingTableIdentityById + routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840' - vpc_identity_model = {} # VPCIdentityById + vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' # Construct a json representation of a SubnetPrototypeSubnetByTotalCount model subnet_prototype_subnet_by_total_count_model_json = {} subnet_prototype_subnet_by_total_count_model_json['ip_version'] = 'ipv4' subnet_prototype_subnet_by_total_count_model_json['name'] = 'my-subnet' - subnet_prototype_subnet_by_total_count_model_json[ - 'network_acl'] = network_acl_identity_model - subnet_prototype_subnet_by_total_count_model_json[ - 'public_gateway'] = public_gateway_identity_model - subnet_prototype_subnet_by_total_count_model_json[ - 'resource_group'] = resource_group_identity_model - subnet_prototype_subnet_by_total_count_model_json[ - 'routing_table'] = routing_table_identity_model - subnet_prototype_subnet_by_total_count_model_json[ - 'vpc'] = vpc_identity_model - subnet_prototype_subnet_by_total_count_model_json[ - 'total_ipv4_address_count'] = 256 - subnet_prototype_subnet_by_total_count_model_json[ - 'zone'] = zone_identity_model + subnet_prototype_subnet_by_total_count_model_json['network_acl'] = network_acl_identity_model + subnet_prototype_subnet_by_total_count_model_json['public_gateway'] = public_gateway_identity_model + subnet_prototype_subnet_by_total_count_model_json['resource_group'] = resource_group_identity_model + subnet_prototype_subnet_by_total_count_model_json['routing_table'] = routing_table_identity_model + subnet_prototype_subnet_by_total_count_model_json['vpc'] = vpc_identity_model + subnet_prototype_subnet_by_total_count_model_json['total_ipv4_address_count'] = 256 + subnet_prototype_subnet_by_total_count_model_json['zone'] = zone_identity_model # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation - subnet_prototype_subnet_by_total_count_model = SubnetPrototypeSubnetByTotalCount.from_dict( - subnet_prototype_subnet_by_total_count_model_json) + subnet_prototype_subnet_by_total_count_model = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json) assert subnet_prototype_subnet_by_total_count_model != False # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation - subnet_prototype_subnet_by_total_count_model_dict = SubnetPrototypeSubnetByTotalCount.from_dict( - subnet_prototype_subnet_by_total_count_model_json).__dict__ - subnet_prototype_subnet_by_total_count_model2 = SubnetPrototypeSubnetByTotalCount( - **subnet_prototype_subnet_by_total_count_model_dict) + subnet_prototype_subnet_by_total_count_model_dict = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json).__dict__ + subnet_prototype_subnet_by_total_count_model2 = SubnetPrototypeSubnetByTotalCount(**subnet_prototype_subnet_by_total_count_model_dict) # Verify the model instances are equivalent assert subnet_prototype_subnet_by_total_count_model == subnet_prototype_subnet_by_total_count_model2 # Convert model instance back to dict and verify no loss of data - subnet_prototype_subnet_by_total_count_model_json2 = subnet_prototype_subnet_by_total_count_model.to_dict( - ) + subnet_prototype_subnet_by_total_count_model_json2 = subnet_prototype_subnet_by_total_count_model.to_dict() assert subnet_prototype_subnet_by_total_count_model_json2 == subnet_prototype_subnet_by_total_count_model_json - class TestVPCIdentityByCRN(): """ Test Class for VPCIdentityByCRN @@ -45536,19 +43315,15 @@ def test_vpc_identity_by_crn_serialization(self): # Construct a json representation of a VPCIdentityByCRN model vpc_identity_by_crn_model_json = {} - vpc_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of VPCIdentityByCRN by calling from_dict on the json representation - vpc_identity_by_crn_model = VPCIdentityByCRN.from_dict( - vpc_identity_by_crn_model_json) + vpc_identity_by_crn_model = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json) assert vpc_identity_by_crn_model != False # Construct a model instance of VPCIdentityByCRN by calling from_dict on the json representation - vpc_identity_by_crn_model_dict = VPCIdentityByCRN.from_dict( - vpc_identity_by_crn_model_json).__dict__ - vpc_identity_by_crn_model2 = VPCIdentityByCRN( - **vpc_identity_by_crn_model_dict) + vpc_identity_by_crn_model_dict = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json).__dict__ + vpc_identity_by_crn_model2 = VPCIdentityByCRN(**vpc_identity_by_crn_model_dict) # Verify the model instances are equivalent assert vpc_identity_by_crn_model == vpc_identity_by_crn_model2 @@ -45557,7 +43332,6 @@ def test_vpc_identity_by_crn_serialization(self): vpc_identity_by_crn_model_json2 = vpc_identity_by_crn_model.to_dict() assert vpc_identity_by_crn_model_json2 == vpc_identity_by_crn_model_json - class TestVPCIdentityByHref(): """ Test Class for VPCIdentityByHref @@ -45570,19 +43344,15 @@ def test_vpc_identity_by_href_serialization(self): # Construct a json representation of a VPCIdentityByHref model vpc_identity_by_href_model_json = {} - vpc_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of VPCIdentityByHref by calling from_dict on the json representation - vpc_identity_by_href_model = VPCIdentityByHref.from_dict( - vpc_identity_by_href_model_json) + vpc_identity_by_href_model = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json) assert vpc_identity_by_href_model != False # Construct a model instance of VPCIdentityByHref by calling from_dict on the json representation - vpc_identity_by_href_model_dict = VPCIdentityByHref.from_dict( - vpc_identity_by_href_model_json).__dict__ - vpc_identity_by_href_model2 = VPCIdentityByHref( - **vpc_identity_by_href_model_dict) + vpc_identity_by_href_model_dict = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json).__dict__ + vpc_identity_by_href_model2 = VPCIdentityByHref(**vpc_identity_by_href_model_dict) # Verify the model instances are equivalent assert vpc_identity_by_href_model == vpc_identity_by_href_model2 @@ -45591,7 +43361,6 @@ def test_vpc_identity_by_href_serialization(self): vpc_identity_by_href_model_json2 = vpc_identity_by_href_model.to_dict() assert vpc_identity_by_href_model_json2 == vpc_identity_by_href_model_json - class TestVPCIdentityById(): """ Test Class for VPCIdentityById @@ -45604,19 +43373,15 @@ def test_vpc_identity_by_id_serialization(self): # Construct a json representation of a VPCIdentityById model vpc_identity_by_id_model_json = {} - vpc_identity_by_id_model_json[ - 'id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of VPCIdentityById by calling from_dict on the json representation - vpc_identity_by_id_model = VPCIdentityById.from_dict( - vpc_identity_by_id_model_json) + vpc_identity_by_id_model = VPCIdentityById.from_dict(vpc_identity_by_id_model_json) assert vpc_identity_by_id_model != False # Construct a model instance of VPCIdentityById by calling from_dict on the json representation - vpc_identity_by_id_model_dict = VPCIdentityById.from_dict( - vpc_identity_by_id_model_json).__dict__ - vpc_identity_by_id_model2 = VPCIdentityById( - **vpc_identity_by_id_model_dict) + vpc_identity_by_id_model_dict = VPCIdentityById.from_dict(vpc_identity_by_id_model_json).__dict__ + vpc_identity_by_id_model2 = VPCIdentityById(**vpc_identity_by_id_model_dict) # Verify the model instances are equivalent assert vpc_identity_by_id_model == vpc_identity_by_id_model2 @@ -45625,76 +43390,55 @@ def test_vpc_identity_by_id_serialization(self): vpc_identity_by_id_model_json2 = vpc_identity_by_id_model.to_dict() assert vpc_identity_by_id_model_json2 == vpc_identity_by_id_model_json - class TestVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(): """ Test Class for VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch """ - def test_vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_serialization( - self): + def test_vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_serialization(self): """ Test serialization/deserialization for VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch """ # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_prototype_model = { - } # VPNGatewayConnectionDPDPrototype + vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' vpn_gateway_connection_dpd_prototype_model['interval'] = 30 vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - ike_policy_identity_model = {} # IKEPolicyIdentityById + ike_policy_identity_model = {} # IKEPolicyIdentityById ike_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_identity_model = {} # IPsecPolicyIdentityById - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model = {} # IPsecPolicyIdentityById + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a json representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json = {} - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'admin_state_up'] = True - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'ipsec_policy'] = i_psec_policy_identity_model - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'peer_address'] = '169.21.50.5' - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json[ - 'routing_protocol'] = 'none' + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['admin_state_up'] = True + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['peer_address'] = '169.21.50.5' + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['routing_protocol'] = 'none' # Construct a model instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch by calling from_dict on the json representation - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict( - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json - ) + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict(vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json) assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model != False # Construct a model instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch by calling from_dict on the json representation - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict( - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json - ).__dict__ - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model2 = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch( - ** - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict - ) + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict(vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json).__dict__ + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model2 = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(**vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model == vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json2 = vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model.to_dict( - ) + vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json2 = vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model.to_dict() assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json2 == vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json - class TestVPNGatewayConnectionPolicyMode(): """ Test Class for VPNGatewayConnectionPolicyMode @@ -45707,236 +43451,164 @@ def test_vpn_gateway_connection_policy_mode_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD + vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD vpn_gateway_connection_dpd_model['action'] = 'restart' vpn_gateway_connection_dpd_model['interval'] = 30 vpn_gateway_connection_dpd_model['timeout'] = 120 - ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted - ike_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - ike_policy_reference_model = {} # IKEPolicyReference - ike_policy_reference_model[ - 'deleted'] = ike_policy_reference_deleted_model - ike_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - ike_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted + ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + ike_policy_reference_model = {} # IKEPolicyReference + ike_policy_reference_model['deleted'] = ike_policy_reference_deleted_model + ike_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_reference_model['name'] = 'my-ike-policy' ike_policy_reference_model['resource_type'] = 'ike_policy' - i_psec_policy_reference_deleted_model = { - } # IPsecPolicyReferenceDeleted - i_psec_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - i_psec_policy_reference_model = {} # IPsecPolicyReference - i_psec_policy_reference_model[ - 'deleted'] = i_psec_policy_reference_deleted_model - i_psec_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted + i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + i_psec_policy_reference_model = {} # IPsecPolicyReference + i_psec_policy_reference_model['deleted'] = i_psec_policy_reference_deleted_model + i_psec_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_reference_model['name'] = 'my-ipsec-policy' i_psec_policy_reference_model['resource_type'] = 'ipsec_policy' # Construct a json representation of a VPNGatewayConnectionPolicyMode model vpn_gateway_connection_policy_mode_model_json = {} vpn_gateway_connection_policy_mode_model_json['admin_state_up'] = True - vpn_gateway_connection_policy_mode_model_json[ - 'authentication_mode'] = 'psk' - vpn_gateway_connection_policy_mode_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_connection_policy_mode_model_json[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_model - vpn_gateway_connection_policy_mode_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_policy_mode_model_json[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' - vpn_gateway_connection_policy_mode_model_json[ - 'ike_policy'] = ike_policy_reference_model - vpn_gateway_connection_policy_mode_model_json[ - 'ipsec_policy'] = i_psec_policy_reference_model + vpn_gateway_connection_policy_mode_model_json['authentication_mode'] = 'psk' + vpn_gateway_connection_policy_mode_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_connection_policy_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model + vpn_gateway_connection_policy_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_policy_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_policy_mode_model_json['ike_policy'] = ike_policy_reference_model + vpn_gateway_connection_policy_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model vpn_gateway_connection_policy_mode_model_json['mode'] = 'route' - vpn_gateway_connection_policy_mode_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_policy_mode_model_json[ - 'peer_address'] = '169.21.50.5' - vpn_gateway_connection_policy_mode_model_json[ - 'psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_policy_mode_model_json[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_policy_mode_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_policy_mode_model_json['peer_address'] = '169.21.50.5' + vpn_gateway_connection_policy_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_policy_mode_model_json['resource_type'] = 'vpn_gateway_connection' vpn_gateway_connection_policy_mode_model_json['status'] = 'down' - vpn_gateway_connection_policy_mode_model_json['local_cidrs'] = [ - '192.168.1.0/24' - ] - vpn_gateway_connection_policy_mode_model_json['peer_cidrs'] = [ - '10.45.1.0/24' - ] + vpn_gateway_connection_policy_mode_model_json['local_cidrs'] = ['192.168.1.0/24'] + vpn_gateway_connection_policy_mode_model_json['peer_cidrs'] = ['10.45.1.0/24'] # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation - vpn_gateway_connection_policy_mode_model = VPNGatewayConnectionPolicyMode.from_dict( - vpn_gateway_connection_policy_mode_model_json) + vpn_gateway_connection_policy_mode_model = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json) assert vpn_gateway_connection_policy_mode_model != False # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation - vpn_gateway_connection_policy_mode_model_dict = VPNGatewayConnectionPolicyMode.from_dict( - vpn_gateway_connection_policy_mode_model_json).__dict__ - vpn_gateway_connection_policy_mode_model2 = VPNGatewayConnectionPolicyMode( - **vpn_gateway_connection_policy_mode_model_dict) + vpn_gateway_connection_policy_mode_model_dict = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json).__dict__ + vpn_gateway_connection_policy_mode_model2 = VPNGatewayConnectionPolicyMode(**vpn_gateway_connection_policy_mode_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_policy_mode_model == vpn_gateway_connection_policy_mode_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_policy_mode_model_json2 = vpn_gateway_connection_policy_mode_model.to_dict( - ) + vpn_gateway_connection_policy_mode_model_json2 = vpn_gateway_connection_policy_mode_model.to_dict() assert vpn_gateway_connection_policy_mode_model_json2 == vpn_gateway_connection_policy_mode_model_json - -class TestVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype( -): +class TestVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(): """ Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype """ - def test_vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_serialization( - self): + def test_vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_serialization(self): """ Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype """ # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_prototype_model = { - } # VPNGatewayConnectionDPDPrototype + vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' vpn_gateway_connection_dpd_prototype_model['interval'] = 30 vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - ike_policy_identity_model = {} # IKEPolicyIdentityById + ike_policy_identity_model = {} # IKEPolicyIdentityById ike_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_identity_model = {} # IPsecPolicyIdentityById - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model = {} # IPsecPolicyIdentityById + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype model vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json = {} - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'admin_state_up'] = True - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'ipsec_policy'] = i_psec_policy_identity_model - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'peer_address'] = '169.21.50.5' - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'local_cidrs'] = ['192.168.1.0/24'] - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json[ - 'peer_cidrs'] = ['10.45.1.0/24'] + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['admin_state_up'] = True + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_address'] = '169.21.50.5' + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['local_cidrs'] = ['192.168.1.0/24'] + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_cidrs'] = ['10.45.1.0/24'] # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict( - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json) assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model != False # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict( - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json - ).__dict__ - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype( - ** - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json).__dict__ + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model.to_dict( - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model.to_dict() assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json - -class TestVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( -): +class TestVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(): """ Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype """ - def test_vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_serialization( - self): + def test_vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_serialization(self): """ Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype """ # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_prototype_model = { - } # VPNGatewayConnectionDPDPrototype + vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' vpn_gateway_connection_dpd_prototype_model['interval'] = 30 vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - ike_policy_identity_model = {} # IKEPolicyIdentityById + ike_policy_identity_model = {} # IKEPolicyIdentityById ike_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_identity_model = {} # IPsecPolicyIdentityById - i_psec_policy_identity_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_identity_model = {} # IPsecPolicyIdentityById + i_psec_policy_identity_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json = {} - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'admin_state_up'] = True - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'ike_policy'] = ike_policy_identity_model - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'ipsec_policy'] = i_psec_policy_identity_model - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'peer_address'] = '169.21.50.5' - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json[ - 'routing_protocol'] = 'none' + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['admin_state_up'] = True + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ike_policy'] = ike_policy_identity_model + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ipsec_policy'] = i_psec_policy_identity_model + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['peer_address'] = '169.21.50.5' + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['routing_protocol'] = 'none' # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict( - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json) assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model != False # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict( - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json - ).__dict__ - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( - ** - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json).__dict__ + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model.to_dict( - ) + vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model.to_dict() assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json - class TestVPNGatewayConnectionStaticRouteMode(): """ Test Class for VPNGatewayConnectionStaticRouteMode @@ -45949,103 +43621,72 @@ def test_vpn_gateway_connection_static_route_mode_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD + vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD vpn_gateway_connection_dpd_model['action'] = 'restart' vpn_gateway_connection_dpd_model['interval'] = 30 vpn_gateway_connection_dpd_model['timeout'] = 120 - ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted - ike_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - ike_policy_reference_model = {} # IKEPolicyReference - ike_policy_reference_model[ - 'deleted'] = ike_policy_reference_deleted_model - ike_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - ike_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted + ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + ike_policy_reference_model = {} # IKEPolicyReference + ike_policy_reference_model['deleted'] = ike_policy_reference_deleted_model + ike_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + ike_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' ike_policy_reference_model['name'] = 'my-ike-policy' ike_policy_reference_model['resource_type'] = 'ike_policy' - i_psec_policy_reference_deleted_model = { - } # IPsecPolicyReferenceDeleted - i_psec_policy_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - i_psec_policy_reference_model = {} # IPsecPolicyReference - i_psec_policy_reference_model[ - 'deleted'] = i_psec_policy_reference_deleted_model - i_psec_policy_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' - i_psec_policy_reference_model[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted + i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + i_psec_policy_reference_model = {} # IPsecPolicyReference + i_psec_policy_reference_model['deleted'] = i_psec_policy_reference_deleted_model + i_psec_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b' + i_psec_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' i_psec_policy_reference_model['name'] = 'my-ipsec-policy' i_psec_policy_reference_model['resource_type'] = 'ipsec_policy' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - vpn_gateway_connection_static_route_mode_tunnel_model = { - } # VPNGatewayConnectionStaticRouteModeTunnel - vpn_gateway_connection_static_route_mode_tunnel_model[ - 'public_ip'] = ip_model + vpn_gateway_connection_static_route_mode_tunnel_model = {} # VPNGatewayConnectionStaticRouteModeTunnel + vpn_gateway_connection_static_route_mode_tunnel_model['public_ip'] = ip_model vpn_gateway_connection_static_route_mode_tunnel_model['status'] = 'up' # Construct a json representation of a VPNGatewayConnectionStaticRouteMode model vpn_gateway_connection_static_route_mode_model_json = {} - vpn_gateway_connection_static_route_mode_model_json[ - 'admin_state_up'] = True - vpn_gateway_connection_static_route_mode_model_json[ - 'authentication_mode'] = 'psk' - vpn_gateway_connection_static_route_mode_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_connection_static_route_mode_model_json[ - 'dead_peer_detection'] = vpn_gateway_connection_dpd_model - vpn_gateway_connection_static_route_mode_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_static_route_mode_model_json[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' - vpn_gateway_connection_static_route_mode_model_json[ - 'ike_policy'] = ike_policy_reference_model - vpn_gateway_connection_static_route_mode_model_json[ - 'ipsec_policy'] = i_psec_policy_reference_model + vpn_gateway_connection_static_route_mode_model_json['admin_state_up'] = True + vpn_gateway_connection_static_route_mode_model_json['authentication_mode'] = 'psk' + vpn_gateway_connection_static_route_mode_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_connection_static_route_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model + vpn_gateway_connection_static_route_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_static_route_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_static_route_mode_model_json['ike_policy'] = ike_policy_reference_model + vpn_gateway_connection_static_route_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model vpn_gateway_connection_static_route_mode_model_json['mode'] = 'route' - vpn_gateway_connection_static_route_mode_model_json[ - 'name'] = 'my-vpn-connection' - vpn_gateway_connection_static_route_mode_model_json[ - 'peer_address'] = '169.21.50.5' - vpn_gateway_connection_static_route_mode_model_json[ - 'psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_static_route_mode_model_json[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_static_route_mode_model_json['name'] = 'my-vpn-connection' + vpn_gateway_connection_static_route_mode_model_json['peer_address'] = '169.21.50.5' + vpn_gateway_connection_static_route_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_static_route_mode_model_json['resource_type'] = 'vpn_gateway_connection' vpn_gateway_connection_static_route_mode_model_json['status'] = 'down' - vpn_gateway_connection_static_route_mode_model_json[ - 'routing_protocol'] = 'none' - vpn_gateway_connection_static_route_mode_model_json['tunnels'] = [ - vpn_gateway_connection_static_route_mode_tunnel_model - ] + vpn_gateway_connection_static_route_mode_model_json['routing_protocol'] = 'none' + vpn_gateway_connection_static_route_mode_model_json['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model] # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation - vpn_gateway_connection_static_route_mode_model = VPNGatewayConnectionStaticRouteMode.from_dict( - vpn_gateway_connection_static_route_mode_model_json) + vpn_gateway_connection_static_route_mode_model = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json) assert vpn_gateway_connection_static_route_mode_model != False # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation - vpn_gateway_connection_static_route_mode_model_dict = VPNGatewayConnectionStaticRouteMode.from_dict( - vpn_gateway_connection_static_route_mode_model_json).__dict__ - vpn_gateway_connection_static_route_mode_model2 = VPNGatewayConnectionStaticRouteMode( - **vpn_gateway_connection_static_route_mode_model_dict) + vpn_gateway_connection_static_route_mode_model_dict = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json).__dict__ + vpn_gateway_connection_static_route_mode_model2 = VPNGatewayConnectionStaticRouteMode(**vpn_gateway_connection_static_route_mode_model_dict) # Verify the model instances are equivalent assert vpn_gateway_connection_static_route_mode_model == vpn_gateway_connection_static_route_mode_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_static_route_mode_model_json2 = vpn_gateway_connection_static_route_mode_model.to_dict( - ) + vpn_gateway_connection_static_route_mode_model_json2 = vpn_gateway_connection_static_route_mode_model.to_dict() assert vpn_gateway_connection_static_route_mode_model_json2 == vpn_gateway_connection_static_route_mode_model_json - class TestVPNGatewayPolicyMode(): """ Test Class for VPNGatewayPolicyMode @@ -46058,199 +43699,150 @@ def test_vpn_gateway_policy_mode_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - vpn_gateway_member_model = {} # VPNGatewayMember + vpn_gateway_member_model = {} # VPNGatewayMember vpn_gateway_member_model['private_ip'] = ip_model vpn_gateway_member_model['public_ip'] = ip_model vpn_gateway_member_model['role'] = 'active' vpn_gateway_member_model['status'] = 'available' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a VPNGatewayPolicyMode model vpn_gateway_policy_mode_model_json = {} - vpn_gateway_policy_mode_model_json['connections'] = [ - vpn_gateway_connection_reference_model - ] - vpn_gateway_policy_mode_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_policy_mode_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_policy_mode_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_policy_mode_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_policy_mode_model_json['members'] = [ - vpn_gateway_member_model - ] + vpn_gateway_policy_mode_model_json['connections'] = [vpn_gateway_connection_reference_model] + vpn_gateway_policy_mode_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_policy_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_policy_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_policy_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_policy_mode_model_json['members'] = [vpn_gateway_member_model] vpn_gateway_policy_mode_model_json['name'] = 'my-vpn-gateway' - vpn_gateway_policy_mode_model_json[ - 'resource_group'] = resource_group_reference_model + vpn_gateway_policy_mode_model_json['resource_group'] = resource_group_reference_model vpn_gateway_policy_mode_model_json['resource_type'] = 'vpn_gateway' vpn_gateway_policy_mode_model_json['status'] = 'available' vpn_gateway_policy_mode_model_json['subnet'] = subnet_reference_model vpn_gateway_policy_mode_model_json['mode'] = 'policy' # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation - vpn_gateway_policy_mode_model = VPNGatewayPolicyMode.from_dict( - vpn_gateway_policy_mode_model_json) + vpn_gateway_policy_mode_model = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json) assert vpn_gateway_policy_mode_model != False # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation - vpn_gateway_policy_mode_model_dict = VPNGatewayPolicyMode.from_dict( - vpn_gateway_policy_mode_model_json).__dict__ - vpn_gateway_policy_mode_model2 = VPNGatewayPolicyMode( - **vpn_gateway_policy_mode_model_dict) + vpn_gateway_policy_mode_model_dict = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json).__dict__ + vpn_gateway_policy_mode_model2 = VPNGatewayPolicyMode(**vpn_gateway_policy_mode_model_dict) # Verify the model instances are equivalent assert vpn_gateway_policy_mode_model == vpn_gateway_policy_mode_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_policy_mode_model_json2 = vpn_gateway_policy_mode_model.to_dict( - ) + vpn_gateway_policy_mode_model_json2 = vpn_gateway_policy_mode_model.to_dict() assert vpn_gateway_policy_mode_model_json2 == vpn_gateway_policy_mode_model_json - class TestVPNGatewayPrototypeVPNGatewayPolicyModePrototype(): """ Test Class for VPNGatewayPrototypeVPNGatewayPolicyModePrototype """ - def test_vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_serialization( - self): + def test_vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_serialization(self): """ Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayPolicyModePrototype """ # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a json representation of a VPNGatewayPrototypeVPNGatewayPolicyModePrototype model vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json = {} - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json[ - 'name'] = 'my-vpn-gateway' - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json[ - 'resource_group'] = resource_group_identity_model - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json[ - 'subnet'] = subnet_identity_model - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json[ - 'mode'] = 'policy' + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['name'] = 'my-vpn-gateway' + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['resource_group'] = resource_group_identity_model + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['subnet'] = subnet_identity_model + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['mode'] = 'policy' # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict( - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json) + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json) assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model != False # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict( - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json - ).__dict__ - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayPolicyModePrototype( - ** - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict) + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json).__dict__ + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayPolicyModePrototype(**vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict) # Verify the model instances are equivalent assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model.to_dict( - ) + vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model.to_dict() assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json - class TestVPNGatewayPrototypeVPNGatewayRouteModePrototype(): """ Test Class for VPNGatewayPrototypeVPNGatewayRouteModePrototype """ - def test_vpn_gateway_prototype_vpn_gateway_route_mode_prototype_serialization( - self): + def test_vpn_gateway_prototype_vpn_gateway_route_mode_prototype_serialization(self): """ Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayRouteModePrototype """ # Construct dict forms of any model objects needed in order to build this model. - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a json representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json = {} - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json[ - 'name'] = 'my-vpn-gateway' - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json[ - 'resource_group'] = resource_group_identity_model - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json[ - 'subnet'] = subnet_identity_model - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json[ - 'mode'] = 'route' + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['name'] = 'my-vpn-gateway' + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['resource_group'] = resource_group_identity_model + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['subnet'] = subnet_identity_model + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['mode'] = 'route' # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict( - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json) + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json) assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model != False # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict( - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json - ).__dict__ - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayRouteModePrototype( - **vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict) + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json).__dict__ + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayRouteModePrototype(**vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict) # Verify the model instances are equivalent assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model.to_dict( - ) + vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model.to_dict() assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json - class TestVPNGatewayRouteMode(): """ Test Class for VPNGatewayRouteMode @@ -46263,96 +43855,70 @@ def test_vpn_gateway_route_mode_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_connection_reference_deleted_model = { - } # VPNGatewayConnectionReferenceDeleted - vpn_gateway_connection_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - vpn_gateway_connection_reference_model = { - } # VPNGatewayConnectionReference - vpn_gateway_connection_reference_model[ - 'deleted'] = vpn_gateway_connection_reference_deleted_model - vpn_gateway_connection_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' - vpn_gateway_connection_reference_model[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted + vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference + vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model + vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_reference_model[ - 'resource_type'] = 'vpn_gateway_connection' + vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection' - ip_model = {} # IP + ip_model = {} # IP ip_model['address'] = '192.168.3.4' - vpn_gateway_member_model = {} # VPNGatewayMember + vpn_gateway_member_model = {} # VPNGatewayMember vpn_gateway_member_model['private_ip'] = ip_model vpn_gateway_member_model['public_ip'] = ip_model vpn_gateway_member_model['role'] = 'active' vpn_gateway_member_model['status'] = 'available' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model[ - 'href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model[ - 'id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model[ - 'more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - subnet_reference_model = {} # SubnetReference - subnet_reference_model[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' # Construct a json representation of a VPNGatewayRouteMode model vpn_gateway_route_mode_model_json = {} - vpn_gateway_route_mode_model_json['connections'] = [ - vpn_gateway_connection_reference_model - ] - vpn_gateway_route_mode_model_json[ - 'created_at'] = '2020-01-28T18:40:40.123456Z' - vpn_gateway_route_mode_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_route_mode_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_route_mode_model_json[ - 'id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - vpn_gateway_route_mode_model_json['members'] = [ - vpn_gateway_member_model - ] + vpn_gateway_route_mode_model_json['connections'] = [vpn_gateway_connection_reference_model] + vpn_gateway_route_mode_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + vpn_gateway_route_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_route_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_route_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + vpn_gateway_route_mode_model_json['members'] = [vpn_gateway_member_model] vpn_gateway_route_mode_model_json['name'] = 'my-vpn-gateway' - vpn_gateway_route_mode_model_json[ - 'resource_group'] = resource_group_reference_model + vpn_gateway_route_mode_model_json['resource_group'] = resource_group_reference_model vpn_gateway_route_mode_model_json['resource_type'] = 'vpn_gateway' vpn_gateway_route_mode_model_json['status'] = 'available' vpn_gateway_route_mode_model_json['subnet'] = subnet_reference_model vpn_gateway_route_mode_model_json['mode'] = 'route' # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation - vpn_gateway_route_mode_model = VPNGatewayRouteMode.from_dict( - vpn_gateway_route_mode_model_json) + vpn_gateway_route_mode_model = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json) assert vpn_gateway_route_mode_model != False # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation - vpn_gateway_route_mode_model_dict = VPNGatewayRouteMode.from_dict( - vpn_gateway_route_mode_model_json).__dict__ - vpn_gateway_route_mode_model2 = VPNGatewayRouteMode( - **vpn_gateway_route_mode_model_dict) + vpn_gateway_route_mode_model_dict = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json).__dict__ + vpn_gateway_route_mode_model2 = VPNGatewayRouteMode(**vpn_gateway_route_mode_model_dict) # Verify the model instances are equivalent assert vpn_gateway_route_mode_model == vpn_gateway_route_mode_model2 # Convert model instance back to dict and verify no loss of data - vpn_gateway_route_mode_model_json2 = vpn_gateway_route_mode_model.to_dict( - ) + vpn_gateway_route_mode_model_json2 = vpn_gateway_route_mode_model.to_dict() assert vpn_gateway_route_mode_model_json2 == vpn_gateway_route_mode_model_json - class TestVolumeIdentityByCRN(): """ Test Class for VolumeIdentityByCRN @@ -46365,29 +43931,23 @@ def test_volume_identity_by_crn_serialization(self): # Construct a json representation of a VolumeIdentityByCRN model volume_identity_by_crn_model_json = {} - volume_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation - volume_identity_by_crn_model = VolumeIdentityByCRN.from_dict( - volume_identity_by_crn_model_json) + volume_identity_by_crn_model = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json) assert volume_identity_by_crn_model != False # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation - volume_identity_by_crn_model_dict = VolumeIdentityByCRN.from_dict( - volume_identity_by_crn_model_json).__dict__ - volume_identity_by_crn_model2 = VolumeIdentityByCRN( - **volume_identity_by_crn_model_dict) + volume_identity_by_crn_model_dict = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json).__dict__ + volume_identity_by_crn_model2 = VolumeIdentityByCRN(**volume_identity_by_crn_model_dict) # Verify the model instances are equivalent assert volume_identity_by_crn_model == volume_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - volume_identity_by_crn_model_json2 = volume_identity_by_crn_model.to_dict( - ) + volume_identity_by_crn_model_json2 = volume_identity_by_crn_model.to_dict() assert volume_identity_by_crn_model_json2 == volume_identity_by_crn_model_json - class TestVolumeIdentityByHref(): """ Test Class for VolumeIdentityByHref @@ -46400,29 +43960,23 @@ def test_volume_identity_by_href_serialization(self): # Construct a json representation of a VolumeIdentityByHref model volume_identity_by_href_model_json = {} - volume_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation - volume_identity_by_href_model = VolumeIdentityByHref.from_dict( - volume_identity_by_href_model_json) + volume_identity_by_href_model = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json) assert volume_identity_by_href_model != False # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation - volume_identity_by_href_model_dict = VolumeIdentityByHref.from_dict( - volume_identity_by_href_model_json).__dict__ - volume_identity_by_href_model2 = VolumeIdentityByHref( - **volume_identity_by_href_model_dict) + volume_identity_by_href_model_dict = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json).__dict__ + volume_identity_by_href_model2 = VolumeIdentityByHref(**volume_identity_by_href_model_dict) # Verify the model instances are equivalent assert volume_identity_by_href_model == volume_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - volume_identity_by_href_model_json2 = volume_identity_by_href_model.to_dict( - ) + volume_identity_by_href_model_json2 = volume_identity_by_href_model.to_dict() assert volume_identity_by_href_model_json2 == volume_identity_by_href_model_json - class TestVolumeIdentityById(): """ Test Class for VolumeIdentityById @@ -46435,29 +43989,23 @@ def test_volume_identity_by_id_serialization(self): # Construct a json representation of a VolumeIdentityById model volume_identity_by_id_model_json = {} - volume_identity_by_id_model_json[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_identity_by_id_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation - volume_identity_by_id_model = VolumeIdentityById.from_dict( - volume_identity_by_id_model_json) + volume_identity_by_id_model = VolumeIdentityById.from_dict(volume_identity_by_id_model_json) assert volume_identity_by_id_model != False # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation - volume_identity_by_id_model_dict = VolumeIdentityById.from_dict( - volume_identity_by_id_model_json).__dict__ - volume_identity_by_id_model2 = VolumeIdentityById( - **volume_identity_by_id_model_dict) + volume_identity_by_id_model_dict = VolumeIdentityById.from_dict(volume_identity_by_id_model_json).__dict__ + volume_identity_by_id_model2 = VolumeIdentityById(**volume_identity_by_id_model_dict) # Verify the model instances are equivalent assert volume_identity_by_id_model == volume_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - volume_identity_by_id_model_json2 = volume_identity_by_id_model.to_dict( - ) + volume_identity_by_id_model_json2 = volume_identity_by_id_model.to_dict() assert volume_identity_by_id_model_json2 == volume_identity_by_id_model_json - class TestVolumeProfileIdentityByHref(): """ Test Class for VolumeProfileIdentityByHref @@ -46470,29 +44018,23 @@ def test_volume_profile_identity_by_href_serialization(self): # Construct a json representation of a VolumeProfileIdentityByHref model volume_profile_identity_by_href_model_json = {} - volume_profile_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' + volume_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose' # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation - volume_profile_identity_by_href_model = VolumeProfileIdentityByHref.from_dict( - volume_profile_identity_by_href_model_json) + volume_profile_identity_by_href_model = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json) assert volume_profile_identity_by_href_model != False # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation - volume_profile_identity_by_href_model_dict = VolumeProfileIdentityByHref.from_dict( - volume_profile_identity_by_href_model_json).__dict__ - volume_profile_identity_by_href_model2 = VolumeProfileIdentityByHref( - **volume_profile_identity_by_href_model_dict) + volume_profile_identity_by_href_model_dict = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json).__dict__ + volume_profile_identity_by_href_model2 = VolumeProfileIdentityByHref(**volume_profile_identity_by_href_model_dict) # Verify the model instances are equivalent assert volume_profile_identity_by_href_model == volume_profile_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_identity_by_href_model_json2 = volume_profile_identity_by_href_model.to_dict( - ) + volume_profile_identity_by_href_model_json2 = volume_profile_identity_by_href_model.to_dict() assert volume_profile_identity_by_href_model_json2 == volume_profile_identity_by_href_model_json - class TestVolumeProfileIdentityByName(): """ Test Class for VolumeProfileIdentityByName @@ -46508,25 +44050,20 @@ def test_volume_profile_identity_by_name_serialization(self): volume_profile_identity_by_name_model_json['name'] = 'general-purpose' # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation - volume_profile_identity_by_name_model = VolumeProfileIdentityByName.from_dict( - volume_profile_identity_by_name_model_json) + volume_profile_identity_by_name_model = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json) assert volume_profile_identity_by_name_model != False # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation - volume_profile_identity_by_name_model_dict = VolumeProfileIdentityByName.from_dict( - volume_profile_identity_by_name_model_json).__dict__ - volume_profile_identity_by_name_model2 = VolumeProfileIdentityByName( - **volume_profile_identity_by_name_model_dict) + volume_profile_identity_by_name_model_dict = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json).__dict__ + volume_profile_identity_by_name_model2 = VolumeProfileIdentityByName(**volume_profile_identity_by_name_model_dict) # Verify the model instances are equivalent assert volume_profile_identity_by_name_model == volume_profile_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - volume_profile_identity_by_name_model_json2 = volume_profile_identity_by_name_model.to_dict( - ) + volume_profile_identity_by_name_model_json2 = volume_profile_identity_by_name_model.to_dict() assert volume_profile_identity_by_name_model_json2 == volume_profile_identity_by_name_model_json - class TestVolumePrototypeVolumeByCapacity(): """ Test Class for VolumePrototypeVolumeByCapacity @@ -46539,53 +44076,43 @@ def test_volume_prototype_volume_by_capacity_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - zone_identity_model = {} # ZoneIdentityByName + zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + # Construct a json representation of a VolumePrototypeVolumeByCapacity model volume_prototype_volume_by_capacity_model_json = {} - volume_prototype_volume_by_capacity_model_json[ - 'encryption_key'] = encryption_key_identity_model volume_prototype_volume_by_capacity_model_json['iops'] = 10000 volume_prototype_volume_by_capacity_model_json['name'] = 'my-volume' - volume_prototype_volume_by_capacity_model_json[ - 'profile'] = volume_profile_identity_model - volume_prototype_volume_by_capacity_model_json[ - 'resource_group'] = resource_group_identity_model - volume_prototype_volume_by_capacity_model_json[ - 'zone'] = zone_identity_model + volume_prototype_volume_by_capacity_model_json['profile'] = volume_profile_identity_model + volume_prototype_volume_by_capacity_model_json['resource_group'] = resource_group_identity_model + volume_prototype_volume_by_capacity_model_json['zone'] = zone_identity_model volume_prototype_volume_by_capacity_model_json['capacity'] = 100 + volume_prototype_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation - volume_prototype_volume_by_capacity_model = VolumePrototypeVolumeByCapacity.from_dict( - volume_prototype_volume_by_capacity_model_json) + volume_prototype_volume_by_capacity_model = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json) assert volume_prototype_volume_by_capacity_model != False # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation - volume_prototype_volume_by_capacity_model_dict = VolumePrototypeVolumeByCapacity.from_dict( - volume_prototype_volume_by_capacity_model_json).__dict__ - volume_prototype_volume_by_capacity_model2 = VolumePrototypeVolumeByCapacity( - **volume_prototype_volume_by_capacity_model_dict) + volume_prototype_volume_by_capacity_model_dict = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json).__dict__ + volume_prototype_volume_by_capacity_model2 = VolumePrototypeVolumeByCapacity(**volume_prototype_volume_by_capacity_model_dict) # Verify the model instances are equivalent assert volume_prototype_volume_by_capacity_model == volume_prototype_volume_by_capacity_model2 # Convert model instance back to dict and verify no loss of data - volume_prototype_volume_by_capacity_model_json2 = volume_prototype_volume_by_capacity_model.to_dict( - ) + volume_prototype_volume_by_capacity_model_json2 = volume_prototype_volume_by_capacity_model.to_dict() assert volume_prototype_volume_by_capacity_model_json2 == volume_prototype_volume_by_capacity_model_json - class TestZoneIdentityByHref(): """ Test Class for ZoneIdentityByHref @@ -46598,29 +44125,23 @@ def test_zone_identity_by_href_serialization(self): # Construct a json representation of a ZoneIdentityByHref model zone_identity_by_href_model_json = {} - zone_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation - zone_identity_by_href_model = ZoneIdentityByHref.from_dict( - zone_identity_by_href_model_json) + zone_identity_by_href_model = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json) assert zone_identity_by_href_model != False # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation - zone_identity_by_href_model_dict = ZoneIdentityByHref.from_dict( - zone_identity_by_href_model_json).__dict__ - zone_identity_by_href_model2 = ZoneIdentityByHref( - **zone_identity_by_href_model_dict) + zone_identity_by_href_model_dict = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json).__dict__ + zone_identity_by_href_model2 = ZoneIdentityByHref(**zone_identity_by_href_model_dict) # Verify the model instances are equivalent assert zone_identity_by_href_model == zone_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - zone_identity_by_href_model_json2 = zone_identity_by_href_model.to_dict( - ) + zone_identity_by_href_model_json2 = zone_identity_by_href_model.to_dict() assert zone_identity_by_href_model_json2 == zone_identity_by_href_model_json - class TestZoneIdentityByName(): """ Test Class for ZoneIdentityByName @@ -46636,1717 +44157,1709 @@ def test_zone_identity_by_name_serialization(self): zone_identity_by_name_model_json['name'] = 'us-south-1' # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation - zone_identity_by_name_model = ZoneIdentityByName.from_dict( - zone_identity_by_name_model_json) + zone_identity_by_name_model = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json) assert zone_identity_by_name_model != False # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation - zone_identity_by_name_model_dict = ZoneIdentityByName.from_dict( - zone_identity_by_name_model_json).__dict__ - zone_identity_by_name_model2 = ZoneIdentityByName( - **zone_identity_by_name_model_dict) + zone_identity_by_name_model_dict = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json).__dict__ + zone_identity_by_name_model2 = ZoneIdentityByName(**zone_identity_by_name_model_dict) # Verify the model instances are equivalent assert zone_identity_by_name_model == zone_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - zone_identity_by_name_model_json2 = zone_identity_by_name_model.to_dict( - ) + zone_identity_by_name_model_json2 = zone_identity_by_name_model.to_dict() assert zone_identity_by_name_model_json2 == zone_identity_by_name_model_json - class TestEndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref(): """ Test Class for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref """ - def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_serialization( - self): + def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_serialization(self): """ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref """ # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref model endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json = {} - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json) assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model != False # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json - ).__dict__ - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref( - ** - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json).__dict__ + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref(**endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model.to_dict( - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model.to_dict() assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json - class TestEndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById(): """ Test Class for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById """ - def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_serialization( - self): + def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_serialization(self): """ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById """ # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json = {} - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json[ - 'id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json) assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model != False # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict( - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json - ).__dict__ - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById( - ** - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json).__dict__ + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById(**endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model.to_dict( - ) + endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model.to_dict() assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json - -class TestEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN( -): +class TestEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(): """ Test Class for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN """ - def test_endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_serialization( - self): + def test_endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_serialization(self): """ Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN """ # Construct a json representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json = {} - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json[ - 'resource_type'] = 'provider_cloud_service' - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['resource_type'] = 'provider_cloud_service' + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::' # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict( - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json - ) + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json) assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model != False # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict( - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json - ).__dict__ - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2 = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN( - ** - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict - ) + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json).__dict__ + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2 = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(**endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 = endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model.to_dict( - ) + endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 = endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model.to_dict() assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json - -class TestEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName( -): +class TestEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(): """ Test Class for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName """ - def test_endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_serialization( - self): + def test_endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_serialization(self): """ Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName """ # Construct a json representation of a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName model endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json = {} - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json[ - 'resource_type'] = 'provider_cloud_service' - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json[ - 'name'] = 'ibm-ntp-server' + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['resource_type'] = 'provider_cloud_service' + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['name'] = 'ibm-ntp-server' # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict( - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json - ) + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json) assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model != False # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict( - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json - ).__dict__ - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2 = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName( - ** - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict - ) + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json).__dict__ + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2 = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(**endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict) # Verify the model instances are equivalent assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 = endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model.to_dict( - ) + endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 = endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model.to_dict() assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json - -class TestFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN( -): +class TestFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(): """ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN """ - def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_serialization( - self): + def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN """ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN model flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json) assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json - ).__dict__ - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN( - ** - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json).__dict__ + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict( - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict() assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json - -class TestFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref( -): +class TestFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(): """ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref """ - def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_serialization( - self): + def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref """ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref model flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json) assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json - ).__dict__ - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref( - ** - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json).__dict__ + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model.to_dict( - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model.to_dict() assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json - class TestFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(): """ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById """ - def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_serialization( - self): + def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById """ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById model flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json) assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict( - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json - ).__dict__ - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById( - ** - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json).__dict__ + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model.to_dict( - ) + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model.to_dict() assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json - -class TestFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( -): +class TestFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(): """ Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ - def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_serialization( - self): + def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref """ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json = {} - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json) assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict( - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json - ).__dict__ - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref( - ** - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_dict - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json).__dict__ + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model.to_dict( - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model.to_dict() assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_href_model_json - -class TestFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById( -): +class TestFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById(): """ Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById """ - def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_serialization( - self): + def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById """ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json = {} - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json[ - 'id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json) assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict( - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json - ).__dict__ - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById( - ** - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_dict - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json).__dict__ + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model.to_dict( - ) + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model.to_dict() assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_network_interface_identity_by_id_model_json - class TestFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(): """ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN """ - def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_serialization( - self): + def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN """ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN model flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json = {} - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json) assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json - ).__dict__ - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN( - ** - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json).__dict__ + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model.to_dict( - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model.to_dict() assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json - class TestFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(): """ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref """ - def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_serialization( - self): + def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref """ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref model flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json = {} - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json) assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json - ).__dict__ - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref( - ** - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json).__dict__ + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model.to_dict( - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model.to_dict() assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json - class TestFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(): """ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById """ - def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_serialization( - self): + def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById """ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById model flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json = {} - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json[ - 'id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json) assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict( - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json - ).__dict__ - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById( - ** - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json).__dict__ + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model.to_dict( - ) + flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model.to_dict() assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json - class TestFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(): """ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN """ - def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_serialization( - self): + def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN """ # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN model flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json = {} - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json) assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json - ).__dict__ - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN( - ** - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json).__dict__ + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model.to_dict( - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model.to_dict() assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json - class TestFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(): """ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref """ - def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_serialization( - self): + def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref """ # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref model flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json = {} - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json) assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json - ).__dict__ - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref( - ** - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json).__dict__ + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model.to_dict( - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model.to_dict() assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json - class TestFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(): """ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById """ - def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_serialization( - self): + def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_serialization(self): """ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById """ # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById model flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json = {} - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json[ - 'id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json) assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model != False # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict( - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json - ).__dict__ - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById( - ** - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json).__dict__ + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict) # Verify the model instances are equivalent assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model.to_dict( - ) + flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model.to_dict() assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json +class TestInstanceGroupManagerActionScheduledActionGroup(): + """ + Test Class for InstanceGroupManagerActionScheduledActionGroup + """ + + def test_instance_group_manager_action_scheduled_action_group_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionScheduledActionGroup + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_group_group_model = {} # InstanceGroupManagerScheduledActionGroupGroup + instance_group_manager_scheduled_action_group_group_model['membership_count'] = 10 + + # Construct a json representation of a InstanceGroupManagerActionScheduledActionGroup model + instance_group_manager_action_scheduled_action_group_model_json = {} + instance_group_manager_action_scheduled_action_group_model_json['auto_delete'] = True + instance_group_manager_action_scheduled_action_group_model_json['auto_delete_timeout'] = 24 + instance_group_manager_action_scheduled_action_group_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_scheduled_action_group_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_scheduled_action_group_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_scheduled_action_group_model_json['resource_type'] = 'instance_group_manager_action' + instance_group_manager_action_scheduled_action_group_model_json['status'] = 'active' + instance_group_manager_action_scheduled_action_group_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_group_model_json['action_type'] = 'scheduled' + instance_group_manager_action_scheduled_action_group_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_scheduled_action_group_model_json['last_applied_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_group_model_json['next_run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_group_model_json['group'] = instance_group_manager_scheduled_action_group_group_model + + # Construct a model instance of InstanceGroupManagerActionScheduledActionGroup by calling from_dict on the json representation + instance_group_manager_action_scheduled_action_group_model = InstanceGroupManagerActionScheduledActionGroup.from_dict(instance_group_manager_action_scheduled_action_group_model_json) + assert instance_group_manager_action_scheduled_action_group_model != False + + # Construct a model instance of InstanceGroupManagerActionScheduledActionGroup by calling from_dict on the json representation + instance_group_manager_action_scheduled_action_group_model_dict = InstanceGroupManagerActionScheduledActionGroup.from_dict(instance_group_manager_action_scheduled_action_group_model_json).__dict__ + instance_group_manager_action_scheduled_action_group_model2 = InstanceGroupManagerActionScheduledActionGroup(**instance_group_manager_action_scheduled_action_group_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_scheduled_action_group_model == instance_group_manager_action_scheduled_action_group_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_scheduled_action_group_model_json2 = instance_group_manager_action_scheduled_action_group_model.to_dict() + assert instance_group_manager_action_scheduled_action_group_model_json2 == instance_group_manager_action_scheduled_action_group_model_json + +class TestInstanceGroupManagerActionScheduledActionManager(): + """ + Test Class for InstanceGroupManagerActionScheduledActionManager + """ + + def test_instance_group_manager_action_scheduled_action_manager_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionScheduledActionManager + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted + instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + instance_group_manager_scheduled_action_manager_manager_model = {} # InstanceGroupManagerScheduledActionManagerManagerAutoScale + instance_group_manager_scheduled_action_manager_manager_model['deleted'] = instance_group_manager_reference_deleted_model + instance_group_manager_scheduled_action_manager_manager_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + instance_group_manager_scheduled_action_manager_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_scheduled_action_manager_manager_model['name'] = 'my-instance-group-manager' + instance_group_manager_scheduled_action_manager_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_manager_manager_model['min_membership_count'] = 10 + + # Construct a json representation of a InstanceGroupManagerActionScheduledActionManager model + instance_group_manager_action_scheduled_action_manager_model_json = {} + instance_group_manager_action_scheduled_action_manager_model_json['auto_delete'] = True + instance_group_manager_action_scheduled_action_manager_model_json['auto_delete_timeout'] = 24 + instance_group_manager_action_scheduled_action_manager_model_json['created_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_manager_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_scheduled_action_manager_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_group_manager_action_scheduled_action_manager_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_scheduled_action_manager_model_json['resource_type'] = 'instance_group_manager_action' + instance_group_manager_action_scheduled_action_manager_model_json['status'] = 'active' + instance_group_manager_action_scheduled_action_manager_model_json['updated_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_manager_model_json['action_type'] = 'scheduled' + instance_group_manager_action_scheduled_action_manager_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_scheduled_action_manager_model_json['last_applied_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_manager_model_json['next_run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_scheduled_action_manager_model_json['manager'] = instance_group_manager_scheduled_action_manager_manager_model + + # Construct a model instance of InstanceGroupManagerActionScheduledActionManager by calling from_dict on the json representation + instance_group_manager_action_scheduled_action_manager_model = InstanceGroupManagerActionScheduledActionManager.from_dict(instance_group_manager_action_scheduled_action_manager_model_json) + assert instance_group_manager_action_scheduled_action_manager_model != False + + # Construct a model instance of InstanceGroupManagerActionScheduledActionManager by calling from_dict on the json representation + instance_group_manager_action_scheduled_action_manager_model_dict = InstanceGroupManagerActionScheduledActionManager.from_dict(instance_group_manager_action_scheduled_action_manager_model_json).__dict__ + instance_group_manager_action_scheduled_action_manager_model2 = InstanceGroupManagerActionScheduledActionManager(**instance_group_manager_action_scheduled_action_manager_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_scheduled_action_manager_model == instance_group_manager_action_scheduled_action_manager_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_scheduled_action_manager_model_json2 = instance_group_manager_action_scheduled_action_manager_model.to_dict() + assert instance_group_manager_action_scheduled_action_manager_model_json2 == instance_group_manager_action_scheduled_action_manager_model_json + +class TestInstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref(): + """ + Test Class for InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref + """ + + def test_instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref model + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json = {} + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json['min_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref.from_dict(instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json) + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_dict = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref.from_dict(instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json).__dict__ + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model2 = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityByHref(**instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model == instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json2 = instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model.to_dict() + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json2 == instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_href_model_json + +class TestInstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById(): + """ + Test Class for InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById + """ + + def test_instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById + """ + + # Construct a json representation of a InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById model + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json = {} + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json['min_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById.from_dict(instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json) + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model != False + + # Construct a model instance of InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById by calling from_dict on the json representation + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_dict = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById.from_dict(instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json).__dict__ + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model2 = InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById(**instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model == instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json2 = instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model.to_dict() + assert instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json2 == instance_group_manager_scheduled_action_by_manager_manager_auto_scale_prototype_instance_group_manager_scheduled_action_manager_auto_scale_prototype_instance_group_manager_identity_by_id_model_json + +class TestInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN + """ + + def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {} + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json) + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json + +class TestInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref + """ + + def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {} + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json) + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json + +class TestInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById + """ + + def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {} + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json) + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json + +class TestInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN + """ + + def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN model + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json = {} + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json) + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json + +class TestInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref + """ + + def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref model + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json = {} + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json) + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json -class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref( -): +class TestInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(): + """ + Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + """ + + def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById + """ + + # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json = {} + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json) + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model != False + + # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json).__dict__ + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model.to_dict() + assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json + +class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(): """ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref """ - def test_load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_serialization( - self): + def test_load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref model load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json = {} - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict(load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json) assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - ).__dict__ - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref( - ** - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict(load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json).__dict__ + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(**load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model == load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model.to_dict( - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model.to_dict() assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - -class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById( -): +class TestLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(): """ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById """ - def test_load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_serialization( - self): + def test_load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json = {} - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict(load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json) assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict( - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - ).__dict__ - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById( - ** - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict(load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json).__dict__ + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(**load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model == load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model.to_dict( - ) + load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model.to_dict() assert load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - -class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref( -): +class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(): """ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref """ - def test_load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_serialization( - self): + def test_load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref model load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json = {} - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json) assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - ).__dict__ - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref( - ** - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json).__dict__ + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(**load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model == load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model.to_dict( - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model.to_dict() assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_href_model_json - -class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById( -): +class TestLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(): """ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById """ - def test_load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_serialization( - self): + def test_load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_serialization(self): """ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById """ # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json = {} - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json[ - 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json) assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model != False # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById by calling from_dict on the json representation - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict( - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - ).__dict__ - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById( - ** - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json).__dict__ + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(**load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_dict) # Verify the model instances are equivalent assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model == load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model.to_dict( - ) + load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model.to_dict() assert load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_pool_identity_load_balancer_pool_identity_by_id_model_json - -class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN( -): +class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(): """ Test Class for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN """ - def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_serialization( - self): + def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_serialization(self): """ Test serialization/deserialization for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN """ # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json) assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model != False # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json - ).__dict__ - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN( - ** - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_dict - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json).__dict__ + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(**load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict( - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict() assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json2 == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json - -class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref( -): +class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(): """ Test Class for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref """ - def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_serialization( - self): + def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_serialization(self): """ Test serialization/deserialization for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref """ # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json) assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model != False # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json - ).__dict__ - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref( - ** - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_dict - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json).__dict__ + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(**load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model.to_dict( - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model.to_dict() assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json2 == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json - -class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById( -): +class TestLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById(): """ Test Class for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById """ - def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_serialization( - self): + def test_load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_serialization(self): """ Test serialization/deserialization for LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById """ # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json[ - 'id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json) assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model != False # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict( - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json - ).__dict__ - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById( - ** - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_dict - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_dict = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json).__dict__ + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model2 = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById(**load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_dict) # Verify the model instances are equivalent assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model.to_dict( - ) + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model.to_dict() assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json - -class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress( -): +class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress """ - def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_serialization( - self): + def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_serialization(self): """ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress """ # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json[ - 'address'] = '203.0.113.1' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json['address'] = '203.0.113.1' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json) assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model != False # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json - ).__dict__ - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress( - ** - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_dict - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json).__dict__ + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(**public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model.to_dict( - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model.to_dict() assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json2 == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_address_model_json - -class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN( -): +class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN """ - def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_serialization( - self): + def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_serialization(self): """ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN """ # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json) assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model != False # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json - ).__dict__ - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN( - ** - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_dict - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json).__dict__ + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(**public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model.to_dict( - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model.to_dict() assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json2 == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json - -class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref( -): +class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref """ - def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_serialization( - self): + def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_serialization(self): """ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref """ # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json) assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model != False # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json - ).__dict__ - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref( - ** - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_dict - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json).__dict__ + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(**public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model.to_dict( - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model.to_dict() assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json2 == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json - -class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById( -): +class TestPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById """ - def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_serialization( - self): + def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_serialization(self): """ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById """ # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json[ - 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json) assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model != False # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById by calling from_dict on the json representation - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.from_dict( - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json - ).__dict__ - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById( - ** - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_dict - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json).__dict__ + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model2 = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById(**public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_dict) # Verify the model instances are equivalent assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model.to_dict( - ) + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json2 = public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model.to_dict() assert public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json2 == public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json - -class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN( -): +class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(): """ Test Class for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN """ - def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_serialization( - self): + def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_serialization(self): """ Test serialization/deserialization for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN """ # Construct a json representation of a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN model reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json = {} - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json) assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model != False # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json - ).__dict__ - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN( - ** - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_dict - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json).__dict__ + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(**reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_dict) # Verify the model instances are equivalent assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model.to_dict( - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model.to_dict() assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json2 == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_crn_model_json - -class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref( -): +class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(): """ Test Class for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref """ - def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_serialization( - self): + def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_serialization(self): """ Test serialization/deserialization for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref """ # Construct a json representation of a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref model reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json = {} - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json) assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model != False # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json - ).__dict__ - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref( - ** - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_dict - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json).__dict__ + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(**reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_dict) # Verify the model instances are equivalent assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model.to_dict( - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model.to_dict() assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json2 == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_href_model_json - -class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById( -): +class TestReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById(): """ Test Class for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById """ - def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_serialization( - self): + def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_serialization(self): """ Test serialization/deserialization for ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById """ # Construct a json representation of a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById model reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json = {} - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json[ - 'id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json) assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model != False # Construct a model instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById by calling from_dict on the json representation - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.from_dict( - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json - ).__dict__ - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById( - ** - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_dict - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_dict = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.from_dict(reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json).__dict__ + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model2 = ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById(**reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_dict) # Verify the model instances are equivalent assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model.to_dict( - ) + reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json2 = reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model.to_dict() assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json2 == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json - -class TestRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref( -): +class TestRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(): """ Test Class for RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref """ - def test_route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_serialization( - self): + def test_route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_serialization(self): """ Test serialization/deserialization for RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref """ # Construct a json representation of a RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref model route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json = {} - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b' # Construct a model instance of RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref by calling from_dict on the json representation - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.from_dict( - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.from_dict(route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json) assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model != False # Construct a model instance of RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref by calling from_dict on the json representation - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_dict = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.from_dict( - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json - ).__dict__ - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model2 = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref( - ** - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_dict - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_dict = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.from_dict(route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json).__dict__ + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model2 = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(**route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_dict) # Verify the model instances are equivalent assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model == route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json2 = route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model.to_dict( - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json2 = route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model.to_dict() assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json2 == route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_href_model_json - -class TestRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById( -): +class TestRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById(): """ Test Class for RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById """ - def test_route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_serialization( - self): + def test_route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_serialization(self): """ Test serialization/deserialization for RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById """ # Construct a json representation of a RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById model route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json = {} - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json[ - 'id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7' # Construct a model instance of RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById by calling from_dict on the json representation - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.from_dict( - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.from_dict(route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json) assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model != False # Construct a model instance of RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById by calling from_dict on the json representation - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_dict = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.from_dict( - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json - ).__dict__ - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model2 = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById( - ** - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_dict - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_dict = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.from_dict(route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json).__dict__ + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model2 = RouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById(**route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_dict) # Verify the model instances are equivalent assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model == route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json2 = route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model.to_dict( - ) + route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json2 = route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model.to_dict() assert route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json2 == route_next_hop_prototype_vpn_gateway_connection_identity_vpn_gateway_connection_identity_by_id_model_json - -class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN( -): +class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(): """ Test Class for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN """ - def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_serialization( - self): + def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN """ # Construct a json representation of a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN model security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json = {} - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json) assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model != False # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json - ).__dict__ - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN( - ** - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_dict - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json).__dict__ + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(**security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model.to_dict( - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model.to_dict() assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json2 == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_crn_model_json - -class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref( -): +class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(): """ Test Class for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref """ - def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_serialization( - self): + def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref """ # Construct a json representation of a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref model security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json = {} - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json) assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model != False # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json - ).__dict__ - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref( - ** - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_dict - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json).__dict__ + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(**security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model.to_dict( - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model.to_dict() assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json2 == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_href_model_json - -class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById( -): +class TestSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById(): """ Test Class for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById """ - def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_serialization( - self): + def test_security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById """ # Construct a json representation of a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById model security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json = {} - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json) assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model != False # Construct a model instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById by calling from_dict on the json representation - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.from_dict( - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json - ).__dict__ - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById( - ** - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_dict - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_dict = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.from_dict(security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json).__dict__ + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model2 = SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById(**security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model.to_dict( - ) + security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json2 = security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model.to_dict() assert security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json2 == security_group_rule_remote_patch_security_group_identity_security_group_identity_by_id_model_json - -class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN( -): +class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(): """ Test Class for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN """ - def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_serialization( - self): + def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN """ # Construct a json representation of a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN model security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json = {} - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json) assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model != False # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json - ).__dict__ - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN( - ** - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_dict - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json).__dict__ + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(**security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model.to_dict( - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model.to_dict() assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json2 == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_crn_model_json - -class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref( -): +class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(): """ Test Class for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref """ - def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_serialization( - self): + def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref """ # Construct a json representation of a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref model security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json = {} - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json) assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model != False # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json - ).__dict__ - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref( - ** - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_dict - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json).__dict__ + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(**security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model.to_dict( - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model.to_dict() assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json2 == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_href_model_json - -class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById( -): +class TestSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById(): """ Test Class for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById """ - def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_serialization( - self): + def test_security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_serialization(self): """ Test serialization/deserialization for SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById """ # Construct a json representation of a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById model security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json = {} - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json[ - 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json) assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model != False # Construct a model instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById by calling from_dict on the json representation - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.from_dict( - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json - ).__dict__ - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById( - ** - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_dict - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_dict = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.from_dict(security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json).__dict__ + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model2 = SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById(**security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_dict) # Verify the model instances are equivalent assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model.to_dict( - ) + security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json2 = security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model.to_dict() assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json2 == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json - -class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN( -): +class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(): """ Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN """ - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_serialization( - self): + def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_serialization(self): """ Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN """ # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN model volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json[ - 'crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json) assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model != False # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json - ).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN( - ** - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json).__dict__ + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict) # Verify the model instances are equivalent assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model.to_dict( - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model.to_dict() assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json - -class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref( -): +class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(): """ Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref """ - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_serialization( - self): + def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_serialization(self): """ Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref """ # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref model volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json[ - 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json) assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model != False # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json - ).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref( - ** - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json).__dict__ + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict) # Verify the model instances are equivalent assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model.to_dict( - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model.to_dict() assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json - -class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById( -): +class TestVolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(): """ Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById """ - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_serialization( - self): + def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_serialization(self): """ Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById """ # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json[ - 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json) assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model != False # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict( - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json - ).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById( - ** - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json).__dict__ + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict) # Verify the model instances are equivalent assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model.to_dict( - ) + volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model.to_dict() assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json - -class TestVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity( -): +class TestVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(): """ Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity """ - def test_volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_serialization( - self): + def test_volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_serialization(self): """ Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity """ # Construct dict forms of any model objects needed in order to build this model. - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model[ - 'crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json[ - 'encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json[ - 'iops'] = 10000 - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json[ - 'name'] = 'my-volume' - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json[ - 'profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json[ - 'capacity'] = 100 + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['iops'] = 10000 + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['name'] = 'my-volume' + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['capacity'] = 100 + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict( - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json - ) + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json) assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model != False # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict( - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json - ).__dict__ - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity( - ** - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict - ) + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json).__dict__ + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(**volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict) # Verify the model instances are equivalent assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json2 = volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model.to_dict( - ) + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json2 = volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model.to_dict() assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json2 == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json +class TestInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(): + """ + Test Class for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup + """ + + def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_group_prototype_model = {} # InstanceGroupManagerScheduledActionGroupPrototype + instance_group_manager_scheduled_action_group_prototype_model['membership_count'] = 10 + + # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup model + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json = {} + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['group'] = instance_group_manager_scheduled_action_group_prototype_model + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json) + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model != False + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_dict = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json).__dict__ + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model2 = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(**instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model == instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json2 = instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model.to_dict() + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json2 == instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json + +class TestInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(): + """ + Test Class for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager + """ + + def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_by_manager_manager_model = {} # InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById + instance_group_manager_scheduled_action_by_manager_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_model['min_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager model + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json = {} + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['manager'] = instance_group_manager_scheduled_action_by_manager_manager_model + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json) + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model != False + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_dict = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json).__dict__ + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model2 = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(**instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model == instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json2 = instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model.to_dict() + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json2 == instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json + +class TestInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(): + """ + Test Class for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup + """ + + def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_group_prototype_model = {} # InstanceGroupManagerScheduledActionGroupPrototype + instance_group_manager_scheduled_action_group_prototype_model['membership_count'] = 10 + + # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup model + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json = {} + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json['group'] = instance_group_manager_scheduled_action_group_prototype_model + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json) + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model != False + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_dict = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json).__dict__ + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model2 = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(**instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model == instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json2 = instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model.to_dict() + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json2 == instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_group_model_json + +class TestInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(): + """ + Test Class for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager + """ + + def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_serialization(self): + """ + Test serialization/deserialization for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_group_manager_scheduled_action_by_manager_manager_model = {} # InstanceGroupManagerScheduledActionByManagerManagerAutoScalePrototypeInstanceGroupManagerScheduledActionManagerAutoScalePrototypeInstanceGroupManagerIdentityById + instance_group_manager_scheduled_action_by_manager_manager_model['max_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_model['min_membership_count'] = 10 + instance_group_manager_scheduled_action_by_manager_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' + + # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager model + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json = {} + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json['name'] = 'my-instance-group-manager-action' + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json['run_at'] = datetime_to_string(string_to_datetime("2019-01-01T12:00:00.000Z")) + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json['manager'] = instance_group_manager_scheduled_action_by_manager_manager_model + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json) + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model != False + + # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager by calling from_dict on the json representation + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_dict = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.from_dict(instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json).__dict__ + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model2 = InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(**instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_dict) + + # Verify the model instances are equivalent + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model == instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model2 + + # Convert model instance back to dict and verify no loss of data + instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json2 = instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model.to_dict() + assert instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json2 == instance_group_manager_action_prototype_scheduled_action_prototype_by_run_at_by_manager_model_json + # endregion ##############################################################################