From 1cb591a5ba79a3fb03dfceb3926ac476e29491a7 Mon Sep 17 00:00:00 2001 From: Sridhar G K Date: Sat, 9 Mar 2024 17:52:38 +0530 Subject: [PATCH] feat: directlink - dedicated vlan mapping Signed-off-by: Sridhar G K --- .../direct_link_v1.py | 6138 ++++++++++++----- test/integration/test_direct_link_v1.py | 27 +- test/unit/test_direct_link_v1.py | 2344 ++++--- 3 files changed, 5953 insertions(+), 2556 deletions(-) diff --git a/ibm_cloud_networking_services/direct_link_v1.py b/ibm_cloud_networking_services/direct_link_v1.py index 00f822b..32f2e37 100644 --- a/ibm_cloud_networking_services/direct_link_v1.py +++ b/ibm_cloud_networking_services/direct_link_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2023. +# (C) Copyright IBM Corp. 2024. # # 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.60.2-95dc7721-20221102-203229 +# IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 """ No description provided (generated by Openapi Generator @@ -39,6 +39,7 @@ # Service ############################################################################## + class DirectLinkV1(BaseService): """The Direct Link V1 service.""" @@ -46,10 +47,11 @@ class DirectLinkV1(BaseService): DEFAULT_SERVICE_NAME = 'direct_link' @classmethod - def new_instance(cls, - version: str, - service_name: str = DEFAULT_SERVICE_NAME, - ) -> 'DirectLinkV1': + def new_instance( + cls, + version: str, + service_name: str = DEFAULT_SERVICE_NAME, + ) -> 'DirectLinkV1': """ Return a new client for the Direct Link service using the specified parameters and external configuration. @@ -69,10 +71,11 @@ def new_instance(cls, service.configure_service(service_name) return service - def __init__(self, - version: str, - authenticator: Authenticator = None, - ) -> None: + def __init__( + self, + version: str, + authenticator: Authenticator = None, + ) -> None: """ Construct a new client for the Direct Link service. @@ -87,19 +90,16 @@ def __init__(self, if version is None: raise ValueError('version must be provided') - BaseService.__init__(self, - service_url=self.DEFAULT_SERVICE_URL, - authenticator=authenticator) + BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) self.version = version - ######################### # Gateways ######################### - - def list_gateways(self, - **kwargs + def list_gateways( + self, + **kwargs, ) -> DetailedResponse: """ List gateways. @@ -113,13 +113,15 @@ def list_gateways(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateways') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateways', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -128,18 +130,20 @@ def list_gateways(self, headers['Accept'] = 'application/json' url = '/gateways' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway(self, + def create_gateway( + self, gateway_template: 'GatewayTemplate', - **kwargs + **kwargs, ) -> DetailedResponse: """ Create gateway. @@ -157,13 +161,15 @@ def create_gateway(self, if isinstance(gateway_template, GatewayTemplate): gateway_template = convert_model(gateway_template) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = json.dumps(gateway_template) @@ -175,19 +181,21 @@ def create_gateway(self, headers['Accept'] = 'application/json' url = '/gateways' - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_gateway(self, + def delete_gateway( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete gateway. @@ -203,13 +211,15 @@ def delete_gateway(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -220,18 +230,20 @@ def delete_gateway(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway(self, + def get_gateway( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get gateway. @@ -241,19 +253,21 @@ def get_gateway(self, :param str id: Direct Link gateway 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 `Gateway` object + :rtype: DetailedResponse with `dict` result representing a `GetGatewayResponse` object """ if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -265,35 +279,21 @@ def get_gateway(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def update_gateway(self, + def update_gateway( + self, id: str, - *, - authentication_key: 'GatewayPatchTemplateAuthenticationKey' = None, - bfd_config: 'GatewayBfdPatchTemplate' = None, - bgp_asn: int = None, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None, - connection_mode: str = None, - default_export_route_filter: str = None, - default_import_route_filter: str = None, - global_: bool = None, - loa_reject_reason: str = None, - macsec_config: 'GatewayMacsecConfigPatchTemplate' = None, - metered: bool = None, - name: str = None, - operational_status: str = None, - patch_panel_completion_notice: str = None, - speed_mbps: int = None, - **kwargs + gateway_patch_template: 'GatewayPatchTemplate', + **kwargs, ) -> DetailedResponse: """ Update gateway. @@ -301,69 +301,8 @@ def update_gateway(self, Update a Direct Link gateway. :param str id: Direct Link gateway identifier. - :param GatewayPatchTemplateAuthenticationKey authentication_key: (optional) - The identity of the standard key to use for BGP MD5 authentication key. - The key material that you provide must be base64 encoded and original - string must be maximum 126 ASCII characters in length. - To clear the optional `authentication_key` field patch its crn to `""`. - :param GatewayBfdPatchTemplate bfd_config: (optional) BFD configuration - information. - :param int bgp_asn: (optional) The autonomous system number (ASN) of Border - Gateway Protocol (BGP) configuration for the IBM side of the DL 2.0 - gateway. - :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR is the - new CIDR (Classless Inter-Domain Routing) value to be updated on customer - edge router for the DL 2.0 gateway. - Customer edge IP and IBM IP should be in the same network. Updating - customer edge router CIDR should be accompanied with IBM CIDR in the - request. Update customer edge router IP to a valid bgp_cer_cidr and - bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", - "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public - CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet - mask values. - :param str bgp_ibm_cidr: (optional) BGP IBM CIDR is the new CIDR (Classless - Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 - gateway. - IBM IP and customer edge IP should be in the same network. Updating IBM - CIDR should be accompanied with customer edge router CIDR in the request. - Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value - must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", - "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr - must have matching network and subnet mask values. - :param str connection_mode: (optional) Type of services this Gateway is - attached to. Mode transit means this Gateway will be attached to Transit - Gateway Service and direct means this Gateway will be attached to vpc or - classic connection. The list of enumerated values for this property may - expand in the future. Code and processes using this field must tolerate - unexpected values. - :param str default_export_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param str default_import_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param bool global_: (optional) Gateways with global routing (`true`) can - connect to networks outside of their associated region. - :param str loa_reject_reason: (optional) Use this field during LOA - rejection to provide the reason for the rejection. - Only allowed for type=dedicated gateways. - :param GatewayMacsecConfigPatchTemplate macsec_config: (optional) MACsec - configuration information. When patching any macsec_config fields, no - other fields may be specified in the patch request. Contact IBM support - for access to MACsec. - A MACsec config cannot be added to a gateway created without MACsec. - :param bool metered: (optional) Metered billing option. When `true` - gateway usage is billed per gigabyte. When `false` there is no per - gigabyte usage charge, instead a flat rate is charged for the gateway. - :param str name: (optional) The unique user-defined name for this gateway. - :param str operational_status: (optional) Gateway operational status. - For gateways pending LOA approval, patch operational_status to the - appropriate value to approve or reject its LOA. When rejecting an LOA, - provide reject reasoning in `loa_reject_reason`. - Only allowed for type=dedicated gateways. - :param str patch_panel_completion_notice: (optional) Gateway patch panel - complete notification from implementation team. - :param int speed_mbps: (optional) Gateway speed in megabits per second. + :param GatewayPatchTemplate gateway_patch_template: The Direct Link gateway + 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 `Gateway` object @@ -371,43 +310,24 @@ def update_gateway(self, if not id: raise ValueError('id must be provided') - if authentication_key is not None: - authentication_key = convert_model(authentication_key) - if bfd_config is not None: - bfd_config = convert_model(bfd_config) - if macsec_config is not None: - macsec_config = convert_model(macsec_config) + if gateway_patch_template is None: + raise ValueError('gateway_patch_template must be provided') + if isinstance(gateway_patch_template, GatewayPatchTemplate): + gateway_patch_template = convert_model(gateway_patch_template) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } - data = { - 'authentication_key': authentication_key, - 'bfd_config': bfd_config, - 'bgp_asn': bgp_asn, - 'bgp_cer_cidr': bgp_cer_cidr, - 'bgp_ibm_cidr': bgp_ibm_cidr, - 'connection_mode': connection_mode, - 'default_export_route_filter': default_export_route_filter, - 'default_import_route_filter': default_import_route_filter, - 'global': global_, - 'loa_reject_reason': loa_reject_reason, - 'macsec_config': macsec_config, - 'metered': metered, - 'name': name, - 'operational_status': operational_status, - 'patch_panel_completion_notice': patch_panel_completion_notice, - 'speed_mbps': speed_mbps - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' + data = json.dumps(gateway_patch_template) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) @@ -418,17 +338,19 @@ def update_gateway(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}'.format(**path_param_dict) - request = self.prepare_request(method='PATCH', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def create_gateway_action(self, + def create_gateway_action( + self, id: str, *, action: str = None, @@ -444,7 +366,7 @@ def create_gateway_action(self, metered: bool = None, resource_group: 'ResourceGroupIdentity' = None, updates: List['GatewayActionTemplateUpdatesItem'] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Approve or reject change requests. @@ -528,13 +450,15 @@ def create_gateway_action(self, if updates is not None: updates = [convert_model(x) for x in updates] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_action') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_action', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { @@ -550,7 +474,7 @@ def create_gateway_action(self, 'import_route_filters': import_route_filters, 'metered': metered, 'resource_group': resource_group, - 'updates': updates + 'updates': updates, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -565,19 +489,21 @@ def create_gateway_action(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/actions'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def list_gateway_completion_notice(self, + def list_gateway_completion_notice( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get completion notice. @@ -593,13 +519,15 @@ def list_gateway_completion_notice(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_completion_notice') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_completion_notice', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -611,21 +539,23 @@ def list_gateway_completion_notice(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/completion_notice'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway_completion_notice(self, + def create_gateway_completion_notice( + self, id: str, *, upload: BinaryIO = None, upload_content_type: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create completion notice. @@ -643,13 +573,15 @@ def create_gateway_completion_notice(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_completion_notice') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_completion_notice', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } form_data = [] @@ -664,19 +596,21 @@ def create_gateway_completion_notice(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/completion_notice'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - files=form_data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + files=form_data, + ) response = self.send(request, **kwargs) return response - - def list_gateway_letter_of_authorization(self, + def list_gateway_letter_of_authorization( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get letter of authorization. @@ -692,13 +626,15 @@ def list_gateway_letter_of_authorization(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_letter_of_authorization') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_letter_of_authorization', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -710,19 +646,21 @@ def list_gateway_letter_of_authorization(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/letter_of_authorization'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_statistics(self, + def get_gateway_statistics( + self, id: str, type: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Gateway statistics/debug information. @@ -742,14 +680,16 @@ def get_gateway_statistics(self, if not type: raise ValueError('type must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_statistics') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_statistics', + ) headers.update(sdk_headers) params = { 'type': type, - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -761,20 +701,22 @@ def get_gateway_statistics(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/statistics'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_status(self, + def get_gateway_status( + self, id: str, *, type: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Gateway status information. @@ -792,14 +734,16 @@ def get_gateway_status(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_status') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_status', + ) headers.update(sdk_headers) params = { 'version': self.version, - 'type': type + 'type': type, } if 'headers' in kwargs: @@ -811,10 +755,12 @@ def get_gateway_status(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{id}/status'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response @@ -823,10 +769,10 @@ def get_gateway_status(self, # Gateway Export Route Filters ######################### - - def list_gateway_export_route_filters(self, + def list_gateway_export_route_filters( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List export route filters. @@ -849,13 +795,15 @@ def list_gateway_export_route_filters(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_export_route_filters') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_export_route_filters', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -867,16 +815,18 @@ def list_gateway_export_route_filters(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway_export_route_filter(self, + def create_gateway_export_route_filter( + self, gateway_id: str, action: str, prefix: str, @@ -884,7 +834,7 @@ def create_gateway_export_route_filter(self, before: str = None, ge: int = None, le: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create an export route filter. @@ -935,13 +885,15 @@ def create_gateway_export_route_filter(self, if prefix is None: raise ValueError('prefix must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_export_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_export_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { @@ -949,7 +901,7 @@ def create_gateway_export_route_filter(self, 'prefix': prefix, 'before': before, 'ge': ge, - 'le': le + 'le': le, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -964,22 +916,24 @@ def create_gateway_export_route_filter(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def replace_gateway_export_route_filters(self, + def replace_gateway_export_route_filters( + self, gateway_id: str, if_match: str, *, export_route_filters: List['GatewayTemplateRouteFilter'] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Replace existing export route filters. @@ -1005,19 +959,21 @@ def replace_gateway_export_route_filters(self, if export_route_filters is not None: export_route_filters = [convert_model(x) for x in export_route_filters] headers = { - 'If-Match': if_match + 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='replace_gateway_export_route_filters') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='replace_gateway_export_route_filters', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { - 'export_route_filters': export_route_filters + 'export_route_filters': export_route_filters, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1032,20 +988,22 @@ def replace_gateway_export_route_filters(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_gateway_export_route_filter(self, + def delete_gateway_export_route_filter( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Remove export route filter from Direct Link gateway. @@ -1068,13 +1026,15 @@ def delete_gateway_export_route_filter(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_gateway_export_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_gateway_export_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1085,19 +1045,21 @@ def delete_gateway_export_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_export_route_filter(self, + def get_gateway_export_route_filter( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieves the specified Direct Link gateway export route filter. @@ -1116,13 +1078,15 @@ def get_gateway_export_route_filter(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_export_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_export_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1134,20 +1098,22 @@ def get_gateway_export_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def update_gateway_export_route_filter(self, + def update_gateway_export_route_filter( + self, gateway_id: str, id: str, update_route_filter_template: 'UpdateRouteFilterTemplate', - **kwargs + **kwargs, ) -> DetailedResponse: """ Updates the specified Direct Link gateway export route filter. @@ -1180,13 +1146,15 @@ def update_gateway_export_route_filter(self, if isinstance(update_route_filter_template, UpdateRouteFilterTemplate): update_route_filter_template = convert_model(update_route_filter_template) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_gateway_export_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_gateway_export_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = json.dumps(update_route_filter_template) @@ -1201,11 +1169,13 @@ def update_gateway_export_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/export_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='PATCH', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -1214,10 +1184,10 @@ def update_gateway_export_route_filter(self, # Gateway Import Route Filters ######################### - - def list_gateway_import_route_filters(self, + def list_gateway_import_route_filters( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List import route filters. @@ -1239,13 +1209,15 @@ def list_gateway_import_route_filters(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_import_route_filters') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_import_route_filters', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1257,16 +1229,18 @@ def list_gateway_import_route_filters(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway_import_route_filter(self, + def create_gateway_import_route_filter( + self, gateway_id: str, action: str, prefix: str, @@ -1274,7 +1248,7 @@ def create_gateway_import_route_filter(self, before: str = None, ge: int = None, le: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create an import route filter. @@ -1325,13 +1299,15 @@ def create_gateway_import_route_filter(self, if prefix is None: raise ValueError('prefix must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_import_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_import_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { @@ -1339,7 +1315,7 @@ def create_gateway_import_route_filter(self, 'prefix': prefix, 'before': before, 'ge': ge, - 'le': le + 'le': le, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1354,22 +1330,24 @@ def create_gateway_import_route_filter(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def replace_gateway_import_route_filters(self, + def replace_gateway_import_route_filters( + self, gateway_id: str, if_match: str, *, import_route_filters: List['GatewayTemplateRouteFilter'] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Replace existing import route filters. @@ -1395,19 +1373,21 @@ def replace_gateway_import_route_filters(self, if import_route_filters is not None: import_route_filters = [convert_model(x) for x in import_route_filters] headers = { - 'If-Match': if_match + 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='replace_gateway_import_route_filters') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='replace_gateway_import_route_filters', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { - 'import_route_filters': import_route_filters + 'import_route_filters': import_route_filters, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1422,20 +1402,22 @@ def replace_gateway_import_route_filters(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_gateway_import_route_filter(self, + def delete_gateway_import_route_filter( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Remove import route filter from Direct Link gateway. @@ -1458,13 +1440,15 @@ def delete_gateway_import_route_filter(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_gateway_import_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_gateway_import_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1475,19 +1459,21 @@ def delete_gateway_import_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_import_route_filter(self, + def get_gateway_import_route_filter( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieves the specified Direct Link gateway import route filter. @@ -1506,13 +1492,15 @@ def get_gateway_import_route_filter(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_import_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_import_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1524,20 +1512,22 @@ def get_gateway_import_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def update_gateway_import_route_filter(self, + def update_gateway_import_route_filter( + self, gateway_id: str, id: str, update_route_filter_template: 'UpdateRouteFilterTemplate', - **kwargs + **kwargs, ) -> DetailedResponse: """ Updates the specified Direct Link gateway import route filter. @@ -1570,13 +1560,15 @@ def update_gateway_import_route_filter(self, if isinstance(update_route_filter_template, UpdateRouteFilterTemplate): update_route_filter_template = convert_model(update_route_filter_template) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_gateway_import_route_filter') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_gateway_import_route_filter', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = json.dumps(update_route_filter_template) @@ -1591,11 +1583,13 @@ def update_gateway_import_route_filter(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/import_route_filters/{id}'.format(**path_param_dict) - request = self.prepare_request(method='PATCH', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -1604,10 +1598,10 @@ def update_gateway_import_route_filter(self, # Gateway Route Reports ######################### - - def list_gateway_route_reports(self, + def list_gateway_route_reports( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List route reports. @@ -1623,13 +1617,15 @@ def list_gateway_route_reports(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_route_reports') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_route_reports', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1641,18 +1637,20 @@ def list_gateway_route_reports(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/route_reports'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway_route_report(self, + def create_gateway_route_report( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Request a route report. @@ -1674,13 +1672,15 @@ def create_gateway_route_report(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_route_report') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_route_report', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1692,19 +1692,21 @@ def create_gateway_route_report(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/route_reports'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def delete_gateway_route_report(self, + def delete_gateway_route_report( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete route report. @@ -1723,13 +1725,15 @@ def delete_gateway_route_report(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_gateway_route_report') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_gateway_route_report', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1740,19 +1744,21 @@ def delete_gateway_route_report(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/route_reports/{id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_route_report(self, + def get_gateway_route_report( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve route report. @@ -1771,13 +1777,15 @@ def get_gateway_route_report(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_route_report') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_route_report', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1789,10 +1797,12 @@ def get_gateway_route_report(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/route_reports/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response @@ -1801,10 +1811,10 @@ def get_gateway_route_report(self, # Virtual Connections ######################### - - def list_gateway_virtual_connections(self, + def list_gateway_virtual_connections( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List virtual connections. @@ -1822,13 +1832,15 @@ def list_gateway_virtual_connections(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_virtual_connections') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_virtual_connections', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1840,22 +1852,24 @@ def list_gateway_virtual_connections(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/virtual_connections'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def create_gateway_virtual_connection(self, + def create_gateway_virtual_connection( + self, gateway_id: str, name: str, type: str, *, network_id: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create virtual connection. @@ -1883,19 +1897,21 @@ def create_gateway_virtual_connection(self, if type is None: raise ValueError('type must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_gateway_virtual_connection') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_gateway_virtual_connection', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { 'name': name, 'type': type, - 'network_id': network_id + 'network_id': network_id, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1910,20 +1926,22 @@ def create_gateway_virtual_connection(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/virtual_connections'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_gateway_virtual_connection(self, + def delete_gateway_virtual_connection( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete virtual connection. @@ -1942,13 +1960,15 @@ def delete_gateway_virtual_connection(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_gateway_virtual_connection') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_gateway_virtual_connection', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -1959,19 +1979,21 @@ def delete_gateway_virtual_connection(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/virtual_connections/{id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_gateway_virtual_connection(self, + def get_gateway_virtual_connection( + self, gateway_id: str, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get virtual connection. @@ -1990,13 +2012,15 @@ def get_gateway_virtual_connection(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_gateway_virtual_connection') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_gateway_virtual_connection', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2008,22 +2032,24 @@ def get_gateway_virtual_connection(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/virtual_connections/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def update_gateway_virtual_connection(self, + def update_gateway_virtual_connection( + self, gateway_id: str, id: str, *, name: str = None, status: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Update virtual connection. @@ -2050,18 +2076,20 @@ def update_gateway_virtual_connection(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_gateway_virtual_connection') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_gateway_virtual_connection', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { 'name': name, - 'status': status + 'status': status, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -2076,11 +2104,13 @@ def update_gateway_virtual_connection(self, path_param_values = self.encode_path_vars(gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/virtual_connections/{id}'.format(**path_param_dict) - request = self.prepare_request(method='PATCH', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -2089,10 +2119,10 @@ def update_gateway_virtual_connection(self, # Offering Information ######################### - - def list_offering_type_locations(self, + def list_offering_type_locations( + self, offering_type: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List available locations. @@ -2109,13 +2139,15 @@ def list_offering_type_locations(self, if not offering_type: raise ValueError('offering_type must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_offering_type_locations') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_offering_type_locations', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2127,19 +2159,21 @@ def list_offering_type_locations(self, path_param_values = self.encode_path_vars(offering_type) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/offering_types/{offering_type}/locations'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def list_offering_type_location_cross_connect_routers(self, + def list_offering_type_location_cross_connect_routers( + self, offering_type: str, location_name: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List routers. @@ -2160,13 +2194,15 @@ def list_offering_type_location_cross_connect_routers(self, if not location_name: raise ValueError('location_name must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_offering_type_location_cross_connect_routers') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_offering_type_location_cross_connect_routers', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2178,18 +2214,20 @@ def list_offering_type_location_cross_connect_routers(self, path_param_values = self.encode_path_vars(offering_type, location_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/offering_types/{offering_type}/locations/{location_name}/cross_connect_routers'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def list_offering_type_speeds(self, + def list_offering_type_speeds( + self, offering_type: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List speed options. @@ -2206,13 +2244,15 @@ def list_offering_type_speeds(self, if not offering_type: raise ValueError('offering_type must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_offering_type_speeds') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_offering_type_speeds', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2224,10 +2264,12 @@ def list_offering_type_speeds(self, path_param_values = self.encode_path_vars(offering_type) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/offering_types/{offering_type}/speeds'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response @@ -2236,13 +2278,13 @@ def list_offering_type_speeds(self, # Ports ######################### - - def list_ports(self, + def list_ports( + self, *, start: str = None, limit: int = None, location_name: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ List ports. @@ -2260,16 +2302,18 @@ def list_ports(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_ports') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_ports', + ) headers.update(sdk_headers) params = { 'version': self.version, 'start': start, 'limit': limit, - 'location_name': location_name + 'location_name': location_name, } if 'headers' in kwargs: @@ -2278,18 +2322,20 @@ def list_ports(self, headers['Accept'] = 'application/json' url = '/ports' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_port(self, + def get_port( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get port. @@ -2305,13 +2351,15 @@ def get_port(self, if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_port') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_port', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2323,10 +2371,12 @@ def get_port(self, path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/ports/{id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response @@ -2335,10 +2385,10 @@ def get_port(self, # gatewayASPrepends ######################### - - def list_gateway_as_prepends(self, + def list_gateway_as_prepends( + self, gateway_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ List AS Prepends. @@ -2354,13 +2404,15 @@ def list_gateway_as_prepends(self, if not gateway_id: raise ValueError('gateway_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_gateway_as_prepends') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_gateway_as_prepends', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: @@ -2372,21 +2424,23 @@ def list_gateway_as_prepends(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/as_prepends'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def replace_gateway_as_prepends(self, + def replace_gateway_as_prepends( + self, gateway_id: str, if_match: str, *, as_prepends: List['AsPrependPrefixArrayTemplate'] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Replace existing AS Prepends. @@ -2411,19 +2465,21 @@ def replace_gateway_as_prepends(self, if as_prepends is not None: as_prepends = [convert_model(x) for x in as_prepends] headers = { - 'If-Match': if_match + 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='replace_gateway_as_prepends') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='replace_gateway_as_prepends', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { - 'as_prepends': as_prepends + 'as_prepends': as_prepends, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -2438,11 +2494,13 @@ def replace_gateway_as_prepends(self, path_param_values = self.encode_path_vars(gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/gateways/{gateway_id}/as_prepends'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -2457,6 +2515,7 @@ class Type(str, Enum): """ Specify statistic to retrieve. """ + MACSEC_MKA_SESSION = 'macsec_mka_session' MACSEC_POLICY = 'macsec_policy' MACSEC_MKA_STATISTICS = 'macsec_mka_statistics' @@ -2472,6 +2531,7 @@ class Type(str, Enum): """ Specify status to retrieve. """ + BGP = 'bgp' BFD = 'bfd' LINK = 'link' @@ -2487,6 +2547,7 @@ class OfferingType(str, Enum): The Direct Link offering type. Current supported values are `"dedicated"` and `"connect"`. """ + DEDICATED = 'dedicated' CONNECT = 'connect' @@ -2501,6 +2562,7 @@ class OfferingType(str, Enum): The Direct Link offering type. Current supported values are `"dedicated"` and `"connect"`. """ + DEDICATED = 'dedicated' CONNECT = 'connect' @@ -2515,6 +2577,7 @@ class OfferingType(str, Enum): The Direct Link offering type. Current supported values are `"dedicated"` and `"connect"`. """ + DEDICATED = 'dedicated' CONNECT = 'connect' @@ -2524,7 +2587,7 @@ class OfferingType(str, Enum): ############################################################################## -class AsPrepend(): +class AsPrepend: """ Gateway AS Prepend object. @@ -2542,15 +2605,17 @@ class AsPrepend(): updated. """ - def __init__(self, - *, - created_at: datetime = None, - id: str = None, - length: int = None, - policy: str = None, - prefix: str = None, - specific_prefixes: List[str] = None, - updated_at: datetime = None) -> None: + def __init__( + self, + *, + created_at: datetime = None, + id: str = None, + length: int = None, + policy: str = None, + prefix: str = None, + specific_prefixes: List[str] = None, + updated_at: datetime = None, + ) -> None: """ Initialize a AsPrepend object. @@ -2643,11 +2708,13 @@ class PolicyEnum(str, Enum): """ Route type this AS Prepend applies to. """ + IMPORT = 'import' EXPORT = 'export' -class AsPrependCollection(): + +class AsPrependCollection: """ array of AS Prepends. @@ -2655,9 +2722,11 @@ class AsPrependCollection(): information. """ - def __init__(self, - *, - as_prepends: List['AsPrependEntry'] = None) -> None: + def __init__( + self, + *, + as_prepends: List['AsPrependEntry'] = None, + ) -> None: """ Initialize a AsPrependCollection object. @@ -2710,7 +2779,8 @@ def __ne__(self, other: 'AsPrependCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AsPrependEntry(): + +class AsPrependEntry: """ AS Prepends API object. @@ -2726,14 +2796,16 @@ class AsPrependEntry(): updated. """ - def __init__(self, - *, - created_at: datetime = None, - id: str = None, - length: int = None, - policy: str = None, - specific_prefixes: List[str] = None, - updated_at: datetime = None) -> None: + def __init__( + self, + *, + created_at: datetime = None, + id: str = None, + length: int = None, + policy: str = None, + specific_prefixes: List[str] = None, + updated_at: datetime = None, + ) -> None: """ Initialize a AsPrependEntry object. @@ -2819,11 +2891,13 @@ class PolicyEnum(str, Enum): """ Route type this AS Prepend applies to. """ + IMPORT = 'import' EXPORT = 'export' -class AsPrependPrefixArrayTemplate(): + +class AsPrependPrefixArrayTemplate: """ Create AS Prepend Configuration template. @@ -2834,11 +2908,13 @@ class AsPrependPrefixArrayTemplate(): Note that ordering is not significant and may differ from request order. """ - def __init__(self, - length: int, - policy: str, - *, - specific_prefixes: List[str] = None) -> None: + def __init__( + self, + length: int, + policy: str, + *, + specific_prefixes: List[str] = None, + ) -> None: """ Initialize a AsPrependPrefixArrayTemplate object. @@ -2907,11 +2983,13 @@ class PolicyEnum(str, Enum): """ Route type this AS Prepend applies to. """ + IMPORT = 'import' EXPORT = 'export' -class AsPrependTemplate(): + +class AsPrependTemplate: """ Create AS Prepend Configuration template. @@ -2924,12 +3002,14 @@ class AsPrependTemplate(): applies to. If this property is absent, the AS Prepend applies to all prefixes. """ - def __init__(self, - length: int, - policy: str, - *, - prefix: str = None, - specific_prefixes: List[str] = None) -> None: + def __init__( + self, + length: int, + policy: str, + *, + prefix: str = None, + specific_prefixes: List[str] = None, + ) -> None: """ Initialize a AsPrependTemplate object. @@ -3005,11 +3085,72 @@ class PolicyEnum(str, Enum): """ Route type this AS Prepend applies to. """ + IMPORT = 'import' EXPORT = 'export' -class CrossConnectRouter(): + +class CrossAccountGatewayPort: + """ + gateway port for type=connect gateways. + + :attr str id: Port Identifier. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a CrossAccountGatewayPort object. + + :param str id: Port Identifier. + """ + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CrossAccountGatewayPort': + """Initialize a CrossAccountGatewayPort object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in CrossAccountGatewayPort JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CrossAccountGatewayPort 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 CrossAccountGatewayPort object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CrossAccountGatewayPort') -> 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: 'CrossAccountGatewayPort') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CrossConnectRouter: """ Cross Connect Router details. @@ -3019,11 +3160,13 @@ class CrossConnectRouter(): gateways on this router for this account. """ - def __init__(self, - *, - capabilities: List[str] = None, - router_name: str = None, - total_connections: int = None) -> None: + def __init__( + self, + *, + capabilities: List[str] = None, + router_name: str = None, + total_connections: int = None, + ) -> None: """ Initialize a CrossConnectRouter object. @@ -3083,15 +3226,18 @@ def __ne__(self, other: 'CrossConnectRouter') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ExportRouteFilterCollection(): + +class ExportRouteFilterCollection: """ Collection of export route filters. :attr List[RouteFilter] export_route_filters: Array of export route filters. """ - def __init__(self, - export_route_filters: List['RouteFilter']) -> None: + def __init__( + self, + export_route_filters: List['RouteFilter'], + ) -> None: """ Initialize a ExportRouteFilterCollection object. @@ -3146,7 +3292,8 @@ def __ne__(self, other: 'ExportRouteFilterCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Gateway(): + +class Gateway: """ gateway. @@ -3185,6 +3332,8 @@ class Gateway(): processes using this field must tolerate unexpected values. :attr datetime created_at: The date and time resource was created. :attr str crn: The CRN (Cloud Resource Name) of this gateway. + :attr bool cross_account: Indicates whether this gateway is cross account + gateway. :attr str cross_connect_router: (optional) Cross connect router. Only included on type=dedicated gateways. :attr str customer_name: (optional) Customer name. Only set for type=dedicated @@ -3214,66 +3363,72 @@ class Gateway(): :attr str operational_status: Gateway operational status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete - notification from implementation team. :attr GatewayPort port: (optional) gateway port for type=connect gateways. :attr bool provider_api_managed: (optional) Indicates whether gateway changes must be made via a provider portal. :attr ResourceGroupReference resource_group: (optional) Resource group reference. :attr int speed_mbps: Gateway speed in megabits per second. + :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete + notification from implementation team. :attr str type: Offering type. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr int vlan: (optional) VLAN allocated for this gateway. Only set for - type=connect gateways. - """ - - def __init__(self, - bgp_asn: int, - created_at: datetime, - crn: str, - default_export_route_filter: str, - default_import_route_filter: str, - global_: bool, - id: str, - location_display_name: str, - location_name: str, - metered: bool, - name: str, - operational_status: str, - speed_mbps: int, - type: str, - *, - as_prepends: List['AsPrepend'] = None, - authentication_key: 'GatewayAuthenticationKey' = None, - bfd_config: 'GatewayBfdConfig' = None, - bgp_base_cidr: str = None, - bgp_cer_cidr: str = None, - bgp_ibm_asn: int = None, - bgp_ibm_cidr: str = None, - bgp_status: str = None, - bgp_status_updated_at: datetime = None, - carrier_name: str = None, - change_request: 'GatewayChangeRequest' = None, - completion_notice_reject_reason: str = None, - connection_mode: str = None, - cross_connect_router: str = None, - customer_name: str = None, - link_status: str = None, - link_status_updated_at: datetime = None, - macsec_config: 'GatewayMacsecConfig' = None, - patch_panel_completion_notice: str = None, - port: 'GatewayPort' = None, - provider_api_managed: bool = None, - resource_group: 'ResourceGroupReference' = None, - vlan: int = None) -> None: + :attr int vlan: (optional) VLAN configured for this gateway. If there is no vlan + configured for the gateway, the vlan will be absent. This property will also be + absent if this gateway's `crn` is in another account. + """ + + def __init__( + self, + bgp_asn: int, + created_at: datetime, + crn: str, + cross_account: bool, + default_export_route_filter: str, + default_import_route_filter: str, + global_: bool, + id: str, + location_display_name: str, + location_name: str, + metered: bool, + name: str, + operational_status: str, + speed_mbps: int, + type: str, + *, + as_prepends: List['AsPrepend'] = None, + authentication_key: 'GatewayAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfig' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_asn: int = None, + bgp_ibm_cidr: str = None, + bgp_status: str = None, + bgp_status_updated_at: datetime = None, + carrier_name: str = None, + change_request: 'GatewayChangeRequest' = None, + completion_notice_reject_reason: str = None, + connection_mode: str = None, + cross_connect_router: str = None, + customer_name: str = None, + link_status: str = None, + link_status_updated_at: datetime = None, + macsec_config: 'GatewayMacsecConfig' = None, + port: 'GatewayPort' = None, + provider_api_managed: bool = None, + resource_group: 'ResourceGroupReference' = None, + patch_panel_completion_notice: str = None, + vlan: int = None, + ) -> None: """ Initialize a Gateway object. :param int bgp_asn: Customer BGP ASN. :param datetime created_at: The date and time resource was created. :param str crn: The CRN (Cloud Resource Name) of this gateway. + :param bool cross_account: Indicates whether this gateway is cross account + gateway. :param str default_export_route_filter: The default directional route filter action that applies to routes that do not match any directional route filters. @@ -3345,15 +3500,16 @@ def __init__(self, :param GatewayMacsecConfig macsec_config: (optional) MACsec configuration information. For Dedicated Gateways with MACsec configured, return configuration information. Contact IBM support for access to MACsec. - :param str patch_panel_completion_notice: (optional) Gateway patch panel - complete notification from implementation team. :param GatewayPort port: (optional) gateway port for type=connect gateways. :param bool provider_api_managed: (optional) Indicates whether gateway changes must be made via a provider portal. :param ResourceGroupReference resource_group: (optional) Resource group reference. - :param int vlan: (optional) VLAN allocated for this gateway. Only set for - type=connect gateways. + :param str patch_panel_completion_notice: (optional) Gateway patch panel + complete notification from implementation team. + :param int vlan: (optional) VLAN configured for this gateway. If there is + no vlan configured for the gateway, the vlan will be absent. This property + will also be absent if this gateway's `crn` is in another account. """ self.as_prepends = as_prepends self.authentication_key = authentication_key @@ -3371,6 +3527,7 @@ def __init__(self, self.connection_mode = connection_mode self.created_at = created_at self.crn = crn + self.cross_account = cross_account self.cross_connect_router = cross_connect_router self.customer_name = customer_name self.default_export_route_filter = default_export_route_filter @@ -3385,11 +3542,11 @@ def __init__(self, self.metered = metered self.name = name self.operational_status = operational_status - self.patch_panel_completion_notice = patch_panel_completion_notice self.port = port self.provider_api_managed = provider_api_managed self.resource_group = resource_group self.speed_mbps = speed_mbps + self.patch_panel_completion_notice = patch_panel_completion_notice self.type = type self.vlan = vlan @@ -3435,6 +3592,10 @@ def from_dict(cls, _dict: Dict) -> 'Gateway': args['crn'] = _dict.get('crn') else: raise ValueError('Required property \'crn\' not present in Gateway JSON') + if 'cross_account' in _dict: + args['cross_account'] = _dict.get('cross_account') + else: + raise ValueError('Required property \'cross_account\' not present in Gateway JSON') if 'cross_connect_router' in _dict: args['cross_connect_router'] = _dict.get('cross_connect_router') if 'customer_name' in _dict: @@ -3481,8 +3642,6 @@ def from_dict(cls, _dict: Dict) -> 'Gateway': args['operational_status'] = _dict.get('operational_status') else: raise ValueError('Required property \'operational_status\' not present in Gateway JSON') - if 'patch_panel_completion_notice' in _dict: - args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') if 'port' in _dict: args['port'] = GatewayPort.from_dict(_dict.get('port')) if 'provider_api_managed' in _dict: @@ -3493,6 +3652,8 @@ def from_dict(cls, _dict: Dict) -> 'Gateway': args['speed_mbps'] = _dict.get('speed_mbps') else: raise ValueError('Required property \'speed_mbps\' not present in Gateway JSON') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') if 'type' in _dict: args['type'] = _dict.get('type') else: @@ -3556,6 +3717,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, 'cross_account') and self.cross_account is not None: + _dict['cross_account'] = self.cross_account if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: _dict['cross_connect_router'] = self.cross_connect_router if hasattr(self, 'customer_name') and self.customer_name is not None: @@ -3587,8 +3750,6 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'operational_status') and self.operational_status is not None: _dict['operational_status'] = self.operational_status - if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: - _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice if hasattr(self, 'port') and self.port is not None: if isinstance(self.port, dict): _dict['port'] = self.port @@ -3603,6 +3764,8 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'speed_mbps') and self.speed_mbps is not None: _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'vlan') and self.vlan is not None: @@ -3632,6 +3795,7 @@ class BgpStatusEnum(str, Enum): Gateway BGP status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + ACTIVE = 'active' CONNECT = 'connect' ESTABLISHED = 'established' @@ -3646,6 +3810,7 @@ class ConnectionModeEnum(str, Enum): property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + DIRECT = 'direct' TRANSIT = 'transit' @@ -3655,6 +3820,7 @@ class DefaultExportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' @@ -3664,6 +3830,7 @@ class DefaultImportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' @@ -3674,6 +3841,7 @@ class LinkStatusEnum(str, Enum): enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + DOWN = 'down' UP = 'up' @@ -3684,6 +3852,7 @@ class OperationalStatusEnum(str, Enum): expand in the future. Code and processes using this field must tolerate unexpected values. """ + AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' AWAITING_LOA = 'awaiting_loa' CONFIGURING = 'configuring' @@ -3704,11 +3873,13 @@ class TypeEnum(str, Enum): Offering type. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + CONNECT = 'connect' DEDICATED = 'dedicated' -class GatewayActionTemplateAuthenticationKey(): + +class GatewayActionTemplateAuthenticationKey: """ Applicable for create_gateway_approve requests to select the gateway's BGP MD5 authentication key. The key material that you provide must be base64 encoded and @@ -3722,8 +3893,10 @@ class GatewayActionTemplateAuthenticationKey(): resource. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayActionTemplateAuthenticationKey object. @@ -3775,22 +3948,27 @@ def __ne__(self, other: 'GatewayActionTemplateAuthenticationKey') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayActionTemplateUpdatesItem(): + +class GatewayActionTemplateUpdatesItem: """ GatewayActionTemplateUpdatesItem. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a GatewayActionTemplateUpdatesItem object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate'])) + ", ".join(['GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate', 'GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate']) + ) raise Exception(msg) -class GatewayAuthenticationKey(): + +class GatewayAuthenticationKey: """ The identity of the standard key to use for BGP MD5 authentication key. The key material that you provide must be base64 encoded and original string must be maximum @@ -3804,8 +3982,10 @@ class GatewayAuthenticationKey(): resource. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayAuthenticationKey object. @@ -3857,7 +4037,8 @@ def __ne__(self, other: 'GatewayAuthenticationKey') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayBfdConfig(): + +class GatewayBfdConfig: """ BFD configuration information. @@ -3873,12 +4054,14 @@ class GatewayBfdConfig(): that causes the originating interface to be declared down. """ - def __init__(self, - interval: int, - multiplier: int, - *, - bfd_status: str = None, - bfd_status_updated_at: datetime = None) -> None: + def __init__( + self, + interval: int, + multiplier: int, + *, + bfd_status: str = None, + bfd_status_updated_at: datetime = None, + ) -> None: """ Initialize a GatewayBfdConfig object. @@ -3957,12 +4140,14 @@ class BfdStatusEnum(str, Enum): Gateway BFD status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + INIT = 'init' UP = 'up' DOWN = 'down' -class GatewayBfdConfigActionTemplate(): + +class GatewayBfdConfigActionTemplate: """ Applicable for create_gateway_approve requests to select the gateway's BFD configuration information. @@ -3974,10 +4159,12 @@ class GatewayBfdConfigActionTemplate(): neighbor that causes the originating interface to be declared down. """ - def __init__(self, - interval: int, - *, - multiplier: int = None) -> None: + def __init__( + self, + interval: int, + *, + multiplier: int = None, + ) -> None: """ Initialize a GatewayBfdConfigActionTemplate object. @@ -4034,7 +4221,8 @@ def __ne__(self, other: 'GatewayBfdConfigActionTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayBfdConfigTemplate(): + +class GatewayBfdConfigTemplate: """ BFD configuration information. @@ -4045,10 +4233,12 @@ class GatewayBfdConfigTemplate(): neighbor that causes the originating interface to be declared down. """ - def __init__(self, - interval: int, - *, - multiplier: int = None) -> None: + def __init__( + self, + interval: int, + *, + multiplier: int = None, + ) -> None: """ Initialize a GatewayBfdConfigTemplate object. @@ -4105,7 +4295,8 @@ def __ne__(self, other: 'GatewayBfdConfigTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayBfdPatchTemplate(): + +class GatewayBfdPatchTemplate: """ BFD configuration information. @@ -4117,10 +4308,12 @@ class GatewayBfdPatchTemplate(): neighbor that causes the originating interface to be declared down. """ - def __init__(self, - *, - interval: int = None, - multiplier: int = None) -> None: + def __init__( + self, + *, + interval: int = None, + multiplier: int = None, + ) -> None: """ Initialize a GatewayBfdPatchTemplate object. @@ -4177,49 +4370,62 @@ def __ne__(self, other: 'GatewayBfdPatchTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayChangeRequest(): + +class GatewayChangeRequest: """ GatewayChangeRequest. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a GatewayChangeRequest object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GatewayChangeRequestGatewayClientGatewayCreate', 'GatewayChangeRequestGatewayClientGatewayDelete', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributes'])) + ", ".join(['GatewayChangeRequestGatewayClientGatewayCreate', 'GatewayChangeRequestGatewayClientGatewayDelete', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributes']) + ) raise Exception(msg) -class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem(): + +class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem: """ GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate'])) + ", ".join(['GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate', 'GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate']) + ) raise Exception(msg) -class GatewayCollection(): + +class GatewayCollection: """ List of gateways. - :attr List[Gateway] gateways: Collection of Direct Link gateways. + :attr List[GatewayCollectionGatewaysItem] gateways: Collection of Direct Link + gateways. """ - def __init__(self, - gateways: List['Gateway']) -> None: + def __init__( + self, + gateways: List['GatewayCollectionGatewaysItem'], + ) -> None: """ Initialize a GatewayCollection object. - :param List[Gateway] gateways: Collection of Direct Link gateways. + :param List[GatewayCollectionGatewaysItem] gateways: Collection of Direct + Link gateways. """ self.gateways = gateways @@ -4228,7 +4434,7 @@ def from_dict(cls, _dict: Dict) -> 'GatewayCollection': """Initialize a GatewayCollection object from a json dictionary.""" args = {} if 'gateways' in _dict: - args['gateways'] = [Gateway.from_dict(v) for v in _dict.get('gateways')] + args['gateways'] = _dict.get('gateways') else: raise ValueError('Required property \'gateways\' not present in GatewayCollection JSON') return cls(**args) @@ -4269,7 +4475,27 @@ def __ne__(self, other: 'GatewayCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfig(): + +class GatewayCollectionGatewaysItem: + """ + GatewayCollectionGatewaysItem. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a GatewayCollectionGatewaysItem object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['GatewayCollectionGatewaysItemGateway', 'GatewayCollectionGatewaysItemCrossAccountGateway']) + ) + raise Exception(msg) + + +class GatewayMacsecConfig: """ MACsec configuration information. For Dedicated Gateways with MACsec configured, return configuration information. Contact IBM support for access to MACsec. @@ -4299,20 +4525,22 @@ class GatewayMacsecConfig(): :attr int window_size: (optional) replay protection window size. """ - def __init__(self, - active: bool, - primary_cak: 'GatewayMacsecConfigPrimaryCak', - status: str, - *, - active_cak: 'GatewayMacsecConfigActiveCak' = None, - cipher_suite: str = None, - confidentiality_offset: int = None, - cryptographic_algorithm: str = None, - fallback_cak: 'GatewayMacsecConfigFallbackCak' = None, - key_server_priority: int = None, - sak_expiry_time: int = None, - security_policy: str = None, - window_size: int = None) -> None: + def __init__( + self, + active: bool, + primary_cak: 'GatewayMacsecConfigPrimaryCak', + status: str, + *, + active_cak: 'GatewayMacsecConfigActiveCak' = None, + cipher_suite: str = None, + confidentiality_offset: int = None, + cryptographic_algorithm: str = None, + fallback_cak: 'GatewayMacsecConfigFallbackCak' = None, + key_server_priority: int = None, + sak_expiry_time: int = None, + security_policy: str = None, + window_size: int = None, + ) -> None: """ Initialize a GatewayMacsecConfig object. @@ -4454,6 +4682,7 @@ class CipherSuiteEnum(str, Enum): """ SAK cipher suite. """ + GCM_AES_XPN_256 = 'gcm_aes_xpn_256' @@ -4461,6 +4690,7 @@ class CryptographicAlgorithmEnum(str, Enum): """ cryptographic algorithm. """ + AES_256_CMAC = 'aes_256_cmac' @@ -4468,6 +4698,7 @@ class SecurityPolicyEnum(str, Enum): """ Packets without MACsec headers are dropped when security_policy is `must_secure`. """ + MUST_SECURE = 'must_secure' @@ -4476,13 +4707,15 @@ class StatusEnum(str, Enum): Current status of MACsec on this gateway. Status 'offline' is returned during gateway creation and deletion. """ + INIT = 'init' PENDING = 'pending' OFFLINE = 'offline' SECURED = 'secured' -class GatewayMacsecConfigActiveCak(): + +class GatewayMacsecConfigActiveCak: """ Active connectivity association key. During normal operation `active_cak` will match the desired `primary_cak`. During CAK @@ -4493,9 +4726,11 @@ class GatewayMacsecConfigActiveCak(): :attr str status: connectivity association key status. """ - def __init__(self, - crn: str, - status: str) -> None: + def __init__( + self, + crn: str, + status: str, + ) -> None: """ Initialize a GatewayMacsecConfigActiveCak object. @@ -4551,7 +4786,8 @@ def __ne__(self, other: 'GatewayMacsecConfigActiveCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigFallbackCak(): + +class GatewayMacsecConfigFallbackCak: """ fallback connectivity association key. @@ -4559,9 +4795,11 @@ class GatewayMacsecConfigFallbackCak(): :attr str status: connectivity association key status. """ - def __init__(self, - crn: str, - status: str) -> None: + def __init__( + self, + crn: str, + status: str, + ) -> None: """ Initialize a GatewayMacsecConfigFallbackCak object. @@ -4617,7 +4855,8 @@ def __ne__(self, other: 'GatewayMacsecConfigFallbackCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigPatchTemplate(): + +class GatewayMacsecConfigPatchTemplate: """ MACsec configuration information. When patching any macsec_config fields, no other fields may be specified in the patch request. Contact IBM support for access to @@ -4644,12 +4883,14 @@ class GatewayMacsecConfigPatchTemplate(): :attr int window_size: (optional) replay protection window size. """ - def __init__(self, - *, - active: bool = None, - fallback_cak: 'GatewayMacsecConfigPatchTemplateFallbackCak' = None, - primary_cak: 'GatewayMacsecConfigPatchTemplatePrimaryCak' = None, - window_size: int = None) -> None: + def __init__( + self, + *, + active: bool = None, + fallback_cak: 'GatewayMacsecConfigPatchTemplateFallbackCak' = None, + primary_cak: 'GatewayMacsecConfigPatchTemplatePrimaryCak' = None, + window_size: int = None, + ) -> None: """ Initialize a GatewayMacsecConfigPatchTemplate object. @@ -4733,7 +4974,8 @@ def __ne__(self, other: 'GatewayMacsecConfigPatchTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigPatchTemplateFallbackCak(): + +class GatewayMacsecConfigPatchTemplateFallbackCak: """ Fallback connectivity association key. MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and @@ -4745,8 +4987,10 @@ class GatewayMacsecConfigPatchTemplateFallbackCak(): :attr str crn: connectivity association key crn. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayMacsecConfigPatchTemplateFallbackCak object. @@ -4794,7 +5038,8 @@ def __ne__(self, other: 'GatewayMacsecConfigPatchTemplateFallbackCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigPatchTemplatePrimaryCak(): + +class GatewayMacsecConfigPatchTemplatePrimaryCak: """ Desired primary connectivity association key. MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and @@ -4805,8 +5050,10 @@ class GatewayMacsecConfigPatchTemplatePrimaryCak(): :attr str crn: connectivity association key crn. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayMacsecConfigPatchTemplatePrimaryCak object. @@ -4854,7 +5101,8 @@ def __ne__(self, other: 'GatewayMacsecConfigPatchTemplatePrimaryCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigPrimaryCak(): + +class GatewayMacsecConfigPrimaryCak: """ desired primary connectivity association key. @@ -4862,9 +5110,11 @@ class GatewayMacsecConfigPrimaryCak(): :attr str status: connectivity association key status. """ - def __init__(self, - crn: str, - status: str) -> None: + def __init__( + self, + crn: str, + status: str, + ) -> None: """ Initialize a GatewayMacsecConfigPrimaryCak object. @@ -4920,7 +5170,8 @@ def __ne__(self, other: 'GatewayMacsecConfigPrimaryCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigTemplate(): + +class GatewayMacsecConfigTemplate: """ MACsec configuration information. Contact IBM support for access to MACsec. @@ -4942,12 +5193,14 @@ class GatewayMacsecConfigTemplate(): :attr int window_size: (optional) replay protection window size. """ - def __init__(self, - active: bool, - primary_cak: 'GatewayMacsecConfigTemplatePrimaryCak', - *, - fallback_cak: 'GatewayMacsecConfigTemplateFallbackCak' = None, - window_size: int = None) -> None: + def __init__( + self, + active: bool, + primary_cak: 'GatewayMacsecConfigTemplatePrimaryCak', + *, + fallback_cak: 'GatewayMacsecConfigTemplateFallbackCak' = None, + window_size: int = None, + ) -> None: """ Initialize a GatewayMacsecConfigTemplate object. @@ -5033,7 +5286,8 @@ def __ne__(self, other: 'GatewayMacsecConfigTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigTemplateFallbackCak(): + +class GatewayMacsecConfigTemplateFallbackCak: """ Fallback connectivity association key. The `fallback_cak` crn cannot match the `primary_cak` crn. MACsec keys must be @@ -5044,8 +5298,10 @@ class GatewayMacsecConfigTemplateFallbackCak(): :attr str crn: connectivity association key crn. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayMacsecConfigTemplateFallbackCak object. @@ -5093,7 +5349,8 @@ def __ne__(self, other: 'GatewayMacsecConfigTemplateFallbackCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayMacsecConfigTemplatePrimaryCak(): + +class GatewayMacsecConfigTemplatePrimaryCak: """ Desired primary connectivity association key. MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and @@ -5103,8 +5360,10 @@ class GatewayMacsecConfigTemplatePrimaryCak(): :attr str crn: connectivity association key crn. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayMacsecConfigTemplatePrimaryCak object. @@ -5152,165 +5411,392 @@ def __ne__(self, other: 'GatewayMacsecConfigTemplatePrimaryCak') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayPatchTemplateAuthenticationKey(): - """ - The identity of the standard key to use for BGP MD5 authentication key. The key - material that you provide must be base64 encoded and original string must be maximum - 126 ASCII characters in length. To clear the optional `authentication_key` field patch - its crn to `""`. - - :attr str crn: The CRN of the [Key Protect Standard - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Service Standard - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this - resource. - """ - - def __init__(self, - crn: str) -> None: - """ - Initialize a GatewayPatchTemplateAuthenticationKey object. - - :param str crn: The CRN of the [Key Protect Standard - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Service Standard - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for - this resource. - """ - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayPatchTemplateAuthenticationKey': - """Initialize a GatewayPatchTemplateAuthenticationKey object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in GatewayPatchTemplateAuthenticationKey JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GatewayPatchTemplateAuthenticationKey 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 GatewayPatchTemplateAuthenticationKey object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GatewayPatchTemplateAuthenticationKey') -> 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: 'GatewayPatchTemplateAuthenticationKey') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class GatewayPort(): +class GatewayPatchTemplate: """ - gateway port for type=connect gateways. + patch gateway template. - :attr str id: Port Identifier. + :attr GatewayPatchTemplateAuthenticationKey authentication_key: (optional) The + identity of the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original string + must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :attr GatewayBfdPatchTemplate bfd_config: (optional) BFD configuration + information. + :attr int bgp_asn: (optional) The autonomous system number (ASN) of Border + Gateway Protocol (BGP) configuration for the IBM side of the DL 2.0 gateway. + :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR is the new CIDR + (Classless Inter-Domain Routing) value to be updated on customer edge router for + the DL 2.0 gateway. + Customer edge IP and IBM IP should be in the same network. Updating customer + edge router CIDR should be accompanied with IBM CIDR in the request. Update + customer edge router IP to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value + must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must + have matching network and subnet mask values. + :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR is the new CIDR (Classless + Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 + gateway. + IBM IP and customer edge IP should be in the same network. Updating IBM CIDR + should be accompanied with customer edge router CIDR in the request. Update IBM + CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one + of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an + owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and + subnet mask values. + :attr str connection_mode: (optional) Type of services this Gateway is attached + to. Mode transit means this Gateway will be attached to Transit Gateway Service + and direct means this Gateway will be attached to vpc or classic connection. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr str default_export_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr str default_import_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr bool global_: (optional) Gateways with global routing (`true`) can connect + to networks outside of their associated region. + :attr str loa_reject_reason: (optional) Use this field during LOA rejection to + provide the reason for the rejection. + Only allowed for type=dedicated gateways. + :attr GatewayMacsecConfigPatchTemplate macsec_config: (optional) MACsec + configuration information. When patching any macsec_config fields, no other + fields may be specified in the patch request. Contact IBM support for access to + MACsec. + A MACsec config cannot be added to a gateway created without MACsec. + :attr bool metered: (optional) Metered billing option. When `true` gateway + usage is billed per gigabyte. When `false` there is no per gigabyte usage + charge, instead a flat rate is charged for the gateway. + :attr str name: (optional) The unique user-defined name for this gateway. + :attr str operational_status: (optional) Gateway operational status. + For gateways pending LOA approval, patch operational_status to the appropriate + value to approve or reject its LOA. When rejecting an LOA, provide reject + reasoning in `loa_reject_reason`. + Only allowed for type=dedicated gateways. + :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete + notification from implementation team. + :attr int speed_mbps: (optional) Gateway speed in megabits per second. + :attr int vlan: (optional) The VLAN to configure for this gateway. + Specify `null` to remove an existing VLAN configuration. + The gateway must have a `type` of `dedicated`. """ - def __init__(self, - id: str) -> None: - """ - Initialize a GatewayPort object. - - :param str id: Port Identifier. + def __init__( + self, + *, + authentication_key: 'GatewayPatchTemplateAuthenticationKey' = None, + bfd_config: 'GatewayBfdPatchTemplate' = None, + bgp_asn: int = None, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + connection_mode: str = None, + default_export_route_filter: str = None, + default_import_route_filter: str = None, + global_: bool = None, + loa_reject_reason: str = None, + macsec_config: 'GatewayMacsecConfigPatchTemplate' = None, + metered: bool = None, + name: str = None, + operational_status: str = None, + patch_panel_completion_notice: str = None, + speed_mbps: int = None, + vlan: int = None, + ) -> None: """ - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayPort': - """Initialize a GatewayPort object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in GatewayPort JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GatewayPort 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 + Initialize a GatewayPatchTemplate object. - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + :param GatewayPatchTemplateAuthenticationKey authentication_key: (optional) + The identity of the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original + string must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :param GatewayBfdPatchTemplate bfd_config: (optional) BFD configuration + information. + :param int bgp_asn: (optional) The autonomous system number (ASN) of Border + Gateway Protocol (BGP) configuration for the IBM side of the DL 2.0 + gateway. + :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR is the + new CIDR (Classless Inter-Domain Routing) value to be updated on customer + edge router for the DL 2.0 gateway. + Customer edge IP and IBM IP should be in the same network. Updating + customer edge router CIDR should be accompanied with IBM CIDR in the + request. Update customer edge router IP to a valid bgp_cer_cidr and + bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", + "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public + CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet + mask values. + :param str bgp_ibm_cidr: (optional) BGP IBM CIDR is the new CIDR (Classless + Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 + gateway. + IBM IP and customer edge IP should be in the same network. Updating IBM + CIDR should be accompanied with customer edge router CIDR in the request. + Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value + must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr + must have matching network and subnet mask values. + :param str connection_mode: (optional) Type of services this Gateway is + attached to. Mode transit means this Gateway will be attached to Transit + Gateway Service and direct means this Gateway will be attached to vpc or + classic connection. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :param str default_export_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param str default_import_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param bool global_: (optional) Gateways with global routing (`true`) can + connect to networks outside of their associated region. + :param str loa_reject_reason: (optional) Use this field during LOA + rejection to provide the reason for the rejection. + Only allowed for type=dedicated gateways. + :param GatewayMacsecConfigPatchTemplate macsec_config: (optional) MACsec + configuration information. When patching any macsec_config fields, no + other fields may be specified in the patch request. Contact IBM support + for access to MACsec. + A MACsec config cannot be added to a gateway created without MACsec. + :param bool metered: (optional) Metered billing option. When `true` + gateway usage is billed per gigabyte. When `false` there is no per + gigabyte usage charge, instead a flat rate is charged for the gateway. + :param str name: (optional) The unique user-defined name for this gateway. + :param str operational_status: (optional) Gateway operational status. + For gateways pending LOA approval, patch operational_status to the + appropriate value to approve or reject its LOA. When rejecting an LOA, + provide reject reasoning in `loa_reject_reason`. + Only allowed for type=dedicated gateways. + :param str patch_panel_completion_notice: (optional) Gateway patch panel + complete notification from implementation team. + :param int speed_mbps: (optional) Gateway speed in megabits per second. + :param int vlan: (optional) The VLAN to configure for this gateway. + Specify `null` to remove an existing VLAN configuration. + The gateway must have a `type` of `dedicated`. + """ + self.authentication_key = authentication_key + self.bfd_config = bfd_config + self.bgp_asn = bgp_asn + self.bgp_cer_cidr = bgp_cer_cidr + self.bgp_ibm_cidr = bgp_ibm_cidr + self.connection_mode = connection_mode + self.default_export_route_filter = default_export_route_filter + self.default_import_route_filter = default_import_route_filter + self.global_ = global_ + self.loa_reject_reason = loa_reject_reason + self.macsec_config = macsec_config + self.metered = metered + self.name = name + self.operational_status = operational_status + self.patch_panel_completion_notice = patch_panel_completion_notice + self.speed_mbps = speed_mbps + self.vlan = vlan + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayPatchTemplate': + """Initialize a GatewayPatchTemplate object from a json dictionary.""" + args = {} + if 'authentication_key' in _dict: + args['authentication_key'] = GatewayPatchTemplateAuthenticationKey.from_dict(_dict.get('authentication_key')) + if 'bfd_config' in _dict: + args['bfd_config'] = GatewayBfdPatchTemplate.from_dict(_dict.get('bfd_config')) + if 'bgp_asn' in _dict: + args['bgp_asn'] = _dict.get('bgp_asn') + if 'bgp_cer_cidr' in _dict: + args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') + if 'bgp_ibm_cidr' in _dict: + args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'connection_mode' in _dict: + args['connection_mode'] = _dict.get('connection_mode') + if 'default_export_route_filter' in _dict: + args['default_export_route_filter'] = _dict.get('default_export_route_filter') + if 'default_import_route_filter' in _dict: + args['default_import_route_filter'] = _dict.get('default_import_route_filter') + if 'global' in _dict: + args['global_'] = _dict.get('global') + if 'loa_reject_reason' in _dict: + args['loa_reject_reason'] = _dict.get('loa_reject_reason') + if 'macsec_config' in _dict: + args['macsec_config'] = GatewayMacsecConfigPatchTemplate.from_dict(_dict.get('macsec_config')) + if 'metered' in _dict: + args['metered'] = _dict.get('metered') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'operational_status' in _dict: + args['operational_status'] = _dict.get('operational_status') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') + if 'speed_mbps' in _dict: + args['speed_mbps'] = _dict.get('speed_mbps') + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayPatchTemplate 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, 'authentication_key') and self.authentication_key is not None: + if isinstance(self.authentication_key, dict): + _dict['authentication_key'] = self.authentication_key + else: + _dict['authentication_key'] = self.authentication_key.to_dict() + if hasattr(self, 'bfd_config') and self.bfd_config is not None: + if isinstance(self.bfd_config, dict): + _dict['bfd_config'] = self.bfd_config + else: + _dict['bfd_config'] = self.bfd_config.to_dict() + if hasattr(self, 'bgp_asn') and self.bgp_asn is not None: + _dict['bgp_asn'] = self.bgp_asn + if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: + _dict['bgp_cer_cidr'] = self.bgp_cer_cidr + if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: + _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'connection_mode') and self.connection_mode is not None: + _dict['connection_mode'] = self.connection_mode + if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: + _dict['default_export_route_filter'] = self.default_export_route_filter + if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: + _dict['default_import_route_filter'] = self.default_import_route_filter + if hasattr(self, 'global_') and self.global_ is not None: + _dict['global'] = self.global_ + if hasattr(self, 'loa_reject_reason') and self.loa_reject_reason is not None: + _dict['loa_reject_reason'] = self.loa_reject_reason + if hasattr(self, 'macsec_config') and self.macsec_config is not None: + if isinstance(self.macsec_config, dict): + _dict['macsec_config'] = self.macsec_config + else: + _dict['macsec_config'] = self.macsec_config.to_dict() + if hasattr(self, 'metered') and self.metered is not None: + _dict['metered'] = self.metered + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'operational_status') and self.operational_status is not None: + _dict['operational_status'] = self.operational_status + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice + if hasattr(self, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan + 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 GatewayPort object.""" + """Return a `str` version of this GatewayPatchTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayPort') -> bool: + def __eq__(self, other: 'GatewayPatchTemplate') -> 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: 'GatewayPort') -> bool: + def __ne__(self, other: 'GatewayPatchTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayPortIdentity(): + class ConnectionModeEnum(str, Enum): + """ + Type of services this Gateway is attached to. Mode transit means this Gateway will + be attached to Transit Gateway Service and direct means this Gateway will be + attached to vpc or classic connection. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. + """ + + DIRECT = 'direct' + TRANSIT = 'transit' + + + class DefaultExportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class DefaultImportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class OperationalStatusEnum(str, Enum): + """ + Gateway operational status. + For gateways pending LOA approval, patch operational_status to the appropriate + value to approve or reject its LOA. When rejecting an LOA, provide reject + reasoning in `loa_reject_reason`. + Only allowed for type=dedicated gateways. + """ + + LOA_ACCEPTED = 'loa_accepted' + LOA_REJECTED = 'loa_rejected' + + + +class GatewayPatchTemplateAuthenticationKey: """ - Select Port Label for new type=connect gateway. + The identity of the standard key to use for BGP MD5 authentication key. The key + material that you provide must be base64 encoded and original string must be maximum + 126 ASCII characters in length. To clear the optional `authentication_key` field patch + its crn to `""`. - :attr str id: port id. + :attr str crn: The CRN of the [Key Protect Standard + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Service Standard + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this + resource. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ - Initialize a GatewayPortIdentity object. + Initialize a GatewayPatchTemplateAuthenticationKey object. - :param str id: port id. + :param str crn: The CRN of the [Key Protect Standard + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Service Standard + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for + this resource. """ - self.id = id + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayPortIdentity': - """Initialize a GatewayPortIdentity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GatewayPatchTemplateAuthenticationKey': + """Initialize a GatewayPatchTemplateAuthenticationKey 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 GatewayPortIdentity JSON') + raise ValueError('Required property \'crn\' not present in GatewayPatchTemplateAuthenticationKey JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GatewayPortIdentity object from a json dictionary.""" + """Initialize a GatewayPatchTemplateAuthenticationKey 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): @@ -5318,20 +5804,139 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GatewayPortIdentity object.""" + """Return a `str` version of this GatewayPatchTemplateAuthenticationKey object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayPortIdentity') -> bool: + def __eq__(self, other: 'GatewayPatchTemplateAuthenticationKey') -> 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: 'GatewayPortIdentity') -> bool: + def __ne__(self, other: 'GatewayPatchTemplateAuthenticationKey') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayStatistic(): + +class GatewayPort: + """ + gateway port for type=connect gateways. + + :attr str id: Port Identifier. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a GatewayPort object. + + :param str id: Port Identifier. + """ + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayPort': + """Initialize a GatewayPort object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in GatewayPort JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayPort 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 GatewayPort object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayPort') -> 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: 'GatewayPort') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class GatewayPortIdentity: + """ + Select Port Label for new type=connect gateway. + + :attr str id: port id. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a GatewayPortIdentity object. + + :param str id: port id. + """ + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayPortIdentity': + """Initialize a GatewayPortIdentity object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in GatewayPortIdentity JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayPortIdentity 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 GatewayPortIdentity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayPortIdentity') -> 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: 'GatewayPortIdentity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class GatewayStatistic: """ Gateway statistics and debug commands. @@ -5340,10 +5945,12 @@ class GatewayStatistic(): :attr str type: statistic type. """ - def __init__(self, - created_at: datetime, - data: str, - type: str) -> None: + def __init__( + self, + created_at: datetime, + data: str, + type: str, + ) -> None: """ Initialize a GatewayStatistic object. @@ -5411,21 +6018,25 @@ class TypeEnum(str, Enum): """ statistic type. """ + MACSEC_MKA_SESSION = 'macsec_mka_session' MACSEC_POLICY = 'macsec_policy' MACSEC_MKA_STATISTICS = 'macsec_mka_statistics' BFD_SESSION = 'bfd_session' -class GatewayStatisticCollection(): + +class GatewayStatisticCollection: """ gateway statistics. :attr List[GatewayStatistic] statistics: Collection of gateway statistics. """ - def __init__(self, - statistics: List['GatewayStatistic']) -> None: + def __init__( + self, + statistics: List['GatewayStatistic'], + ) -> None: """ Initialize a GatewayStatisticCollection object. @@ -5479,31 +6090,38 @@ def __ne__(self, other: 'GatewayStatisticCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayStatus(): + +class GatewayStatus: """ GatewayStatus. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a GatewayStatus object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GatewayStatusGatewayBGPStatus', 'GatewayStatusGatewayBFDStatus', 'GatewayStatusGatewayLinkStatus'])) + ", ".join(['GatewayStatusGatewayBGPStatus', 'GatewayStatusGatewayBFDStatus', 'GatewayStatusGatewayLinkStatus']) + ) raise Exception(msg) -class GatewayStatusCollection(): + +class GatewayStatusCollection: """ gateway status. :attr List[GatewayStatus] status: (optional) array of status. """ - def __init__(self, - *, - status: List['GatewayStatus'] = None) -> None: + def __init__( + self, + *, + status: List['GatewayStatus'] = None, + ) -> None: """ Initialize a GatewayStatusCollection object. @@ -5555,7 +6173,8 @@ def __ne__(self, other: 'GatewayStatusCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayTemplate(): + +class GatewayTemplate: """ Create gateway template. @@ -5623,27 +6242,29 @@ class GatewayTemplate(): :attr str type: Offering type. """ - def __init__(self, - bgp_asn: int, - global_: bool, - metered: bool, - name: str, - speed_mbps: int, - type: str, - *, - as_prepends: List['AsPrependTemplate'] = None, - authentication_key: 'GatewayTemplateAuthenticationKey' = None, - bfd_config: 'GatewayBfdConfigTemplate' = None, - bgp_base_cidr: str = None, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None, - connection_mode: str = None, - default_export_route_filter: str = None, - default_import_route_filter: str = None, - export_route_filters: List['GatewayTemplateRouteFilter'] = None, - import_route_filters: List['GatewayTemplateRouteFilter'] = None, - patch_panel_completion_notice: str = None, - resource_group: 'ResourceGroupIdentity' = None) -> None: + def __init__( + self, + bgp_asn: int, + global_: bool, + metered: bool, + name: str, + speed_mbps: int, + type: str, + *, + as_prepends: List['AsPrependTemplate'] = None, + authentication_key: 'GatewayTemplateAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfigTemplate' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + connection_mode: str = None, + default_export_route_filter: str = None, + default_import_route_filter: str = None, + export_route_filters: List['GatewayTemplateRouteFilter'] = None, + import_route_filters: List['GatewayTemplateRouteFilter'] = None, + patch_panel_completion_notice: str = None, + resource_group: 'ResourceGroupIdentity' = None, + ) -> None: """ Initialize a GatewayTemplate object. @@ -5713,7 +6334,8 @@ def __init__(self, used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GatewayTemplateGatewayTypeDedicatedTemplate', 'GatewayTemplateGatewayTypeConnectTemplate'])) + ", ".join(['GatewayTemplateGatewayTypeDedicatedTemplate', 'GatewayTemplateGatewayTypeConnectTemplate']) + ) raise Exception(msg) class ConnectionModeEnum(str, Enum): @@ -5724,6 +6346,7 @@ class ConnectionModeEnum(str, Enum): property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + DIRECT = 'direct' TRANSIT = 'transit' @@ -5733,6 +6356,7 @@ class DefaultExportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' @@ -5742,6 +6366,7 @@ class DefaultImportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' @@ -5750,11 +6375,13 @@ class TypeEnum(str, Enum): """ Offering type. """ + CONNECT = 'connect' DEDICATED = 'dedicated' -class GatewayTemplateAuthenticationKey(): + +class GatewayTemplateAuthenticationKey: """ The identity of the standard key to use for BGP MD5 authentication key. The key material that you provide must be base64 encoded and original string must be maximum @@ -5768,8 +6395,10 @@ class GatewayTemplateAuthenticationKey(): resource. """ - def __init__(self, - crn: str) -> None: + def __init__( + self, + crn: str, + ) -> None: """ Initialize a GatewayTemplateAuthenticationKey object. @@ -5821,7 +6450,8 @@ def __ne__(self, other: 'GatewayTemplateAuthenticationKey') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GatewayTemplateRouteFilter(): + +class GatewayTemplateRouteFilter: """ The route filter create template within the Direct Link gateway create template. @@ -5835,12 +6465,14 @@ class GatewayTemplateRouteFilter(): prefix-set. """ - def __init__(self, - action: str, - prefix: str, - *, - ge: int = None, - le: int = None) -> None: + def __init__( + self, + action: str, + prefix: str, + *, + ge: int = None, + le: int = None, + ) -> None: """ Initialize a GatewayTemplateRouteFilter object. @@ -5917,11 +6549,13 @@ class ActionEnum(str, Enum): Determines whether routes that match the prefix-set will be allowed (permit) or rejected (deny) through the filter. """ + PERMIT = 'permit' DENY = 'deny' -class GatewayVirtualConnection(): + +class GatewayVirtualConnection: """ Virtual connection. @@ -5944,15 +6578,17 @@ class GatewayVirtualConnection(): and processes using this field must tolerate unexpected values. """ - def __init__(self, - created_at: datetime, - id: str, - name: str, - status: str, - type: str, - *, - network_account: str = None, - network_id: str = None) -> None: + def __init__( + self, + created_at: datetime, + id: str, + name: str, + status: str, + type: str, + *, + network_account: str = None, + network_id: str = None, + ) -> None: """ Initialize a GatewayVirtualConnection object. @@ -6061,6 +6697,7 @@ class StatusEnum(str, Enum): The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + PENDING = 'pending' ATTACHED = 'attached' APPROVAL_PENDING = 'approval_pending' @@ -6077,12 +6714,14 @@ class TypeEnum(str, Enum): The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + CLASSIC = 'classic' VPC = 'vpc' TRANSIT = 'transit' -class GatewayVirtualConnectionCollection(): + +class GatewayVirtualConnectionCollection: """ Virtual connection collection. @@ -6090,8 +6729,10 @@ class GatewayVirtualConnectionCollection(): array. """ - def __init__(self, - virtual_connections: List['GatewayVirtualConnection']) -> None: + def __init__( + self, + virtual_connections: List['GatewayVirtualConnection'], + ) -> None: """ Initialize a GatewayVirtualConnectionCollection object. @@ -6146,15 +6787,37 @@ def __ne__(self, other: 'GatewayVirtualConnectionCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImportRouteFilterCollection(): + +class GetGatewayResponse: + """ + GetGatewayResponse. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a GetGatewayResponse object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['GetGatewayResponseGateway', 'GetGatewayResponseCrossAccountGateway']) + ) + raise Exception(msg) + + +class ImportRouteFilterCollection: """ Collection of import route filters. :attr List[RouteFilter] import_route_filters: Array of import route filters. """ - def __init__(self, - import_route_filters: List['RouteFilter']) -> None: + def __init__( + self, + import_route_filters: List['RouteFilter'], + ) -> None: """ Initialize a ImportRouteFilterCollection object. @@ -6209,15 +6872,18 @@ def __ne__(self, other: 'ImportRouteFilterCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LocationCollection(): + +class LocationCollection: """ location collection. :attr List[LocationOutput] locations: Collection of Direct Link locations. """ - def __init__(self, - locations: List['LocationOutput']) -> None: + def __init__( + self, + locations: List['LocationOutput'], + ) -> None: """ Initialize a LocationCollection object. @@ -6271,7 +6937,8 @@ def __ne__(self, other: 'LocationCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LocationCrossConnectRouterCollection(): + +class LocationCrossConnectRouterCollection: """ List of cross connect router details. @@ -6279,9 +6946,11 @@ class LocationCrossConnectRouterCollection(): Routers for this location. """ - def __init__(self, - *, - cross_connect_routers: List['CrossConnectRouter'] = None) -> None: + def __init__( + self, + *, + cross_connect_routers: List['CrossConnectRouter'] = None, + ) -> None: """ Initialize a LocationCrossConnectRouterCollection object. @@ -6334,7 +7003,8 @@ def __ne__(self, other: 'LocationCrossConnectRouterCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LocationOutput(): + +class LocationOutput: """ location. @@ -6360,20 +7030,22 @@ class LocationOutput(): locations where provisioning is enabled. """ - def __init__(self, - display_name: str, - location_type: str, - market: str, - name: str, - offering_type: str, - provision_enabled: bool, - *, - billing_location: str = None, - building_colocation_owner: str = None, - macsec_enabled: bool = None, - market_geography: str = None, - mzr: bool = None, - vpc_region: str = None) -> None: + def __init__( + self, + display_name: str, + location_type: str, + market: str, + name: str, + offering_type: str, + provision_enabled: bool, + *, + billing_location: str = None, + building_colocation_owner: str = None, + macsec_enabled: bool = None, + market_geography: str = None, + mzr: bool = None, + vpc_region: str = None, + ) -> None: """ Initialize a LocationOutput object. @@ -6506,7 +7178,8 @@ def __ne__(self, other: 'LocationOutput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OfferingSpeed(): + +class OfferingSpeed: """ Speed. @@ -6517,11 +7190,13 @@ class OfferingSpeed(): to MACsec. """ - def __init__(self, - capabilities: List[str], - link_speed: int, - *, - macsec_enabled: bool = None) -> None: + def __init__( + self, + capabilities: List[str], + link_speed: int, + *, + macsec_enabled: bool = None, + ) -> None: """ Initialize a OfferingSpeed object. @@ -6585,15 +7260,18 @@ def __ne__(self, other: 'OfferingSpeed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OfferingSpeedCollection(): + +class OfferingSpeedCollection: """ List of speeds. :attr List[OfferingSpeed] speeds: speed list. """ - def __init__(self, - speeds: List['OfferingSpeed']) -> None: + def __init__( + self, + speeds: List['OfferingSpeed'], + ) -> None: """ Initialize a OfferingSpeedCollection object. @@ -6647,7 +7325,8 @@ def __ne__(self, other: 'OfferingSpeedCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Port(): + +class Port: """ Provider port details. @@ -6662,14 +7341,16 @@ class Port(): second. """ - def __init__(self, - direct_link_count: int, - id: str, - label: str, - location_display_name: str, - location_name: str, - provider_name: str, - supported_link_speeds: List[int]) -> None: + def __init__( + self, + direct_link_count: int, + id: str, + label: str, + location_display_name: str, + location_name: str, + provider_name: str, + supported_link_speeds: List[int], + ) -> None: """ Initialize a Port object. @@ -6767,7 +7448,8 @@ def __ne__(self, other: 'Port') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PortCollection(): + +class PortCollection: """ List of port label details. @@ -6780,13 +7462,15 @@ class PortCollection(): :attr List[Port] ports: (optional) Array of ports. """ - def __init__(self, - first: 'PortsPaginatedCollectionFirst', - limit: int, - total_count: int, - *, - next: 'PortsPaginatedCollectionNext' = None, - ports: List['Port'] = None) -> None: + def __init__( + self, + first: 'PortsPaginatedCollectionFirst', + limit: int, + total_count: int, + *, + next: 'PortsPaginatedCollectionNext' = None, + ports: List['Port'] = None, + ) -> None: """ Initialize a PortCollection object. @@ -6878,15 +7562,18 @@ def __ne__(self, other: 'PortCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PortsPaginatedCollectionFirst(): + +class PortsPaginatedCollectionFirst: """ A reference to the first page of resources. :attr str href: The URL for the first page of resources. """ - def __init__(self, - href: str) -> None: + def __init__( + self, + href: str, + ) -> None: """ Initialize a PortsPaginatedCollectionFirst object. @@ -6934,7 +7621,8 @@ def __ne__(self, other: 'PortsPaginatedCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PortsPaginatedCollectionNext(): + +class PortsPaginatedCollectionNext: """ A reference to the next page of resources; this reference is included for all pages except the last page. @@ -6943,10 +7631,12 @@ class PortsPaginatedCollectionNext(): :attr str start: (optional) start token for the next page of resources. """ - def __init__(self, - href: str, - *, - start: str = None) -> None: + def __init__( + self, + href: str, + *, + start: str = None, + ) -> None: """ Initialize a PortsPaginatedCollectionNext object. @@ -7000,7 +7690,8 @@ def __ne__(self, other: 'PortsPaginatedCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResourceGroupIdentity(): + +class ResourceGroupIdentity: """ Resource group for this resource. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -7008,8 +7699,10 @@ class ResourceGroupIdentity(): :attr str id: Resource group identifier. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a ResourceGroupIdentity object. @@ -7057,15 +7750,18 @@ def __ne__(self, other: 'ResourceGroupIdentity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResourceGroupReference(): + +class ResourceGroupReference: """ Resource group reference. :attr str id: Resource group identifier. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a ResourceGroupReference object. @@ -7113,7 +7809,8 @@ def __ne__(self, other: 'ResourceGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteFilter(): + +class RouteFilter: """ Route filter. @@ -7144,16 +7841,18 @@ class RouteFilter(): :attr datetime updated_at: The date and time the route filter was last updated. """ - def __init__(self, - action: str, - created_at: datetime, - id: str, - prefix: str, - updated_at: datetime, - *, - before: str = None, - ge: int = None, - le: int = None) -> None: + def __init__( + self, + action: str, + created_at: datetime, + id: str, + prefix: str, + updated_at: datetime, + *, + before: str = None, + ge: int = None, + le: int = None, + ) -> None: """ Initialize a RouteFilter object. @@ -7275,11 +7974,13 @@ class ActionEnum(str, Enum): Determines whether routes that match the prefix-set will be allowed (permit) or rejected (deny) through the filter. """ + PERMIT = 'permit' DENY = 'deny' -class RouteReport(): + +class RouteReport: """ route report. @@ -7302,17 +8003,19 @@ class RouteReport(): virtual connections. """ - def __init__(self, - created_at: datetime, - gateway_routes: List['RouteReportRoute'], - id: str, - on_prem_routes: List['RouteReportOnPremRoute'], - overlapping_routes: List['RouteReportOverlappingRouteGroup'], - status: str, - virtual_connection_routes: List['RouteReportConnection'], - *, - advertised_routes: List['RouteReportAdvertisedRoute'] = None, - updated_at: datetime = None) -> None: + def __init__( + self, + created_at: datetime, + gateway_routes: List['RouteReportRoute'], + id: str, + on_prem_routes: List['RouteReportOnPremRoute'], + overlapping_routes: List['RouteReportOverlappingRouteGroup'], + status: str, + virtual_connection_routes: List['RouteReportConnection'], + *, + advertised_routes: List['RouteReportAdvertisedRoute'] = None, + updated_at: datetime = None, + ) -> None: """ Initialize a RouteReport object. @@ -7464,11 +8167,13 @@ class StatusEnum(str, Enum): Route report status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + COMPLETE = 'complete' PENDING = 'pending' -class RouteReportAdvertisedRoute(): + +class RouteReportAdvertisedRoute: """ Route advertised to the on-prem network. @@ -7476,9 +8181,11 @@ class RouteReportAdvertisedRoute(): :attr str prefix: prefix. """ - def __init__(self, - as_path: str, - prefix: str) -> None: + def __init__( + self, + as_path: str, + prefix: str, + ) -> None: """ Initialize a RouteReportAdvertisedRoute object. @@ -7534,15 +8241,18 @@ def __ne__(self, other: 'RouteReportAdvertisedRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportCollection(): + +class RouteReportCollection: """ route reports. :attr List[RouteReport] route_reports: Array of route reports. """ - def __init__(self, - route_reports: List['RouteReport']) -> None: + def __init__( + self, + route_reports: List['RouteReport'], + ) -> None: """ Initialize a RouteReportCollection object. @@ -7596,7 +8306,8 @@ def __ne__(self, other: 'RouteReportCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportConnection(): + +class RouteReportConnection: """ Routes of a virtual connection. @@ -7607,12 +8318,14 @@ class RouteReportConnection(): :attr str virtual_connection_type: (optional) type of virtual connection. """ - def __init__(self, - routes: List['RouteReportVirtualConnectionRoute'], - *, - virtual_connection_id: str = None, - virtual_connection_name: str = None, - virtual_connection_type: str = None) -> None: + def __init__( + self, + routes: List['RouteReportVirtualConnectionRoute'], + *, + virtual_connection_id: str = None, + virtual_connection_name: str = None, + virtual_connection_type: str = None, + ) -> None: """ Initialize a RouteReportConnection object. @@ -7685,7 +8398,8 @@ def __ne__(self, other: 'RouteReportConnection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportOnPremRoute(): + +class RouteReportOnPremRoute: """ on-prem route. @@ -7694,11 +8408,13 @@ class RouteReportOnPremRoute(): :attr str prefix: (optional) prefix. """ - def __init__(self, - *, - as_path: str = None, - next_hop: str = None, - prefix: str = None) -> None: + def __init__( + self, + *, + as_path: str = None, + next_hop: str = None, + prefix: str = None, + ) -> None: """ Initialize a RouteReportOnPremRoute object. @@ -7756,22 +8472,27 @@ def __ne__(self, other: 'RouteReportOnPremRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportOverlappingRoute(): + +class RouteReportOverlappingRoute: """ overlapping route details. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a RouteReportOverlappingRoute object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteReportOverlappingRouteForConnection', 'RouteReportOverlappingRouteForOthers'])) + ", ".join(['RouteReportOverlappingRouteForConnection', 'RouteReportOverlappingRouteForOthers']) + ) raise Exception(msg) -class RouteReportOverlappingRouteGroup(): + +class RouteReportOverlappingRouteGroup: """ Collection of overlapping route. @@ -7779,9 +8500,11 @@ class RouteReportOverlappingRouteGroup(): connection/prefix pairs. """ - def __init__(self, - *, - routes: List['RouteReportOverlappingRoute'] = None) -> None: + def __init__( + self, + *, + routes: List['RouteReportOverlappingRoute'] = None, + ) -> None: """ Initialize a RouteReportOverlappingRouteGroup object. @@ -7834,16 +8557,19 @@ def __ne__(self, other: 'RouteReportOverlappingRouteGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportRoute(): + +class RouteReportRoute: """ route. :attr str prefix: (optional) prefix. """ - def __init__(self, - *, - prefix: str = None) -> None: + def __init__( + self, + *, + prefix: str = None, + ) -> None: """ Initialize a RouteReportRoute object. @@ -7889,7 +8615,8 @@ def __ne__(self, other: 'RouteReportRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReportVirtualConnectionRoute(): + +class RouteReportVirtualConnectionRoute: """ A route originating from an attached virtual connection. @@ -7900,11 +8627,13 @@ class RouteReportVirtualConnectionRoute(): :attr str prefix: prefix. """ - def __init__(self, - prefix: str, - *, - active: bool = None, - local_preference: str = None) -> None: + def __init__( + self, + prefix: str, + *, + active: bool = None, + local_preference: str = None, + ) -> None: """ Initialize a RouteReportVirtualConnectionRoute object. @@ -7966,7 +8695,8 @@ def __ne__(self, other: 'RouteReportVirtualConnectionRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class UpdateRouteFilterTemplate(): + +class UpdateRouteFilterTemplate: """ The route filter update template. @@ -7995,13 +8725,15 @@ class UpdateRouteFilterTemplate(): of the prefix-set. """ - def __init__(self, - *, - action: str = None, - before: str = None, - ge: int = None, - le: int = None, - prefix: str = None) -> None: + def __init__( + self, + *, + action: str = None, + before: str = None, + ge: int = None, + le: int = None, + prefix: str = None, + ) -> None: """ Initialize a UpdateRouteFilterTemplate object. @@ -8095,10 +8827,12 @@ class ActionEnum(str, Enum): Determines whether routes that match the prefix-set will be allowed (permit) or rejected (deny) through the filter. """ + PERMIT = 'permit' DENY = 'deny' + class GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate(GatewayActionTemplateUpdatesItem): """ The autonomous system number (ASN) of Border Gateway Protocol @@ -8107,9 +8841,11 @@ class GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate(GatewayActionTem :attr int bgp_asn: (optional) New gateway BGP ASN. """ - def __init__(self, - *, - bgp_asn: int = None) -> None: + def __init__( + self, + *, + bgp_asn: int = None, + ) -> None: """ Initialize a GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate object. @@ -8156,6 +8892,7 @@ def __ne__(self, other: 'GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpda """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate(GatewayActionTemplateUpdatesItem): """ Update BGP customer and IBM CIDR. @@ -8180,10 +8917,12 @@ class GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate(GatewayActionTemp subnet mask values. """ - def __init__(self, - *, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None) -> None: + def __init__( + self, + *, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + ) -> None: """ Initialize a GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate object. @@ -8253,6 +8992,7 @@ def __ne__(self, other: 'GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdat """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate(GatewayActionTemplateUpdatesItem): """ gateway speed change. @@ -8260,9 +9000,11 @@ class GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate(GatewayActionTemp :attr int speed_mbps: (optional) New gateway speed in megabits per second. """ - def __init__(self, - *, - speed_mbps: int = None) -> None: + def __init__( + self, + *, + speed_mbps: int = None, + ) -> None: """ Initialize a GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate object. @@ -8309,17 +9051,20 @@ def __ne__(self, other: 'GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdat """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate(GatewayActionTemplateUpdatesItem): """ Update VLAN for this gateway - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. :attr int vlan: (optional) VLAN to be updated for this gateway. """ - def __init__(self, - *, - vlan: int = None) -> None: + def __init__( + self, + *, + vlan: int = None, + ) -> None: """ Initialize a GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate object. @@ -8366,6 +9111,7 @@ def __ne__(self, other: 'GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate(GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem): """ The autonomous system number (ASN) of Border Gateway Protocol @@ -8374,9 +9120,11 @@ class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGateway :attr int bgp_asn: (optional) New gateway BGP ASN. """ - def __init__(self, - *, - bgp_asn: int = None) -> None: + def __init__( + self, + *, + bgp_asn: int = None, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate object. @@ -8423,6 +9171,7 @@ def __ne__(self, other: 'GatewayChangeRequestGatewayClientGatewayUpdateAttribute """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate(GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem): """ Update BGP customer and IBM CIDR. @@ -8447,10 +9196,12 @@ class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGateway subnet mask values. """ - def __init__(self, - *, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None) -> None: + def __init__( + self, + *, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate object. @@ -8520,6 +9271,7 @@ def __ne__(self, other: 'GatewayChangeRequestGatewayClientGatewayUpdateAttribute """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate(GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem): """ gateway speed change. @@ -8527,9 +9279,11 @@ class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGateway :attr int speed_mbps: (optional) New gateway speed in megabits per second. """ - def __init__(self, - *, - speed_mbps: int = None) -> None: + def __init__( + self, + *, + speed_mbps: int = None, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate object. @@ -8576,17 +9330,20 @@ def __ne__(self, other: 'GatewayChangeRequestGatewayClientGatewayUpdateAttribute """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate(GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem): """ Update VLAN for this gateway - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. :attr int vlan: (optional) VLAN to be updated for this gateway. """ - def __init__(self, - *, - vlan: int = None) -> None: + def __init__( + self, + *, + vlan: int = None, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate object. @@ -8633,6 +9390,7 @@ def __ne__(self, other: 'GatewayChangeRequestGatewayClientGatewayUpdateAttribute """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class GatewayChangeRequestGatewayClientGatewayCreate(GatewayChangeRequest): """ gateway create. @@ -8640,8 +9398,10 @@ class GatewayChangeRequestGatewayClientGatewayCreate(GatewayChangeRequest): :attr str type: type of gateway change request. """ - def __init__(self, - type: str) -> None: + def __init__( + self, + type: str, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayCreate object. @@ -8694,9 +9454,11 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + CREATE_GATEWAY = 'create_gateway' + class GatewayChangeRequestGatewayClientGatewayDelete(GatewayChangeRequest): """ gateway delete. @@ -8704,8 +9466,10 @@ class GatewayChangeRequestGatewayClientGatewayDelete(GatewayChangeRequest): :attr str type: type of gateway change request. """ - def __init__(self, - type: str) -> None: + def __init__( + self, + type: str, + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayDelete object. @@ -8758,9 +9522,11 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + DELETE_GATEWAY = 'delete_gateway' + class GatewayChangeRequestGatewayClientGatewayUpdateAttributes(GatewayChangeRequest): """ gateway attributes update. @@ -8770,9 +9536,11 @@ class GatewayChangeRequestGatewayClientGatewayUpdateAttributes(GatewayChangeRequ updates: array of pending updates. """ - def __init__(self, - type: str, - updates: List['GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem']) -> None: + def __init__( + self, + type: str, + updates: List['GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem'], + ) -> None: """ Initialize a GatewayChangeRequestGatewayClientGatewayUpdateAttributes object. @@ -8841,66 +9609,249 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + UPDATE_ATTRIBUTES = 'update_attributes' -class GatewayStatusGatewayBFDStatus(GatewayStatus): + +class GatewayCollectionGatewaysItemCrossAccountGateway(GatewayCollectionGatewaysItem): """ - Gateway bfd status. + cross-account gateway read-only view. - :attr str type: Status type. - :attr datetime updated_at: Date and time status was collected. - :attr str value: Status. + :attr str bgp_status: (optional) Gateway BGP status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr datetime bgp_status_updated_at: (optional) Date and time bgp status was + updated. + :attr str connection_mode: (optional) Type of services this Gateway is attached + to. Mode transit means this Gateway will be attached to Transit Gateway Service + and direct means this Gateway will be attached to vpc or classic connection. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr datetime created_at: The date and time resource was created. + :attr str crn: The CRN (Cloud Resource Name) of this gateway. + :attr bool cross_account: Indicates whether this gateway is cross account + gateway. + :attr str cross_connect_router: (optional) Cross connect router. Only included + on type=dedicated gateways. + :attr bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :attr str id: The unique identifier of this gateway. + :attr str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr datetime link_status_updated_at: (optional) Date and time link status was + updated. + :attr str location_display_name: Gateway location long name. + :attr str location_name: Gateway location. + :attr str name: The unique user-defined name for this gateway. + :attr str operational_status: Gateway operational status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr CrossAccountGatewayPort port: (optional) gateway port for type=connect + gateways. + :attr int speed_mbps: Gateway speed in megabits per second. + :attr str type: Offering type. The list of enumerated values for this property + may expand in the future. Code and processes using this field must tolerate + unexpected values. """ - def __init__(self, - type: str, - updated_at: datetime, - value: str) -> None: + def __init__( + self, + created_at: datetime, + crn: str, + cross_account: bool, + global_: bool, + id: str, + location_display_name: str, + location_name: str, + name: str, + operational_status: str, + speed_mbps: int, + type: str, + *, + bgp_status: str = None, + bgp_status_updated_at: datetime = None, + connection_mode: str = None, + cross_connect_router: str = None, + link_status: str = None, + link_status_updated_at: datetime = None, + port: 'CrossAccountGatewayPort' = None, + ) -> None: """ - Initialize a GatewayStatusGatewayBFDStatus object. + Initialize a GatewayCollectionGatewaysItemCrossAccountGateway object. - :param str type: Status type. - :param datetime updated_at: Date and time status was collected. - :param str value: Status. + :param datetime created_at: The date and time resource was created. + :param str crn: The CRN (Cloud Resource Name) of this gateway. + :param bool cross_account: Indicates whether this gateway is cross account + gateway. + :param bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :param str id: The unique identifier of this gateway. + :param str location_display_name: Gateway location long name. + :param str location_name: Gateway location. + :param str name: The unique user-defined name for this gateway. + :param str operational_status: Gateway operational status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param int speed_mbps: Gateway speed in megabits per second. + :param str type: Offering type. The list of enumerated values for this + property may expand in the future. Code and processes using this field + must tolerate unexpected values. + :param str bgp_status: (optional) Gateway BGP status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param datetime bgp_status_updated_at: (optional) Date and time bgp status + was updated. + :param str connection_mode: (optional) Type of services this Gateway is + attached to. Mode transit means this Gateway will be attached to Transit + Gateway Service and direct means this Gateway will be attached to vpc or + classic connection. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :param str cross_connect_router: (optional) Cross connect router. Only + included on type=dedicated gateways. + :param str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property + may expand in the future. Code and processes using this field must + tolerate unexpected values. + :param datetime link_status_updated_at: (optional) Date and time link + status was updated. + :param CrossAccountGatewayPort port: (optional) gateway port for + type=connect gateways. """ # pylint: disable=super-init-not-called + self.bgp_status = bgp_status + self.bgp_status_updated_at = bgp_status_updated_at + self.connection_mode = connection_mode + self.created_at = created_at + self.crn = crn + self.cross_account = cross_account + self.cross_connect_router = cross_connect_router + self.global_ = global_ + self.id = id + self.link_status = link_status + self.link_status_updated_at = link_status_updated_at + self.location_display_name = location_display_name + self.location_name = location_name + self.name = name + self.operational_status = operational_status + self.port = port + self.speed_mbps = speed_mbps self.type = type - self.updated_at = updated_at - self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayBFDStatus': - """Initialize a GatewayStatusGatewayBFDStatus object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GatewayCollectionGatewaysItemCrossAccountGateway': + """Initialize a GatewayCollectionGatewaysItemCrossAccountGateway object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'bgp_status' in _dict: + args['bgp_status'] = _dict.get('bgp_status') + if 'bgp_status_updated_at' in _dict: + args['bgp_status_updated_at'] = string_to_datetime(_dict.get('bgp_status_updated_at')) + if 'connection_mode' in _dict: + args['connection_mode'] = _dict.get('connection_mode') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'type\' not present in GatewayStatusGatewayBFDStatus JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'created_at\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'updated_at\' not present in GatewayStatusGatewayBFDStatus JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'crn\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'cross_account' in _dict: + args['cross_account'] = _dict.get('cross_account') else: - raise ValueError('Required property \'value\' not present in GatewayStatusGatewayBFDStatus JSON') + raise ValueError('Required property \'cross_account\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'cross_connect_router' in _dict: + args['cross_connect_router'] = _dict.get('cross_connect_router') + if 'global' in _dict: + args['global_'] = _dict.get('global') + else: + raise ValueError('Required property \'global\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'link_status' in _dict: + args['link_status'] = _dict.get('link_status') + if 'link_status_updated_at' in _dict: + args['link_status_updated_at'] = string_to_datetime(_dict.get('link_status_updated_at')) + if 'location_display_name' in _dict: + args['location_display_name'] = _dict.get('location_display_name') + else: + raise ValueError('Required property \'location_display_name\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'location_name' in _dict: + args['location_name'] = _dict.get('location_name') + else: + raise ValueError('Required property \'location_name\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'operational_status' in _dict: + args['operational_status'] = _dict.get('operational_status') + else: + raise ValueError('Required property \'operational_status\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'port' in _dict: + args['port'] = CrossAccountGatewayPort.from_dict(_dict.get('port')) + if 'speed_mbps' in _dict: + args['speed_mbps'] = _dict.get('speed_mbps') + else: + raise ValueError('Required property \'speed_mbps\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayCollectionGatewaysItemCrossAccountGateway JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GatewayStatusGatewayBFDStatus object from a json dictionary.""" + """Initialize a GatewayCollectionGatewaysItemCrossAccountGateway 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, 'bgp_status') and self.bgp_status is not None: + _dict['bgp_status'] = self.bgp_status + if hasattr(self, 'bgp_status_updated_at') and self.bgp_status_updated_at is not None: + _dict['bgp_status_updated_at'] = datetime_to_string(self.bgp_status_updated_at) + if hasattr(self, 'connection_mode') and self.connection_mode is not None: + _dict['connection_mode'] = self.connection_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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'cross_account') and self.cross_account is not None: + _dict['cross_account'] = self.cross_account + if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: + _dict['cross_connect_router'] = self.cross_connect_router + if hasattr(self, 'global_') and self.global_ is not None: + _dict['global'] = self.global_ + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'link_status') and self.link_status is not None: + _dict['link_status'] = self.link_status + if hasattr(self, 'link_status_updated_at') and self.link_status_updated_at is not None: + _dict['link_status_updated_at'] = datetime_to_string(self.link_status_updated_at) + if hasattr(self, 'location_display_name') and self.location_display_name is not None: + _dict['location_display_name'] = self.location_display_name + if hasattr(self, 'location_name') and self.location_name is not None: + _dict['location_name'] = self.location_name + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'operational_status') and self.operational_status is not None: + _dict['operational_status'] = self.operational_status + if hasattr(self, 'port') and self.port is not None: + if isinstance(self.port, dict): + _dict['port'] = self.port + else: + _dict['port'] = self.port.to_dict() + if hasattr(self, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value return _dict def _to_dict(self): @@ -8908,93 +9859,1696 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GatewayStatusGatewayBFDStatus object.""" + """Return a `str` version of this GatewayCollectionGatewaysItemCrossAccountGateway object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayStatusGatewayBFDStatus') -> bool: + def __eq__(self, other: 'GatewayCollectionGatewaysItemCrossAccountGateway') -> 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: 'GatewayStatusGatewayBFDStatus') -> bool: + def __ne__(self, other: 'GatewayCollectionGatewaysItemCrossAccountGateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class BgpStatusEnum(str, Enum): """ - Status type. + Gateway BGP status. The list of enumerated values for this property may expand in + the future. Code and processes using this field must tolerate unexpected values. """ - BFD = 'bfd' + ACTIVE = 'active' + CONNECT = 'connect' + ESTABLISHED = 'established' + IDLE = 'idle' - class ValueEnum(str, Enum): + + class ConnectionModeEnum(str, Enum): """ - Status. + Type of services this Gateway is attached to. Mode transit means this Gateway will + be attached to Transit Gateway Service and direct means this Gateway will be + attached to vpc or classic connection. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. """ - NOT_AVAILABLE = 'not_available' - INIT = 'init' - UP = 'up' + + DIRECT = 'direct' + TRANSIT = 'transit' + + + class LinkStatusEnum(str, Enum): + """ + Gateway link status. Only included on type=dedicated gateways. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + """ + DOWN = 'down' + UP = 'up' -class GatewayStatusGatewayBGPStatus(GatewayStatus): + class OperationalStatusEnum(str, Enum): + """ + Gateway operational status. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + """ + + AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' + AWAITING_LOA = 'awaiting_loa' + CONFIGURING = 'configuring' + CREATE_PENDING = 'create_pending' + CREATE_REJECTED = 'create_rejected' + COMPLETION_NOTICE_APPROVED = 'completion_notice_approved' + COMPLETION_NOTICE_RECEIVED = 'completion_notice_received' + COMPLETION_NOTICE_REJECTED = 'completion_notice_rejected' + DELETE_PENDING = 'delete_pending' + LOA_ACCEPTED = 'loa_accepted' + LOA_CREATED = 'loa_created' + LOA_REJECTED = 'loa_rejected' + PROVISIONED = 'provisioned' + + + class TypeEnum(str, Enum): + """ + Offering type. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected values. + """ + + CONNECT = 'connect' + DEDICATED = 'dedicated' + + + +class GatewayCollectionGatewaysItemGateway(GatewayCollectionGatewaysItem): """ - Gateway bgp status. + gateway. - :attr str type: Status type. - :attr datetime updated_at: Date and time status was collected. - :attr str value: Status. + :attr List[AsPrepend] as_prepends: (optional) array of AS Prepend information. + :attr GatewayAuthenticationKey authentication_key: (optional) The identity of + the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original string + must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :attr GatewayBfdConfig bfd_config: (optional) BFD configuration information. + :attr int bgp_asn: Customer BGP ASN. + :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR is deprecated and + no longer recognized by the Direct Link APIs. + See bgp_cer_cidr and bgp_ibm_cidr fields instead for IP related information. + Deprecated field bgp_base_cidr will be removed from the API specificiation after + 15-MAR-2021. + :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + :attr int bgp_ibm_asn: (optional) IBM BGP ASN. + :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR. + :attr str bgp_status: (optional) Gateway BGP status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr datetime bgp_status_updated_at: (optional) Date and time bgp status was + updated. + :attr str carrier_name: (optional) Carrier name. Only set for type=dedicated + gateways. + :attr GatewayChangeRequest change_request: (optional) Changes pending approval + for provider managed Direct Link Connect gateways. + :attr str completion_notice_reject_reason: (optional) Reason for completion + notice rejection. Only included on type=dedicated gateways with a rejected + completion notice. + :attr str connection_mode: (optional) Type of services this Gateway is attached + to. Mode transit means this Gateway will be attached to Transit Gateway Service + and direct means this Gateway will be attached to vpc or classic connection. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr datetime created_at: The date and time resource was created. + :attr str crn: The CRN (Cloud Resource Name) of this gateway. + :attr bool cross_account: Indicates whether this gateway is cross account + gateway. + :attr str cross_connect_router: (optional) Cross connect router. Only included + on type=dedicated gateways. + :attr str customer_name: (optional) Customer name. Only set for type=dedicated + gateways. + :attr str default_export_route_filter: The default directional route filter + action that applies to routes that do not match any directional route filters. + :attr str default_import_route_filter: The default directional route filter + action that applies to routes that do not match any directional route filters. + :attr bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :attr str id: The unique identifier of this gateway. + :attr str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr datetime link_status_updated_at: (optional) Date and time link status was + updated. + :attr str location_display_name: Gateway location long name. + :attr str location_name: Gateway location. + :attr GatewayMacsecConfig macsec_config: (optional) MACsec configuration + information. For Dedicated Gateways with MACsec configured, return + configuration information. Contact IBM support for access to MACsec. + :attr bool metered: Metered billing option. When `true` gateway usage is billed + per gigabyte. When `false` there is no per gigabyte usage charge, instead a + flat rate is charged for the gateway. + :attr str name: The unique user-defined name for this gateway. + :attr str operational_status: Gateway operational status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr GatewayPort port: (optional) gateway port for type=connect gateways. + :attr bool provider_api_managed: (optional) Indicates whether gateway changes + must be made via a provider portal. + :attr ResourceGroupReference resource_group: (optional) Resource group + reference. + :attr int speed_mbps: Gateway speed in megabits per second. + :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete + notification from implementation team. + :attr str type: Offering type. The list of enumerated values for this property + may expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr int vlan: (optional) VLAN configured for this gateway. If there is no vlan + configured for the gateway, the vlan will be absent. This property will also be + absent if this gateway's `crn` is in another account. + """ + + def __init__( + self, + bgp_asn: int, + created_at: datetime, + crn: str, + cross_account: bool, + default_export_route_filter: str, + default_import_route_filter: str, + global_: bool, + id: str, + location_display_name: str, + location_name: str, + metered: bool, + name: str, + operational_status: str, + speed_mbps: int, + type: str, + *, + as_prepends: List['AsPrepend'] = None, + authentication_key: 'GatewayAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfig' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_asn: int = None, + bgp_ibm_cidr: str = None, + bgp_status: str = None, + bgp_status_updated_at: datetime = None, + carrier_name: str = None, + change_request: 'GatewayChangeRequest' = None, + completion_notice_reject_reason: str = None, + connection_mode: str = None, + cross_connect_router: str = None, + customer_name: str = None, + link_status: str = None, + link_status_updated_at: datetime = None, + macsec_config: 'GatewayMacsecConfig' = None, + port: 'GatewayPort' = None, + provider_api_managed: bool = None, + resource_group: 'ResourceGroupReference' = None, + patch_panel_completion_notice: str = None, + vlan: int = None, + ) -> None: + """ + Initialize a GatewayCollectionGatewaysItemGateway object. + + :param int bgp_asn: Customer BGP ASN. + :param datetime created_at: The date and time resource was created. + :param str crn: The CRN (Cloud Resource Name) of this gateway. + :param bool cross_account: Indicates whether this gateway is cross account + gateway. + :param str default_export_route_filter: The default directional route + filter action that applies to routes that do not match any directional + route filters. + :param str default_import_route_filter: The default directional route + filter action that applies to routes that do not match any directional + route filters. + :param bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :param str id: The unique identifier of this gateway. + :param str location_display_name: Gateway location long name. + :param str location_name: Gateway location. + :param bool metered: Metered billing option. When `true` gateway usage is + billed per gigabyte. When `false` there is no per gigabyte usage charge, + instead a flat rate is charged for the gateway. + :param str name: The unique user-defined name for this gateway. + :param str operational_status: Gateway operational status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param int speed_mbps: Gateway speed in megabits per second. + :param str type: Offering type. The list of enumerated values for this + property may expand in the future. Code and processes using this field + must tolerate unexpected values. + :param List[AsPrepend] as_prepends: (optional) array of AS Prepend + information. + :param GatewayAuthenticationKey authentication_key: (optional) The identity + of the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original + string must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :param GatewayBfdConfig bfd_config: (optional) BFD configuration + information. + :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR is + deprecated and no longer recognized by the Direct Link APIs. + See bgp_cer_cidr and bgp_ibm_cidr fields instead for IP related + information. + Deprecated field bgp_base_cidr will be removed from the API specificiation + after 15-MAR-2021. + :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + :param int bgp_ibm_asn: (optional) IBM BGP ASN. + :param str bgp_ibm_cidr: (optional) BGP IBM CIDR. + :param str bgp_status: (optional) Gateway BGP status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param datetime bgp_status_updated_at: (optional) Date and time bgp status + was updated. + :param str carrier_name: (optional) Carrier name. Only set for + type=dedicated gateways. + :param GatewayChangeRequest change_request: (optional) Changes pending + approval for provider managed Direct Link Connect gateways. + :param str completion_notice_reject_reason: (optional) Reason for + completion notice rejection. Only included on type=dedicated gateways with + a rejected completion notice. + :param str connection_mode: (optional) Type of services this Gateway is + attached to. Mode transit means this Gateway will be attached to Transit + Gateway Service and direct means this Gateway will be attached to vpc or + classic connection. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :param str cross_connect_router: (optional) Cross connect router. Only + included on type=dedicated gateways. + :param str customer_name: (optional) Customer name. Only set for + type=dedicated gateways. + :param str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property + may expand in the future. Code and processes using this field must + tolerate unexpected values. + :param datetime link_status_updated_at: (optional) Date and time link + status was updated. + :param GatewayMacsecConfig macsec_config: (optional) MACsec configuration + information. For Dedicated Gateways with MACsec configured, return + configuration information. Contact IBM support for access to MACsec. + :param GatewayPort port: (optional) gateway port for type=connect gateways. + :param bool provider_api_managed: (optional) Indicates whether gateway + changes must be made via a provider portal. + :param ResourceGroupReference resource_group: (optional) Resource group + reference. + :param str patch_panel_completion_notice: (optional) Gateway patch panel + complete notification from implementation team. + :param int vlan: (optional) VLAN configured for this gateway. If there is + no vlan configured for the gateway, the vlan will be absent. This property + will also be absent if this gateway's `crn` is in another account. + """ + # pylint: disable=super-init-not-called + self.as_prepends = as_prepends + self.authentication_key = authentication_key + self.bfd_config = bfd_config + self.bgp_asn = bgp_asn + self.bgp_base_cidr = bgp_base_cidr + self.bgp_cer_cidr = bgp_cer_cidr + self.bgp_ibm_asn = bgp_ibm_asn + self.bgp_ibm_cidr = bgp_ibm_cidr + self.bgp_status = bgp_status + self.bgp_status_updated_at = bgp_status_updated_at + self.carrier_name = carrier_name + self.change_request = change_request + self.completion_notice_reject_reason = completion_notice_reject_reason + self.connection_mode = connection_mode + self.created_at = created_at + self.crn = crn + self.cross_account = cross_account + self.cross_connect_router = cross_connect_router + self.customer_name = customer_name + self.default_export_route_filter = default_export_route_filter + self.default_import_route_filter = default_import_route_filter + self.global_ = global_ + self.id = id + self.link_status = link_status + self.link_status_updated_at = link_status_updated_at + self.location_display_name = location_display_name + self.location_name = location_name + self.macsec_config = macsec_config + self.metered = metered + self.name = name + self.operational_status = operational_status + self.port = port + self.provider_api_managed = provider_api_managed + self.resource_group = resource_group + self.speed_mbps = speed_mbps + self.patch_panel_completion_notice = patch_panel_completion_notice + self.type = type + self.vlan = vlan + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayCollectionGatewaysItemGateway': + """Initialize a GatewayCollectionGatewaysItemGateway object from a json dictionary.""" + args = {} + if 'as_prepends' in _dict: + args['as_prepends'] = [AsPrepend.from_dict(v) for v in _dict.get('as_prepends')] + if 'authentication_key' in _dict: + args['authentication_key'] = GatewayAuthenticationKey.from_dict(_dict.get('authentication_key')) + if 'bfd_config' in _dict: + args['bfd_config'] = GatewayBfdConfig.from_dict(_dict.get('bfd_config')) + if 'bgp_asn' in _dict: + args['bgp_asn'] = _dict.get('bgp_asn') + else: + raise ValueError('Required property \'bgp_asn\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'bgp_base_cidr' in _dict: + args['bgp_base_cidr'] = _dict.get('bgp_base_cidr') + if 'bgp_cer_cidr' in _dict: + args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') + if 'bgp_ibm_asn' in _dict: + args['bgp_ibm_asn'] = _dict.get('bgp_ibm_asn') + if 'bgp_ibm_cidr' in _dict: + args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'bgp_status' in _dict: + args['bgp_status'] = _dict.get('bgp_status') + if 'bgp_status_updated_at' in _dict: + args['bgp_status_updated_at'] = string_to_datetime(_dict.get('bgp_status_updated_at')) + if 'carrier_name' in _dict: + args['carrier_name'] = _dict.get('carrier_name') + if 'change_request' in _dict: + args['change_request'] = _dict.get('change_request') + if 'completion_notice_reject_reason' in _dict: + args['completion_notice_reject_reason'] = _dict.get('completion_notice_reject_reason') + if 'connection_mode' in _dict: + args['connection_mode'] = _dict.get('connection_mode') + 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 GatewayCollectionGatewaysItemGateway JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'cross_account' in _dict: + args['cross_account'] = _dict.get('cross_account') + else: + raise ValueError('Required property \'cross_account\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'cross_connect_router' in _dict: + args['cross_connect_router'] = _dict.get('cross_connect_router') + if 'customer_name' in _dict: + args['customer_name'] = _dict.get('customer_name') + if 'default_export_route_filter' in _dict: + args['default_export_route_filter'] = _dict.get('default_export_route_filter') + else: + raise ValueError('Required property \'default_export_route_filter\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'default_import_route_filter' in _dict: + args['default_import_route_filter'] = _dict.get('default_import_route_filter') + else: + raise ValueError('Required property \'default_import_route_filter\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'global' in _dict: + args['global_'] = _dict.get('global') + else: + raise ValueError('Required property \'global\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'link_status' in _dict: + args['link_status'] = _dict.get('link_status') + if 'link_status_updated_at' in _dict: + args['link_status_updated_at'] = string_to_datetime(_dict.get('link_status_updated_at')) + if 'location_display_name' in _dict: + args['location_display_name'] = _dict.get('location_display_name') + else: + raise ValueError('Required property \'location_display_name\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'location_name' in _dict: + args['location_name'] = _dict.get('location_name') + else: + raise ValueError('Required property \'location_name\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'macsec_config' in _dict: + args['macsec_config'] = GatewayMacsecConfig.from_dict(_dict.get('macsec_config')) + if 'metered' in _dict: + args['metered'] = _dict.get('metered') + else: + raise ValueError('Required property \'metered\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'operational_status' in _dict: + args['operational_status'] = _dict.get('operational_status') + else: + raise ValueError('Required property \'operational_status\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'port' in _dict: + args['port'] = GatewayPort.from_dict(_dict.get('port')) + if 'provider_api_managed' in _dict: + args['provider_api_managed'] = _dict.get('provider_api_managed') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + if 'speed_mbps' in _dict: + args['speed_mbps'] = _dict.get('speed_mbps') + else: + raise ValueError('Required property \'speed_mbps\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayCollectionGatewaysItemGateway JSON') + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayCollectionGatewaysItemGateway 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, 'as_prepends') and self.as_prepends is not None: + as_prepends_list = [] + for v in self.as_prepends: + if isinstance(v, dict): + as_prepends_list.append(v) + else: + as_prepends_list.append(v.to_dict()) + _dict['as_prepends'] = as_prepends_list + if hasattr(self, 'authentication_key') and self.authentication_key is not None: + if isinstance(self.authentication_key, dict): + _dict['authentication_key'] = self.authentication_key + else: + _dict['authentication_key'] = self.authentication_key.to_dict() + if hasattr(self, 'bfd_config') and self.bfd_config is not None: + if isinstance(self.bfd_config, dict): + _dict['bfd_config'] = self.bfd_config + else: + _dict['bfd_config'] = self.bfd_config.to_dict() + if hasattr(self, 'bgp_asn') and self.bgp_asn is not None: + _dict['bgp_asn'] = self.bgp_asn + if hasattr(self, 'bgp_base_cidr') and self.bgp_base_cidr is not None: + _dict['bgp_base_cidr'] = self.bgp_base_cidr + if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: + _dict['bgp_cer_cidr'] = self.bgp_cer_cidr + if hasattr(self, 'bgp_ibm_asn') and self.bgp_ibm_asn is not None: + _dict['bgp_ibm_asn'] = self.bgp_ibm_asn + if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: + _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'bgp_status') and self.bgp_status is not None: + _dict['bgp_status'] = self.bgp_status + if hasattr(self, 'bgp_status_updated_at') and self.bgp_status_updated_at is not None: + _dict['bgp_status_updated_at'] = datetime_to_string(self.bgp_status_updated_at) + if hasattr(self, 'carrier_name') and self.carrier_name is not None: + _dict['carrier_name'] = self.carrier_name + if hasattr(self, 'change_request') and self.change_request is not None: + if isinstance(self.change_request, dict): + _dict['change_request'] = self.change_request + else: + _dict['change_request'] = self.change_request.to_dict() + if hasattr(self, 'completion_notice_reject_reason') and self.completion_notice_reject_reason is not None: + _dict['completion_notice_reject_reason'] = self.completion_notice_reject_reason + if hasattr(self, 'connection_mode') and self.connection_mode is not None: + _dict['connection_mode'] = self.connection_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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'cross_account') and self.cross_account is not None: + _dict['cross_account'] = self.cross_account + if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: + _dict['cross_connect_router'] = self.cross_connect_router + if hasattr(self, 'customer_name') and self.customer_name is not None: + _dict['customer_name'] = self.customer_name + if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: + _dict['default_export_route_filter'] = self.default_export_route_filter + if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: + _dict['default_import_route_filter'] = self.default_import_route_filter + if hasattr(self, 'global_') and self.global_ is not None: + _dict['global'] = self.global_ + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'link_status') and self.link_status is not None: + _dict['link_status'] = self.link_status + if hasattr(self, 'link_status_updated_at') and self.link_status_updated_at is not None: + _dict['link_status_updated_at'] = datetime_to_string(self.link_status_updated_at) + if hasattr(self, 'location_display_name') and self.location_display_name is not None: + _dict['location_display_name'] = self.location_display_name + if hasattr(self, 'location_name') and self.location_name is not None: + _dict['location_name'] = self.location_name + if hasattr(self, 'macsec_config') and self.macsec_config is not None: + if isinstance(self.macsec_config, dict): + _dict['macsec_config'] = self.macsec_config + else: + _dict['macsec_config'] = self.macsec_config.to_dict() + if hasattr(self, 'metered') and self.metered is not None: + _dict['metered'] = self.metered + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'operational_status') and self.operational_status is not None: + _dict['operational_status'] = self.operational_status + if hasattr(self, 'port') and self.port is not None: + if isinstance(self.port, dict): + _dict['port'] = self.port + else: + _dict['port'] = self.port.to_dict() + if hasattr(self, 'provider_api_managed') and self.provider_api_managed is not None: + _dict['provider_api_managed'] = self.provider_api_managed + 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, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan + 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 GatewayCollectionGatewaysItemGateway object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayCollectionGatewaysItemGateway') -> 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: 'GatewayCollectionGatewaysItemGateway') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class BgpStatusEnum(str, Enum): + """ + Gateway BGP status. The list of enumerated values for this property may expand in + the future. Code and processes using this field must tolerate unexpected values. + """ + + ACTIVE = 'active' + CONNECT = 'connect' + ESTABLISHED = 'established' + IDLE = 'idle' + + + class ConnectionModeEnum(str, Enum): + """ + Type of services this Gateway is attached to. Mode transit means this Gateway will + be attached to Transit Gateway Service and direct means this Gateway will be + attached to vpc or classic connection. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. + """ + + DIRECT = 'direct' + TRANSIT = 'transit' + + + class DefaultExportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class DefaultImportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class LinkStatusEnum(str, Enum): + """ + Gateway link status. Only included on type=dedicated gateways. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + """ + + DOWN = 'down' + UP = 'up' + + + class OperationalStatusEnum(str, Enum): + """ + Gateway operational status. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + """ + + AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' + AWAITING_LOA = 'awaiting_loa' + CONFIGURING = 'configuring' + CREATE_PENDING = 'create_pending' + CREATE_REJECTED = 'create_rejected' + COMPLETION_NOTICE_APPROVED = 'completion_notice_approved' + COMPLETION_NOTICE_RECEIVED = 'completion_notice_received' + COMPLETION_NOTICE_REJECTED = 'completion_notice_rejected' + DELETE_PENDING = 'delete_pending' + LOA_ACCEPTED = 'loa_accepted' + LOA_CREATED = 'loa_created' + LOA_REJECTED = 'loa_rejected' + PROVISIONED = 'provisioned' + + + class TypeEnum(str, Enum): + """ + Offering type. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected values. + """ + + CONNECT = 'connect' + DEDICATED = 'dedicated' + + + +class GatewayStatusGatewayBFDStatus(GatewayStatus): + """ + Gateway bfd status. + + :attr str type: Status type. + :attr datetime updated_at: Date and time status was collected. + :attr str value: Status. + """ + + def __init__( + self, + type: str, + updated_at: datetime, + value: str, + ) -> None: + """ + Initialize a GatewayStatusGatewayBFDStatus object. + + :param str type: Status type. + :param datetime updated_at: Date and time status was collected. + :param str value: Status. + """ + # pylint: disable=super-init-not-called + self.type = type + self.updated_at = updated_at + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayBFDStatus': + """Initialize a GatewayStatusGatewayBFDStatus object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayStatusGatewayBFDStatus 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 GatewayStatusGatewayBFDStatus JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in GatewayStatusGatewayBFDStatus JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayStatusGatewayBFDStatus 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, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + 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 GatewayStatusGatewayBFDStatus object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayStatusGatewayBFDStatus') -> 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: 'GatewayStatusGatewayBFDStatus') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + Status type. + """ + + BFD = 'bfd' + + + class ValueEnum(str, Enum): + """ + Status. + """ + + NOT_AVAILABLE = 'not_available' + INIT = 'init' + UP = 'up' + DOWN = 'down' + + + +class GatewayStatusGatewayBGPStatus(GatewayStatus): + """ + Gateway bgp status. + + :attr str type: Status type. + :attr datetime updated_at: Date and time status was collected. + :attr str value: Status. + """ + + def __init__( + self, + type: str, + updated_at: datetime, + value: str, + ) -> None: + """ + Initialize a GatewayStatusGatewayBGPStatus object. + + :param str type: Status type. + :param datetime updated_at: Date and time status was collected. + :param str value: Status. + """ + # pylint: disable=super-init-not-called + self.type = type + self.updated_at = updated_at + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayBGPStatus': + """Initialize a GatewayStatusGatewayBGPStatus object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayStatusGatewayBGPStatus 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 GatewayStatusGatewayBGPStatus JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in GatewayStatusGatewayBGPStatus JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayStatusGatewayBGPStatus 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, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + 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 GatewayStatusGatewayBGPStatus object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayStatusGatewayBGPStatus') -> 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: 'GatewayStatusGatewayBGPStatus') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + Status type. + """ + + BGP = 'bgp' + + + class ValueEnum(str, Enum): + """ + Status. + """ + + ACTIVE = 'active' + CONNECT = 'connect' + ESTABLISHED = 'established' + IDLE = 'idle' + + + +class GatewayStatusGatewayLinkStatus(GatewayStatus): + """ + Gateway link status. Only available for dedicated gateways. + + :attr str type: Status type. + :attr datetime updated_at: Date and time status was collected. + :attr str value: Status. + """ + + def __init__( + self, + type: str, + updated_at: datetime, + value: str, + ) -> None: + """ + Initialize a GatewayStatusGatewayLinkStatus object. + + :param str type: Status type. + :param datetime updated_at: Date and time status was collected. + :param str value: Status. + """ + # pylint: disable=super-init-not-called + self.type = type + self.updated_at = updated_at + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayLinkStatus': + """Initialize a GatewayStatusGatewayLinkStatus object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayStatusGatewayLinkStatus 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 GatewayStatusGatewayLinkStatus JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in GatewayStatusGatewayLinkStatus JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayStatusGatewayLinkStatus 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, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + 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 GatewayStatusGatewayLinkStatus object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayStatusGatewayLinkStatus') -> 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: 'GatewayStatusGatewayLinkStatus') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + Status type. + """ + + LINK = 'link' + + + class ValueEnum(str, Enum): + """ + Status. + """ + + UP = 'up' + DOWN = 'down' + + + +class GatewayTemplateGatewayTypeConnectTemplate(GatewayTemplate): + """ + Gateway fields specific to type=connect gateway create. + + :attr List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend + configuration information. + :attr GatewayTemplateAuthenticationKey authentication_key: (optional) + :attr GatewayBfdConfigTemplate bfd_config: (optional) + :attr int bgp_asn: BGP ASN. + :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. + Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how to + create a gateway using either automatic or explicit IP assignment. Any + bgp_base_cidr value set will be ignored. + Deprecated field bgp_base_cidr will be removed from the API specificiation after + 15-MAR-2021. + :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the + value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must + have matching network and subnet mask values. + :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the + value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must + have matching network and subnet mask values. + :attr str connection_mode: (optional) Type of services this Gateway is attached + to. Mode transit means this Gateway will be attached to Transit Gateway Service + and direct means this Gateway will be attached to vpc or classic connection. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr str default_export_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr str default_import_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr List[GatewayTemplateRouteFilter] export_route_filters: (optional) Array of + directional route filters for a Direct Link gateway. When creating a gateway or + replacing existing route filters, the order of the items in the array will set + the ordering of the list of route filters. + :attr bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :attr List[GatewayTemplateRouteFilter] import_route_filters: (optional) Array of + directional route filters for a Direct Link gateway. When creating a gateway or + replacing existing route filters, the order of the items in the array will set + the ordering of the list of route filters. + :attr bool metered: Metered billing option. When `true` gateway usage is billed + per gigabyte. When `false` there is no per gigabyte usage charge, instead a + flat rate is charged for the gateway. + :attr str name: The unique user-defined name for this gateway. + :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete + notification from implementation team. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int speed_mbps: Gateway speed in megabits per second. + :attr str type: Offering type. + :attr GatewayPortIdentity port: Select Port Label for new type=connect gateway. + """ + + def __init__( + self, + bgp_asn: int, + global_: bool, + metered: bool, + name: str, + speed_mbps: int, + type: str, + port: 'GatewayPortIdentity', + *, + as_prepends: List['AsPrependTemplate'] = None, + authentication_key: 'GatewayTemplateAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfigTemplate' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + connection_mode: str = None, + default_export_route_filter: str = None, + default_import_route_filter: str = None, + export_route_filters: List['GatewayTemplateRouteFilter'] = None, + import_route_filters: List['GatewayTemplateRouteFilter'] = None, + patch_panel_completion_notice: str = None, + resource_group: 'ResourceGroupIdentity' = None, + ) -> None: + """ + Initialize a GatewayTemplateGatewayTypeConnectTemplate object. + + :param int bgp_asn: BGP ASN. + :param bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :param bool metered: Metered billing option. When `true` gateway usage is + billed per gigabyte. When `false` there is no per gigabyte usage charge, + instead a flat rate is charged for the gateway. + :param str name: The unique user-defined name for this gateway. + :param int speed_mbps: Gateway speed in megabits per second. + :param str type: Offering type. + :param GatewayPortIdentity port: Select Port Label for new type=connect + gateway. + :param List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend + configuration information. + :param GatewayTemplateAuthenticationKey authentication_key: (optional) + :param GatewayBfdConfigTemplate bfd_config: (optional) + :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. + Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how + to create a gateway using either automatic or explicit IP assignment. Any + bgp_base_cidr value set will be ignored. + Deprecated field bgp_base_cidr will be removed from the API specificiation + after 15-MAR-2021. + :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, + the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", + "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr + and bgp_ibm_cidr must have matching network and subnet mask values. + :param str bgp_ibm_cidr: (optional) BGP IBM CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, + the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", + "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr + and bgp_ibm_cidr must have matching network and subnet mask values. + :param str connection_mode: (optional) Type of services this Gateway is + attached to. Mode transit means this Gateway will be attached to Transit + Gateway Service and direct means this Gateway will be attached to vpc or + classic connection. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :param str default_export_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param str default_import_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param List[GatewayTemplateRouteFilter] export_route_filters: (optional) + Array of directional route filters for a Direct Link gateway. When creating + a gateway or replacing existing route filters, the order of the items in + the array will set the ordering of the list of route filters. + :param List[GatewayTemplateRouteFilter] import_route_filters: (optional) + Array of directional route filters for a Direct Link gateway. When creating + a gateway or replacing existing route filters, the order of the items in + the array will set the ordering of the list of route filters. + :param str patch_panel_completion_notice: (optional) Gateway patch panel + complete notification from implementation team. + :param ResourceGroupIdentity resource_group: (optional) + """ + # pylint: disable=super-init-not-called + self.as_prepends = as_prepends + self.authentication_key = authentication_key + self.bfd_config = bfd_config + self.bgp_asn = bgp_asn + self.bgp_base_cidr = bgp_base_cidr + self.bgp_cer_cidr = bgp_cer_cidr + self.bgp_ibm_cidr = bgp_ibm_cidr + self.connection_mode = connection_mode + self.default_export_route_filter = default_export_route_filter + self.default_import_route_filter = default_import_route_filter + self.export_route_filters = export_route_filters + self.global_ = global_ + self.import_route_filters = import_route_filters + self.metered = metered + self.name = name + self.patch_panel_completion_notice = patch_panel_completion_notice + self.resource_group = resource_group + self.speed_mbps = speed_mbps + self.type = type + self.port = port + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GatewayTemplateGatewayTypeConnectTemplate': + """Initialize a GatewayTemplateGatewayTypeConnectTemplate object from a json dictionary.""" + args = {} + if 'as_prepends' in _dict: + args['as_prepends'] = [AsPrependTemplate.from_dict(v) for v in _dict.get('as_prepends')] + if 'authentication_key' in _dict: + args['authentication_key'] = GatewayTemplateAuthenticationKey.from_dict(_dict.get('authentication_key')) + if 'bfd_config' in _dict: + args['bfd_config'] = GatewayBfdConfigTemplate.from_dict(_dict.get('bfd_config')) + if 'bgp_asn' in _dict: + args['bgp_asn'] = _dict.get('bgp_asn') + else: + raise ValueError('Required property \'bgp_asn\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'bgp_base_cidr' in _dict: + args['bgp_base_cidr'] = _dict.get('bgp_base_cidr') + if 'bgp_cer_cidr' in _dict: + args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') + if 'bgp_ibm_cidr' in _dict: + args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'connection_mode' in _dict: + args['connection_mode'] = _dict.get('connection_mode') + if 'default_export_route_filter' in _dict: + args['default_export_route_filter'] = _dict.get('default_export_route_filter') + if 'default_import_route_filter' in _dict: + args['default_import_route_filter'] = _dict.get('default_import_route_filter') + if 'export_route_filters' in _dict: + args['export_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('export_route_filters')] + if 'global' in _dict: + args['global_'] = _dict.get('global') + else: + raise ValueError('Required property \'global\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'import_route_filters' in _dict: + args['import_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('import_route_filters')] + if 'metered' in _dict: + args['metered'] = _dict.get('metered') + else: + raise ValueError('Required property \'metered\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupIdentity.from_dict(_dict.get('resource_group')) + if 'speed_mbps' in _dict: + args['speed_mbps'] = _dict.get('speed_mbps') + else: + raise ValueError('Required property \'speed_mbps\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + if 'port' in _dict: + args['port'] = GatewayPortIdentity.from_dict(_dict.get('port')) + else: + raise ValueError('Required property \'port\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GatewayTemplateGatewayTypeConnectTemplate 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, 'as_prepends') and self.as_prepends is not None: + as_prepends_list = [] + for v in self.as_prepends: + if isinstance(v, dict): + as_prepends_list.append(v) + else: + as_prepends_list.append(v.to_dict()) + _dict['as_prepends'] = as_prepends_list + if hasattr(self, 'authentication_key') and self.authentication_key is not None: + if isinstance(self.authentication_key, dict): + _dict['authentication_key'] = self.authentication_key + else: + _dict['authentication_key'] = self.authentication_key.to_dict() + if hasattr(self, 'bfd_config') and self.bfd_config is not None: + if isinstance(self.bfd_config, dict): + _dict['bfd_config'] = self.bfd_config + else: + _dict['bfd_config'] = self.bfd_config.to_dict() + if hasattr(self, 'bgp_asn') and self.bgp_asn is not None: + _dict['bgp_asn'] = self.bgp_asn + if hasattr(self, 'bgp_base_cidr') and self.bgp_base_cidr is not None: + _dict['bgp_base_cidr'] = self.bgp_base_cidr + if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: + _dict['bgp_cer_cidr'] = self.bgp_cer_cidr + if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: + _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'connection_mode') and self.connection_mode is not None: + _dict['connection_mode'] = self.connection_mode + if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: + _dict['default_export_route_filter'] = self.default_export_route_filter + if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: + _dict['default_import_route_filter'] = self.default_import_route_filter + if hasattr(self, 'export_route_filters') and self.export_route_filters is not None: + export_route_filters_list = [] + for v in self.export_route_filters: + if isinstance(v, dict): + export_route_filters_list.append(v) + else: + export_route_filters_list.append(v.to_dict()) + _dict['export_route_filters'] = export_route_filters_list + if hasattr(self, 'global_') and self.global_ is not None: + _dict['global'] = self.global_ + if hasattr(self, 'import_route_filters') and self.import_route_filters is not None: + import_route_filters_list = [] + for v in self.import_route_filters: + if isinstance(v, dict): + import_route_filters_list.append(v) + else: + import_route_filters_list.append(v.to_dict()) + _dict['import_route_filters'] = import_route_filters_list + if hasattr(self, 'metered') and self.metered is not None: + _dict['metered'] = self.metered + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice + 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, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'port') and self.port is not None: + if isinstance(self.port, dict): + _dict['port'] = self.port + else: + _dict['port'] = self.port.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 GatewayTemplateGatewayTypeConnectTemplate object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GatewayTemplateGatewayTypeConnectTemplate') -> 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: 'GatewayTemplateGatewayTypeConnectTemplate') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ConnectionModeEnum(str, Enum): + """ + Type of services this Gateway is attached to. Mode transit means this Gateway will + be attached to Transit Gateway Service and direct means this Gateway will be + attached to vpc or classic connection. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. + """ + + DIRECT = 'direct' + TRANSIT = 'transit' + + + class DefaultExportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class DefaultImportRouteFilterEnum(str, Enum): + """ + The default directional route filter action that applies to routes that do not + match any directional route filters. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + class TypeEnum(str, Enum): + """ + Offering type. + """ + + CONNECT = 'connect' + DEDICATED = 'dedicated' + + + +class GatewayTemplateGatewayTypeDedicatedTemplate(GatewayTemplate): + """ + Gateway fields specific to type=dedicated gateway create. + + :attr List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend + configuration information. + :attr GatewayTemplateAuthenticationKey authentication_key: (optional) + :attr GatewayBfdConfigTemplate bfd_config: (optional) + :attr int bgp_asn: BGP ASN. + :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. + Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how to + create a gateway using either automatic or explicit IP assignment. Any + bgp_base_cidr value set will be ignored. + Deprecated field bgp_base_cidr will be removed from the API specificiation after + 15-MAR-2021. + :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the + value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must + have matching network and subnet mask values. + :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the + value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", + "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must + have matching network and subnet mask values. + :attr str connection_mode: (optional) Type of services this Gateway is attached + to. Mode transit means this Gateway will be attached to Transit Gateway Service + and direct means this Gateway will be attached to vpc or classic connection. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr str default_export_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr str default_import_route_filter: (optional) The default directional route + filter action that applies to routes that do not match any directional route + filters. + :attr List[GatewayTemplateRouteFilter] export_route_filters: (optional) Array of + directional route filters for a Direct Link gateway. When creating a gateway or + replacing existing route filters, the order of the items in the array will set + the ordering of the list of route filters. + :attr bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :attr List[GatewayTemplateRouteFilter] import_route_filters: (optional) Array of + directional route filters for a Direct Link gateway. When creating a gateway or + replacing existing route filters, the order of the items in the array will set + the ordering of the list of route filters. + :attr bool metered: Metered billing option. When `true` gateway usage is billed + per gigabyte. When `false` there is no per gigabyte usage charge, instead a + flat rate is charged for the gateway. + :attr str name: The unique user-defined name for this gateway. + :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete + notification from implementation team. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int speed_mbps: Gateway speed in megabits per second. + :attr str type: Offering type. + :attr str carrier_name: Carrier name. + :attr str cross_connect_router: Cross connect router. + :attr str customer_name: Customer name. + :attr str location_name: Gateway location. + :attr GatewayMacsecConfigTemplate macsec_config: (optional) MACsec configuration + information. Contact IBM support for access to MACsec. + :attr int vlan: (optional) The VLAN to configure for this gateway. """ - def __init__(self, - type: str, - updated_at: datetime, - value: str) -> None: + def __init__( + self, + bgp_asn: int, + global_: bool, + metered: bool, + name: str, + speed_mbps: int, + type: str, + carrier_name: str, + cross_connect_router: str, + customer_name: str, + location_name: str, + *, + as_prepends: List['AsPrependTemplate'] = None, + authentication_key: 'GatewayTemplateAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfigTemplate' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + connection_mode: str = None, + default_export_route_filter: str = None, + default_import_route_filter: str = None, + export_route_filters: List['GatewayTemplateRouteFilter'] = None, + import_route_filters: List['GatewayTemplateRouteFilter'] = None, + patch_panel_completion_notice: str = None, + resource_group: 'ResourceGroupIdentity' = None, + macsec_config: 'GatewayMacsecConfigTemplate' = None, + vlan: int = None, + ) -> None: """ - Initialize a GatewayStatusGatewayBGPStatus object. + Initialize a GatewayTemplateGatewayTypeDedicatedTemplate object. - :param str type: Status type. - :param datetime updated_at: Date and time status was collected. - :param str value: Status. + :param int bgp_asn: BGP ASN. + :param bool global_: Gateways with global routing (`true`) can connect to + networks outside their associated region. + :param bool metered: Metered billing option. When `true` gateway usage is + billed per gigabyte. When `false` there is no per gigabyte usage charge, + instead a flat rate is charged for the gateway. + :param str name: The unique user-defined name for this gateway. + :param int speed_mbps: Gateway speed in megabits per second. + :param str type: Offering type. + :param str carrier_name: Carrier name. + :param str cross_connect_router: Cross connect router. + :param str customer_name: Customer name. + :param str location_name: Gateway location. + :param List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend + configuration information. + :param GatewayTemplateAuthenticationKey authentication_key: (optional) + :param GatewayBfdConfigTemplate bfd_config: (optional) + :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. + Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how + to create a gateway using either automatic or explicit IP assignment. Any + bgp_base_cidr value set will be ignored. + Deprecated field bgp_base_cidr will be removed from the API specificiation + after 15-MAR-2021. + :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, + the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", + "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr + and bgp_ibm_cidr must have matching network and subnet mask values. + :param str bgp_ibm_cidr: (optional) BGP IBM CIDR. + For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will + automatically select values for bgp_cer_cidr and bgp_ibm_cidr. + For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, + the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", + "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr + and bgp_ibm_cidr must have matching network and subnet mask values. + :param str connection_mode: (optional) Type of services this Gateway is + attached to. Mode transit means this Gateway will be attached to Transit + Gateway Service and direct means this Gateway will be attached to vpc or + classic connection. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :param str default_export_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param str default_import_route_filter: (optional) The default directional + route filter action that applies to routes that do not match any + directional route filters. + :param List[GatewayTemplateRouteFilter] export_route_filters: (optional) + Array of directional route filters for a Direct Link gateway. When creating + a gateway or replacing existing route filters, the order of the items in + the array will set the ordering of the list of route filters. + :param List[GatewayTemplateRouteFilter] import_route_filters: (optional) + Array of directional route filters for a Direct Link gateway. When creating + a gateway or replacing existing route filters, the order of the items in + the array will set the ordering of the list of route filters. + :param str patch_panel_completion_notice: (optional) Gateway patch panel + complete notification from implementation team. + :param ResourceGroupIdentity resource_group: (optional) + :param GatewayMacsecConfigTemplate macsec_config: (optional) MACsec + configuration information. Contact IBM support for access to MACsec. + :param int vlan: (optional) The VLAN to configure for this gateway. """ # pylint: disable=super-init-not-called + self.as_prepends = as_prepends + self.authentication_key = authentication_key + self.bfd_config = bfd_config + self.bgp_asn = bgp_asn + self.bgp_base_cidr = bgp_base_cidr + self.bgp_cer_cidr = bgp_cer_cidr + self.bgp_ibm_cidr = bgp_ibm_cidr + self.connection_mode = connection_mode + self.default_export_route_filter = default_export_route_filter + self.default_import_route_filter = default_import_route_filter + self.export_route_filters = export_route_filters + self.global_ = global_ + self.import_route_filters = import_route_filters + self.metered = metered + self.name = name + self.patch_panel_completion_notice = patch_panel_completion_notice + self.resource_group = resource_group + self.speed_mbps = speed_mbps self.type = type - self.updated_at = updated_at - self.value = value + self.carrier_name = carrier_name + self.cross_connect_router = cross_connect_router + self.customer_name = customer_name + self.location_name = location_name + self.macsec_config = macsec_config + self.vlan = vlan @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayBGPStatus': - """Initialize a GatewayStatusGatewayBGPStatus object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GatewayTemplateGatewayTypeDedicatedTemplate': + """Initialize a GatewayTemplateGatewayTypeDedicatedTemplate object from a json dictionary.""" args = {} + if 'as_prepends' in _dict: + args['as_prepends'] = [AsPrependTemplate.from_dict(v) for v in _dict.get('as_prepends')] + if 'authentication_key' in _dict: + args['authentication_key'] = GatewayTemplateAuthenticationKey.from_dict(_dict.get('authentication_key')) + if 'bfd_config' in _dict: + args['bfd_config'] = GatewayBfdConfigTemplate.from_dict(_dict.get('bfd_config')) + if 'bgp_asn' in _dict: + args['bgp_asn'] = _dict.get('bgp_asn') + else: + raise ValueError('Required property \'bgp_asn\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'bgp_base_cidr' in _dict: + args['bgp_base_cidr'] = _dict.get('bgp_base_cidr') + if 'bgp_cer_cidr' in _dict: + args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') + if 'bgp_ibm_cidr' in _dict: + args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'connection_mode' in _dict: + args['connection_mode'] = _dict.get('connection_mode') + if 'default_export_route_filter' in _dict: + args['default_export_route_filter'] = _dict.get('default_export_route_filter') + if 'default_import_route_filter' in _dict: + args['default_import_route_filter'] = _dict.get('default_import_route_filter') + if 'export_route_filters' in _dict: + args['export_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('export_route_filters')] + if 'global' in _dict: + args['global_'] = _dict.get('global') + else: + raise ValueError('Required property \'global\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'import_route_filters' in _dict: + args['import_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('import_route_filters')] + if 'metered' in _dict: + args['metered'] = _dict.get('metered') + else: + raise ValueError('Required property \'metered\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupIdentity.from_dict(_dict.get('resource_group')) + if 'speed_mbps' in _dict: + args['speed_mbps'] = _dict.get('speed_mbps') + else: + raise ValueError('Required property \'speed_mbps\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in GatewayStatusGatewayBGPStatus JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'type\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'carrier_name' in _dict: + args['carrier_name'] = _dict.get('carrier_name') else: - raise ValueError('Required property \'updated_at\' not present in GatewayStatusGatewayBGPStatus JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'carrier_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'cross_connect_router' in _dict: + args['cross_connect_router'] = _dict.get('cross_connect_router') else: - raise ValueError('Required property \'value\' not present in GatewayStatusGatewayBGPStatus JSON') + raise ValueError('Required property \'cross_connect_router\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'customer_name' in _dict: + args['customer_name'] = _dict.get('customer_name') + else: + raise ValueError('Required property \'customer_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'location_name' in _dict: + args['location_name'] = _dict.get('location_name') + else: + raise ValueError('Required property \'location_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + if 'macsec_config' in _dict: + args['macsec_config'] = GatewayMacsecConfigTemplate.from_dict(_dict.get('macsec_config')) + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GatewayStatusGatewayBGPStatus object from a json dictionary.""" + """Initialize a GatewayTemplateGatewayTypeDedicatedTemplate 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, 'as_prepends') and self.as_prepends is not None: + as_prepends_list = [] + for v in self.as_prepends: + if isinstance(v, dict): + as_prepends_list.append(v) + else: + as_prepends_list.append(v.to_dict()) + _dict['as_prepends'] = as_prepends_list + if hasattr(self, 'authentication_key') and self.authentication_key is not None: + if isinstance(self.authentication_key, dict): + _dict['authentication_key'] = self.authentication_key + else: + _dict['authentication_key'] = self.authentication_key.to_dict() + if hasattr(self, 'bfd_config') and self.bfd_config is not None: + if isinstance(self.bfd_config, dict): + _dict['bfd_config'] = self.bfd_config + else: + _dict['bfd_config'] = self.bfd_config.to_dict() + if hasattr(self, 'bgp_asn') and self.bgp_asn is not None: + _dict['bgp_asn'] = self.bgp_asn + if hasattr(self, 'bgp_base_cidr') and self.bgp_base_cidr is not None: + _dict['bgp_base_cidr'] = self.bgp_base_cidr + if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: + _dict['bgp_cer_cidr'] = self.bgp_cer_cidr + if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: + _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'connection_mode') and self.connection_mode is not None: + _dict['connection_mode'] = self.connection_mode + if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: + _dict['default_export_route_filter'] = self.default_export_route_filter + if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: + _dict['default_import_route_filter'] = self.default_import_route_filter + if hasattr(self, 'export_route_filters') and self.export_route_filters is not None: + export_route_filters_list = [] + for v in self.export_route_filters: + if isinstance(v, dict): + export_route_filters_list.append(v) + else: + export_route_filters_list.append(v.to_dict()) + _dict['export_route_filters'] = export_route_filters_list + if hasattr(self, 'global_') and self.global_ is not None: + _dict['global'] = self.global_ + if hasattr(self, 'import_route_filters') and self.import_route_filters is not None: + import_route_filters_list = [] + for v in self.import_route_filters: + if isinstance(v, dict): + import_route_filters_list.append(v) + else: + import_route_filters_list.append(v.to_dict()) + _dict['import_route_filters'] = import_route_filters_list + if hasattr(self, 'metered') and self.metered is not None: + _dict['metered'] = self.metered + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice + 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, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'carrier_name') and self.carrier_name is not None: + _dict['carrier_name'] = self.carrier_name + if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: + _dict['cross_connect_router'] = self.cross_connect_router + if hasattr(self, 'customer_name') and self.customer_name is not None: + _dict['customer_name'] = self.customer_name + if hasattr(self, 'location_name') and self.location_name is not None: + _dict['location_name'] = self.location_name + if hasattr(self, 'macsec_config') and self.macsec_config is not None: + if isinstance(self.macsec_config, dict): + _dict['macsec_config'] = self.macsec_config + else: + _dict['macsec_config'] = self.macsec_config.to_dict() + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan return _dict def _to_dict(self): @@ -9002,434 +11556,300 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GatewayStatusGatewayBGPStatus object.""" + """Return a `str` version of this GatewayTemplateGatewayTypeDedicatedTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayStatusGatewayBGPStatus') -> bool: + def __eq__(self, other: 'GatewayTemplateGatewayTypeDedicatedTemplate') -> 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: 'GatewayStatusGatewayBGPStatus') -> bool: + def __ne__(self, other: 'GatewayTemplateGatewayTypeDedicatedTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ConnectionModeEnum(str, Enum): """ - Status type. + Type of services this Gateway is attached to. Mode transit means this Gateway will + be attached to Transit Gateway Service and direct means this Gateway will be + attached to vpc or classic connection. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. """ - BGP = 'bgp' + + DIRECT = 'direct' + TRANSIT = 'transit' - class ValueEnum(str, Enum): + class DefaultExportRouteFilterEnum(str, Enum): """ - Status. + The default directional route filter action that applies to routes that do not + match any directional route filters. """ - ACTIVE = 'active' - CONNECT = 'connect' - ESTABLISHED = 'established' - IDLE = 'idle' + PERMIT = 'permit' + DENY = 'deny' -class GatewayStatusGatewayLinkStatus(GatewayStatus): - """ - Gateway link status. Only available for dedicated gateways. - - :attr str type: Status type. - :attr datetime updated_at: Date and time status was collected. - :attr str value: Status. - """ - def __init__(self, - type: str, - updated_at: datetime, - value: str) -> None: + class DefaultImportRouteFilterEnum(str, Enum): """ - Initialize a GatewayStatusGatewayLinkStatus object. - - :param str type: Status type. - :param datetime updated_at: Date and time status was collected. - :param str value: Status. + The default directional route filter action that applies to routes that do not + match any directional route filters. """ - # pylint: disable=super-init-not-called - self.type = type - self.updated_at = updated_at - self.value = value - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayStatusGatewayLinkStatus': - """Initialize a GatewayStatusGatewayLinkStatus object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in GatewayStatusGatewayLinkStatus 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 GatewayStatusGatewayLinkStatus JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') - else: - raise ValueError('Required property \'value\' not present in GatewayStatusGatewayLinkStatus JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GatewayStatusGatewayLinkStatus 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, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - 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 GatewayStatusGatewayLinkStatus object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayStatusGatewayLinkStatus') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + PERMIT = 'permit' + DENY = 'deny' - def __ne__(self, other: 'GatewayStatusGatewayLinkStatus') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other class TypeEnum(str, Enum): """ - Status type. + Offering type. """ - LINK = 'link' + CONNECT = 'connect' + DEDICATED = 'dedicated' - class ValueEnum(str, Enum): - """ - Status. - """ - UP = 'up' - DOWN = 'down' -class GatewayTemplateGatewayTypeConnectTemplate(GatewayTemplate): +class GetGatewayResponseCrossAccountGateway(GetGatewayResponse): """ - Gateway fields specific to type=connect gateway create. + cross-account gateway read-only view. - :attr List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend - configuration information. - :attr GatewayTemplateAuthenticationKey authentication_key: (optional) - :attr GatewayBfdConfigTemplate bfd_config: (optional) - :attr int bgp_asn: BGP ASN. - :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. - Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how to - create a gateway using either automatic or explicit IP assignment. Any - bgp_base_cidr value set will be ignored. - Deprecated field bgp_base_cidr will be removed from the API specificiation after - 15-MAR-2021. - :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the - value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", - "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must - have matching network and subnet mask values. - :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the - value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", - "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must - have matching network and subnet mask values. + :attr str bgp_status: (optional) Gateway BGP status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr datetime bgp_status_updated_at: (optional) Date and time bgp status was + updated. :attr str connection_mode: (optional) Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr str default_export_route_filter: (optional) The default directional route - filter action that applies to routes that do not match any directional route - filters. - :attr str default_import_route_filter: (optional) The default directional route - filter action that applies to routes that do not match any directional route - filters. - :attr List[GatewayTemplateRouteFilter] export_route_filters: (optional) Array of - directional route filters for a Direct Link gateway. When creating a gateway or - replacing existing route filters, the order of the items in the array will set - the ordering of the list of route filters. + :attr datetime created_at: The date and time resource was created. + :attr str crn: The CRN (Cloud Resource Name) of this gateway. + :attr bool cross_account: Indicates whether this gateway is cross account + gateway. + :attr str cross_connect_router: (optional) Cross connect router. Only included + on type=dedicated gateways. :attr bool global_: Gateways with global routing (`true`) can connect to networks outside their associated region. - :attr List[GatewayTemplateRouteFilter] import_route_filters: (optional) Array of - directional route filters for a Direct Link gateway. When creating a gateway or - replacing existing route filters, the order of the items in the array will set - the ordering of the list of route filters. - :attr bool metered: Metered billing option. When `true` gateway usage is billed - per gigabyte. When `false` there is no per gigabyte usage charge, instead a - flat rate is charged for the gateway. + :attr str id: The unique identifier of this gateway. + :attr str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr datetime link_status_updated_at: (optional) Date and time link status was + updated. + :attr str location_display_name: Gateway location long name. + :attr str location_name: Gateway location. :attr str name: The unique user-defined name for this gateway. - :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete - notification from implementation team. - :attr ResourceGroupIdentity resource_group: (optional) + :attr str operational_status: Gateway operational status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr CrossAccountGatewayPort port: (optional) gateway port for type=connect + gateways. :attr int speed_mbps: Gateway speed in megabits per second. - :attr str type: Offering type. - :attr GatewayPortIdentity port: Select Port Label for new type=connect gateway. + :attr str type: Offering type. The list of enumerated values for this property + may expand in the future. Code and processes using this field must tolerate + unexpected values. """ - def __init__(self, - bgp_asn: int, - global_: bool, - metered: bool, - name: str, - speed_mbps: int, - type: str, - port: 'GatewayPortIdentity', - *, - as_prepends: List['AsPrependTemplate'] = None, - authentication_key: 'GatewayTemplateAuthenticationKey' = None, - bfd_config: 'GatewayBfdConfigTemplate' = None, - bgp_base_cidr: str = None, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None, - connection_mode: str = None, - default_export_route_filter: str = None, - default_import_route_filter: str = None, - export_route_filters: List['GatewayTemplateRouteFilter'] = None, - import_route_filters: List['GatewayTemplateRouteFilter'] = None, - patch_panel_completion_notice: str = None, - resource_group: 'ResourceGroupIdentity' = None) -> None: + def __init__( + self, + created_at: datetime, + crn: str, + cross_account: bool, + global_: bool, + id: str, + location_display_name: str, + location_name: str, + name: str, + operational_status: str, + speed_mbps: int, + type: str, + *, + bgp_status: str = None, + bgp_status_updated_at: datetime = None, + connection_mode: str = None, + cross_connect_router: str = None, + link_status: str = None, + link_status_updated_at: datetime = None, + port: 'CrossAccountGatewayPort' = None, + ) -> None: """ - Initialize a GatewayTemplateGatewayTypeConnectTemplate object. + Initialize a GetGatewayResponseCrossAccountGateway object. - :param int bgp_asn: BGP ASN. + :param datetime created_at: The date and time resource was created. + :param str crn: The CRN (Cloud Resource Name) of this gateway. + :param bool cross_account: Indicates whether this gateway is cross account + gateway. :param bool global_: Gateways with global routing (`true`) can connect to networks outside their associated region. - :param bool metered: Metered billing option. When `true` gateway usage is - billed per gigabyte. When `false` there is no per gigabyte usage charge, - instead a flat rate is charged for the gateway. + :param str id: The unique identifier of this gateway. + :param str location_display_name: Gateway location long name. + :param str location_name: Gateway location. :param str name: The unique user-defined name for this gateway. + :param str operational_status: Gateway operational status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. :param int speed_mbps: Gateway speed in megabits per second. - :param str type: Offering type. - :param GatewayPortIdentity port: Select Port Label for new type=connect - gateway. - :param List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend - configuration information. - :param GatewayTemplateAuthenticationKey authentication_key: (optional) - :param GatewayBfdConfigTemplate bfd_config: (optional) - :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. - Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how - to create a gateway using either automatic or explicit IP assignment. Any - bgp_base_cidr value set will be ignored. - Deprecated field bgp_base_cidr will be removed from the API specificiation - after 15-MAR-2021. - :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, - the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", - "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr - and bgp_ibm_cidr must have matching network and subnet mask values. - :param str bgp_ibm_cidr: (optional) BGP IBM CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, - the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", - "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr - and bgp_ibm_cidr must have matching network and subnet mask values. + :param str type: Offering type. The list of enumerated values for this + property may expand in the future. Code and processes using this field + must tolerate unexpected values. + :param str bgp_status: (optional) Gateway BGP status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param datetime bgp_status_updated_at: (optional) Date and time bgp status + was updated. :param str connection_mode: (optional) Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param str default_export_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param str default_import_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param List[GatewayTemplateRouteFilter] export_route_filters: (optional) - Array of directional route filters for a Direct Link gateway. When creating - a gateway or replacing existing route filters, the order of the items in - the array will set the ordering of the list of route filters. - :param List[GatewayTemplateRouteFilter] import_route_filters: (optional) - Array of directional route filters for a Direct Link gateway. When creating - a gateway or replacing existing route filters, the order of the items in - the array will set the ordering of the list of route filters. - :param str patch_panel_completion_notice: (optional) Gateway patch panel - complete notification from implementation team. - :param ResourceGroupIdentity resource_group: (optional) + :param str cross_connect_router: (optional) Cross connect router. Only + included on type=dedicated gateways. + :param str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property + may expand in the future. Code and processes using this field must + tolerate unexpected values. + :param datetime link_status_updated_at: (optional) Date and time link + status was updated. + :param CrossAccountGatewayPort port: (optional) gateway port for + type=connect gateways. """ # pylint: disable=super-init-not-called - self.as_prepends = as_prepends - self.authentication_key = authentication_key - self.bfd_config = bfd_config - self.bgp_asn = bgp_asn - self.bgp_base_cidr = bgp_base_cidr - self.bgp_cer_cidr = bgp_cer_cidr - self.bgp_ibm_cidr = bgp_ibm_cidr + self.bgp_status = bgp_status + self.bgp_status_updated_at = bgp_status_updated_at self.connection_mode = connection_mode - self.default_export_route_filter = default_export_route_filter - self.default_import_route_filter = default_import_route_filter - self.export_route_filters = export_route_filters + self.created_at = created_at + self.crn = crn + self.cross_account = cross_account + self.cross_connect_router = cross_connect_router self.global_ = global_ - self.import_route_filters = import_route_filters - self.metered = metered + self.id = id + self.link_status = link_status + self.link_status_updated_at = link_status_updated_at + self.location_display_name = location_display_name + self.location_name = location_name self.name = name - self.patch_panel_completion_notice = patch_panel_completion_notice - self.resource_group = resource_group + self.operational_status = operational_status + self.port = port self.speed_mbps = speed_mbps self.type = type - self.port = port @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayTemplateGatewayTypeConnectTemplate': - """Initialize a GatewayTemplateGatewayTypeConnectTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GetGatewayResponseCrossAccountGateway': + """Initialize a GetGatewayResponseCrossAccountGateway object from a json dictionary.""" args = {} - if 'as_prepends' in _dict: - args['as_prepends'] = [AsPrependTemplate.from_dict(v) for v in _dict.get('as_prepends')] - if 'authentication_key' in _dict: - args['authentication_key'] = GatewayTemplateAuthenticationKey.from_dict(_dict.get('authentication_key')) - if 'bfd_config' in _dict: - args['bfd_config'] = GatewayBfdConfigTemplate.from_dict(_dict.get('bfd_config')) - if 'bgp_asn' in _dict: - args['bgp_asn'] = _dict.get('bgp_asn') - else: - raise ValueError('Required property \'bgp_asn\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') - if 'bgp_base_cidr' in _dict: - args['bgp_base_cidr'] = _dict.get('bgp_base_cidr') - if 'bgp_cer_cidr' in _dict: - args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') - if 'bgp_ibm_cidr' in _dict: - args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'bgp_status' in _dict: + args['bgp_status'] = _dict.get('bgp_status') + if 'bgp_status_updated_at' in _dict: + args['bgp_status_updated_at'] = string_to_datetime(_dict.get('bgp_status_updated_at')) if 'connection_mode' in _dict: args['connection_mode'] = _dict.get('connection_mode') - if 'default_export_route_filter' in _dict: - args['default_export_route_filter'] = _dict.get('default_export_route_filter') - if 'default_import_route_filter' in _dict: - args['default_import_route_filter'] = _dict.get('default_import_route_filter') - if 'export_route_filters' in _dict: - args['export_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('export_route_filters')] + 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 GetGatewayResponseCrossAccountGateway JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'cross_account' in _dict: + args['cross_account'] = _dict.get('cross_account') + else: + raise ValueError('Required property \'cross_account\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'cross_connect_router' in _dict: + args['cross_connect_router'] = _dict.get('cross_connect_router') if 'global' in _dict: args['global_'] = _dict.get('global') else: - raise ValueError('Required property \'global\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') - if 'import_route_filters' in _dict: - args['import_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('import_route_filters')] - if 'metered' in _dict: - args['metered'] = _dict.get('metered') + raise ValueError('Required property \'global\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'metered\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + raise ValueError('Required property \'id\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'link_status' in _dict: + args['link_status'] = _dict.get('link_status') + if 'link_status_updated_at' in _dict: + args['link_status_updated_at'] = string_to_datetime(_dict.get('link_status_updated_at')) + if 'location_display_name' in _dict: + args['location_display_name'] = _dict.get('location_display_name') + else: + raise ValueError('Required property \'location_display_name\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'location_name' in _dict: + args['location_name'] = _dict.get('location_name') + else: + raise ValueError('Required property \'location_name\' not present in GetGatewayResponseCrossAccountGateway JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') - if 'patch_panel_completion_notice' in _dict: - args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupIdentity.from_dict(_dict.get('resource_group')) + raise ValueError('Required property \'name\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'operational_status' in _dict: + args['operational_status'] = _dict.get('operational_status') + else: + raise ValueError('Required property \'operational_status\' not present in GetGatewayResponseCrossAccountGateway JSON') + if 'port' in _dict: + args['port'] = CrossAccountGatewayPort.from_dict(_dict.get('port')) if 'speed_mbps' in _dict: args['speed_mbps'] = _dict.get('speed_mbps') else: - raise ValueError('Required property \'speed_mbps\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + raise ValueError('Required property \'speed_mbps\' not present in GetGatewayResponseCrossAccountGateway JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') - if 'port' in _dict: - args['port'] = GatewayPortIdentity.from_dict(_dict.get('port')) - else: - raise ValueError('Required property \'port\' not present in GatewayTemplateGatewayTypeConnectTemplate JSON') + raise ValueError('Required property \'type\' not present in GetGatewayResponseCrossAccountGateway JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GatewayTemplateGatewayTypeConnectTemplate object from a json dictionary.""" + """Initialize a GetGatewayResponseCrossAccountGateway 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, 'as_prepends') and self.as_prepends is not None: - as_prepends_list = [] - for v in self.as_prepends: - if isinstance(v, dict): - as_prepends_list.append(v) - else: - as_prepends_list.append(v.to_dict()) - _dict['as_prepends'] = as_prepends_list - if hasattr(self, 'authentication_key') and self.authentication_key is not None: - if isinstance(self.authentication_key, dict): - _dict['authentication_key'] = self.authentication_key - else: - _dict['authentication_key'] = self.authentication_key.to_dict() - if hasattr(self, 'bfd_config') and self.bfd_config is not None: - if isinstance(self.bfd_config, dict): - _dict['bfd_config'] = self.bfd_config - else: - _dict['bfd_config'] = self.bfd_config.to_dict() - if hasattr(self, 'bgp_asn') and self.bgp_asn is not None: - _dict['bgp_asn'] = self.bgp_asn - if hasattr(self, 'bgp_base_cidr') and self.bgp_base_cidr is not None: - _dict['bgp_base_cidr'] = self.bgp_base_cidr - if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: - _dict['bgp_cer_cidr'] = self.bgp_cer_cidr - if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: - _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'bgp_status') and self.bgp_status is not None: + _dict['bgp_status'] = self.bgp_status + if hasattr(self, 'bgp_status_updated_at') and self.bgp_status_updated_at is not None: + _dict['bgp_status_updated_at'] = datetime_to_string(self.bgp_status_updated_at) if hasattr(self, 'connection_mode') and self.connection_mode is not None: _dict['connection_mode'] = self.connection_mode - if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: - _dict['default_export_route_filter'] = self.default_export_route_filter - if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: - _dict['default_import_route_filter'] = self.default_import_route_filter - if hasattr(self, 'export_route_filters') and self.export_route_filters is not None: - export_route_filters_list = [] - for v in self.export_route_filters: - if isinstance(v, dict): - export_route_filters_list.append(v) - else: - export_route_filters_list.append(v.to_dict()) - _dict['export_route_filters'] = export_route_filters_list + 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, 'cross_account') and self.cross_account is not None: + _dict['cross_account'] = self.cross_account + if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: + _dict['cross_connect_router'] = self.cross_connect_router if hasattr(self, 'global_') and self.global_ is not None: _dict['global'] = self.global_ - if hasattr(self, 'import_route_filters') and self.import_route_filters is not None: - import_route_filters_list = [] - for v in self.import_route_filters: - if isinstance(v, dict): - import_route_filters_list.append(v) - else: - import_route_filters_list.append(v.to_dict()) - _dict['import_route_filters'] = import_route_filters_list - if hasattr(self, 'metered') and self.metered is not None: - _dict['metered'] = self.metered + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'link_status') and self.link_status is not None: + _dict['link_status'] = self.link_status + if hasattr(self, 'link_status_updated_at') and self.link_status_updated_at is not None: + _dict['link_status_updated_at'] = datetime_to_string(self.link_status_updated_at) + if hasattr(self, 'location_display_name') and self.location_display_name is not None: + _dict['location_display_name'] = self.location_display_name + if hasattr(self, 'location_name') and self.location_name is not None: + _dict['location_name'] = self.location_name if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: - _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice - 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, 'speed_mbps') and self.speed_mbps is not None: - _dict['speed_mbps'] = self.speed_mbps - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'operational_status') and self.operational_status is not None: + _dict['operational_status'] = self.operational_status if hasattr(self, 'port') and self.port is not None: if isinstance(self.port, dict): _dict['port'] = self.port else: _dict['port'] = self.port.to_dict() + if hasattr(self, 'speed_mbps') and self.speed_mbps is not None: + _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -9437,19 +11857,31 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GatewayTemplateGatewayTypeConnectTemplate object.""" + """Return a `str` version of this GetGatewayResponseCrossAccountGateway object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayTemplateGatewayTypeConnectTemplate') -> bool: + def __eq__(self, other: 'GetGatewayResponseCrossAccountGateway') -> 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: 'GatewayTemplateGatewayTypeConnectTemplate') -> bool: + def __ne__(self, other: 'GetGatewayResponseCrossAccountGateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class BgpStatusEnum(str, Enum): + """ + Gateway BGP status. The list of enumerated values for this property may expand in + the future. Code and processes using this field must tolerate unexpected values. + """ + + ACTIVE = 'active' + CONNECT = 'connect' + ESTABLISHED = 'established' + IDLE = 'idle' + + class ConnectionModeEnum(str, Enum): """ Type of services this Gateway is attached to. Mode transit means this Gateway will @@ -9458,194 +11890,272 @@ class ConnectionModeEnum(str, Enum): property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + DIRECT = 'direct' TRANSIT = 'transit' - class DefaultExportRouteFilterEnum(str, Enum): + class LinkStatusEnum(str, Enum): """ - The default directional route filter action that applies to routes that do not - match any directional route filters. + Gateway link status. Only included on type=dedicated gateways. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. """ - PERMIT = 'permit' - DENY = 'deny' + DOWN = 'down' + UP = 'up' - class DefaultImportRouteFilterEnum(str, Enum): + + class OperationalStatusEnum(str, Enum): """ - The default directional route filter action that applies to routes that do not - match any directional route filters. + Gateway operational status. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. """ - PERMIT = 'permit' - DENY = 'deny' + + AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' + AWAITING_LOA = 'awaiting_loa' + CONFIGURING = 'configuring' + CREATE_PENDING = 'create_pending' + CREATE_REJECTED = 'create_rejected' + COMPLETION_NOTICE_APPROVED = 'completion_notice_approved' + COMPLETION_NOTICE_RECEIVED = 'completion_notice_received' + COMPLETION_NOTICE_REJECTED = 'completion_notice_rejected' + DELETE_PENDING = 'delete_pending' + LOA_ACCEPTED = 'loa_accepted' + LOA_CREATED = 'loa_created' + LOA_REJECTED = 'loa_rejected' + PROVISIONED = 'provisioned' class TypeEnum(str, Enum): """ - Offering type. + Offering type. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected values. """ + CONNECT = 'connect' DEDICATED = 'dedicated' -class GatewayTemplateGatewayTypeDedicatedTemplate(GatewayTemplate): + +class GetGatewayResponseGateway(GetGatewayResponse): """ - Gateway fields specific to type=dedicated gateway create. + gateway. - :attr List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend - configuration information. - :attr GatewayTemplateAuthenticationKey authentication_key: (optional) - :attr GatewayBfdConfigTemplate bfd_config: (optional) - :attr int bgp_asn: BGP ASN. - :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. - Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how to - create a gateway using either automatic or explicit IP assignment. Any - bgp_base_cidr value set will be ignored. + :attr List[AsPrepend] as_prepends: (optional) array of AS Prepend information. + :attr GatewayAuthenticationKey authentication_key: (optional) The identity of + the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original string + must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :attr GatewayBfdConfig bfd_config: (optional) BFD configuration information. + :attr int bgp_asn: Customer BGP ASN. + :attr str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR is deprecated and + no longer recognized by the Direct Link APIs. + See bgp_cer_cidr and bgp_ibm_cidr fields instead for IP related information. Deprecated field bgp_base_cidr will be removed from the API specificiation after 15-MAR-2021. :attr str bgp_cer_cidr: (optional) BGP customer edge router CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the - value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", - "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must - have matching network and subnet mask values. + :attr int bgp_ibm_asn: (optional) IBM BGP ASN. :attr str bgp_ibm_cidr: (optional) BGP IBM CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the - value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", - "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must - have matching network and subnet mask values. + :attr str bgp_status: (optional) Gateway BGP status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr datetime bgp_status_updated_at: (optional) Date and time bgp status was + updated. + :attr str carrier_name: (optional) Carrier name. Only set for type=dedicated + gateways. + :attr GatewayChangeRequest change_request: (optional) Changes pending approval + for provider managed Direct Link Connect gateways. + :attr str completion_notice_reject_reason: (optional) Reason for completion + notice rejection. Only included on type=dedicated gateways with a rejected + completion notice. :attr str connection_mode: (optional) Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr str default_export_route_filter: (optional) The default directional route - filter action that applies to routes that do not match any directional route - filters. - :attr str default_import_route_filter: (optional) The default directional route - filter action that applies to routes that do not match any directional route - filters. - :attr List[GatewayTemplateRouteFilter] export_route_filters: (optional) Array of - directional route filters for a Direct Link gateway. When creating a gateway or - replacing existing route filters, the order of the items in the array will set - the ordering of the list of route filters. + :attr datetime created_at: The date and time resource was created. + :attr str crn: The CRN (Cloud Resource Name) of this gateway. + :attr bool cross_account: Indicates whether this gateway is cross account + gateway. + :attr str cross_connect_router: (optional) Cross connect router. Only included + on type=dedicated gateways. + :attr str customer_name: (optional) Customer name. Only set for type=dedicated + gateways. + :attr str default_export_route_filter: The default directional route filter + action that applies to routes that do not match any directional route filters. + :attr str default_import_route_filter: The default directional route filter + action that applies to routes that do not match any directional route filters. :attr bool global_: Gateways with global routing (`true`) can connect to networks outside their associated region. - :attr List[GatewayTemplateRouteFilter] import_route_filters: (optional) Array of - directional route filters for a Direct Link gateway. When creating a gateway or - replacing existing route filters, the order of the items in the array will set - the ordering of the list of route filters. + :attr str id: The unique identifier of this gateway. + :attr str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr datetime link_status_updated_at: (optional) Date and time link status was + updated. + :attr str location_display_name: Gateway location long name. + :attr str location_name: Gateway location. + :attr GatewayMacsecConfig macsec_config: (optional) MACsec configuration + information. For Dedicated Gateways with MACsec configured, return + configuration information. Contact IBM support for access to MACsec. :attr bool metered: Metered billing option. When `true` gateway usage is billed per gigabyte. When `false` there is no per gigabyte usage charge, instead a flat rate is charged for the gateway. :attr str name: The unique user-defined name for this gateway. + :attr str operational_status: Gateway operational status. The list of enumerated + values for this property may expand in the future. Code and processes using this + field must tolerate unexpected values. + :attr GatewayPort port: (optional) gateway port for type=connect gateways. + :attr bool provider_api_managed: (optional) Indicates whether gateway changes + must be made via a provider portal. + :attr ResourceGroupReference resource_group: (optional) Resource group + reference. + :attr int speed_mbps: Gateway speed in megabits per second. :attr str patch_panel_completion_notice: (optional) Gateway patch panel complete notification from implementation team. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int speed_mbps: Gateway speed in megabits per second. - :attr str type: Offering type. - :attr str carrier_name: Carrier name. - :attr str cross_connect_router: Cross connect router. - :attr str customer_name: Customer name. - :attr str location_name: Gateway location. - :attr GatewayMacsecConfigTemplate macsec_config: (optional) MACsec configuration - information. Contact IBM support for access to MACsec. - """ - - def __init__(self, - bgp_asn: int, - global_: bool, - metered: bool, - name: str, - speed_mbps: int, - type: str, - carrier_name: str, - cross_connect_router: str, - customer_name: str, - location_name: str, - *, - as_prepends: List['AsPrependTemplate'] = None, - authentication_key: 'GatewayTemplateAuthenticationKey' = None, - bfd_config: 'GatewayBfdConfigTemplate' = None, - bgp_base_cidr: str = None, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None, - connection_mode: str = None, - default_export_route_filter: str = None, - default_import_route_filter: str = None, - export_route_filters: List['GatewayTemplateRouteFilter'] = None, - import_route_filters: List['GatewayTemplateRouteFilter'] = None, - patch_panel_completion_notice: str = None, - resource_group: 'ResourceGroupIdentity' = None, - macsec_config: 'GatewayMacsecConfigTemplate' = None) -> None: + :attr str type: Offering type. The list of enumerated values for this property + may expand in the future. Code and processes using this field must tolerate + unexpected values. + :attr int vlan: (optional) VLAN configured for this gateway. If there is no vlan + configured for the gateway, the vlan will be absent. This property will also be + absent if this gateway's `crn` is in another account. + """ + + def __init__( + self, + bgp_asn: int, + created_at: datetime, + crn: str, + cross_account: bool, + default_export_route_filter: str, + default_import_route_filter: str, + global_: bool, + id: str, + location_display_name: str, + location_name: str, + metered: bool, + name: str, + operational_status: str, + speed_mbps: int, + type: str, + *, + as_prepends: List['AsPrepend'] = None, + authentication_key: 'GatewayAuthenticationKey' = None, + bfd_config: 'GatewayBfdConfig' = None, + bgp_base_cidr: str = None, + bgp_cer_cidr: str = None, + bgp_ibm_asn: int = None, + bgp_ibm_cidr: str = None, + bgp_status: str = None, + bgp_status_updated_at: datetime = None, + carrier_name: str = None, + change_request: 'GatewayChangeRequest' = None, + completion_notice_reject_reason: str = None, + connection_mode: str = None, + cross_connect_router: str = None, + customer_name: str = None, + link_status: str = None, + link_status_updated_at: datetime = None, + macsec_config: 'GatewayMacsecConfig' = None, + port: 'GatewayPort' = None, + provider_api_managed: bool = None, + resource_group: 'ResourceGroupReference' = None, + patch_panel_completion_notice: str = None, + vlan: int = None, + ) -> None: """ - Initialize a GatewayTemplateGatewayTypeDedicatedTemplate object. + Initialize a GetGatewayResponseGateway object. - :param int bgp_asn: BGP ASN. + :param int bgp_asn: Customer BGP ASN. + :param datetime created_at: The date and time resource was created. + :param str crn: The CRN (Cloud Resource Name) of this gateway. + :param bool cross_account: Indicates whether this gateway is cross account + gateway. + :param str default_export_route_filter: The default directional route + filter action that applies to routes that do not match any directional + route filters. + :param str default_import_route_filter: The default directional route + filter action that applies to routes that do not match any directional + route filters. :param bool global_: Gateways with global routing (`true`) can connect to networks outside their associated region. + :param str id: The unique identifier of this gateway. + :param str location_display_name: Gateway location long name. + :param str location_name: Gateway location. :param bool metered: Metered billing option. When `true` gateway usage is billed per gigabyte. When `false` there is no per gigabyte usage charge, instead a flat rate is charged for the gateway. :param str name: The unique user-defined name for this gateway. + :param str operational_status: Gateway operational status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. :param int speed_mbps: Gateway speed in megabits per second. - :param str type: Offering type. - :param str carrier_name: Carrier name. - :param str cross_connect_router: Cross connect router. - :param str customer_name: Customer name. - :param str location_name: Gateway location. - :param List[AsPrependTemplate] as_prepends: (optional) array of AS Prepend - configuration information. - :param GatewayTemplateAuthenticationKey authentication_key: (optional) - :param GatewayBfdConfigTemplate bfd_config: (optional) - :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR. - Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how - to create a gateway using either automatic or explicit IP assignment. Any - bgp_base_cidr value set will be ignored. + :param str type: Offering type. The list of enumerated values for this + property may expand in the future. Code and processes using this field + must tolerate unexpected values. + :param List[AsPrepend] as_prepends: (optional) array of AS Prepend + information. + :param GatewayAuthenticationKey authentication_key: (optional) The identity + of the standard key to use for BGP MD5 authentication key. + The key material that you provide must be base64 encoded and original + string must be maximum 126 ASCII characters in length. + To clear the optional `authentication_key` field patch its crn to `""`. + :param GatewayBfdConfig bfd_config: (optional) BFD configuration + information. + :param str bgp_base_cidr: (optional) (DEPRECATED) BGP base CIDR is + deprecated and no longer recognized by the Direct Link APIs. + See bgp_cer_cidr and bgp_ibm_cidr fields instead for IP related + information. Deprecated field bgp_base_cidr will be removed from the API specificiation after 15-MAR-2021. :param str bgp_cer_cidr: (optional) BGP customer edge router CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, - the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", - "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr - and bgp_ibm_cidr must have matching network and subnet mask values. + :param int bgp_ibm_asn: (optional) IBM BGP ASN. :param str bgp_ibm_cidr: (optional) BGP IBM CIDR. - For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will - automatically select values for bgp_cer_cidr and bgp_ibm_cidr. - For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, - the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", - "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr - and bgp_ibm_cidr must have matching network and subnet mask values. + :param str bgp_status: (optional) Gateway BGP status. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param datetime bgp_status_updated_at: (optional) Date and time bgp status + was updated. + :param str carrier_name: (optional) Carrier name. Only set for + type=dedicated gateways. + :param GatewayChangeRequest change_request: (optional) Changes pending + approval for provider managed Direct Link Connect gateways. + :param str completion_notice_reject_reason: (optional) Reason for + completion notice rejection. Only included on type=dedicated gateways with + a rejected completion notice. :param str connection_mode: (optional) Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param str default_export_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param str default_import_route_filter: (optional) The default directional - route filter action that applies to routes that do not match any - directional route filters. - :param List[GatewayTemplateRouteFilter] export_route_filters: (optional) - Array of directional route filters for a Direct Link gateway. When creating - a gateway or replacing existing route filters, the order of the items in - the array will set the ordering of the list of route filters. - :param List[GatewayTemplateRouteFilter] import_route_filters: (optional) - Array of directional route filters for a Direct Link gateway. When creating - a gateway or replacing existing route filters, the order of the items in - the array will set the ordering of the list of route filters. + :param str cross_connect_router: (optional) Cross connect router. Only + included on type=dedicated gateways. + :param str customer_name: (optional) Customer name. Only set for + type=dedicated gateways. + :param str link_status: (optional) Gateway link status. Only included on + type=dedicated gateways. The list of enumerated values for this property + may expand in the future. Code and processes using this field must + tolerate unexpected values. + :param datetime link_status_updated_at: (optional) Date and time link + status was updated. + :param GatewayMacsecConfig macsec_config: (optional) MACsec configuration + information. For Dedicated Gateways with MACsec configured, return + configuration information. Contact IBM support for access to MACsec. + :param GatewayPort port: (optional) gateway port for type=connect gateways. + :param bool provider_api_managed: (optional) Indicates whether gateway + changes must be made via a provider portal. + :param ResourceGroupReference resource_group: (optional) Resource group + reference. :param str patch_panel_completion_notice: (optional) Gateway patch panel complete notification from implementation team. - :param ResourceGroupIdentity resource_group: (optional) - :param GatewayMacsecConfigTemplate macsec_config: (optional) MACsec - configuration information. Contact IBM support for access to MACsec. + :param int vlan: (optional) VLAN configured for this gateway. If there is + no vlan configured for the gateway, the vlan will be absent. This property + will also be absent if this gateway's `crn` is in another account. """ # pylint: disable=super-init-not-called self.as_prepends = as_prepends @@ -9654,102 +12164,154 @@ def __init__(self, self.bgp_asn = bgp_asn self.bgp_base_cidr = bgp_base_cidr self.bgp_cer_cidr = bgp_cer_cidr + self.bgp_ibm_asn = bgp_ibm_asn self.bgp_ibm_cidr = bgp_ibm_cidr + self.bgp_status = bgp_status + self.bgp_status_updated_at = bgp_status_updated_at + self.carrier_name = carrier_name + self.change_request = change_request + self.completion_notice_reject_reason = completion_notice_reject_reason self.connection_mode = connection_mode + self.created_at = created_at + self.crn = crn + self.cross_account = cross_account + self.cross_connect_router = cross_connect_router + self.customer_name = customer_name self.default_export_route_filter = default_export_route_filter self.default_import_route_filter = default_import_route_filter - self.export_route_filters = export_route_filters self.global_ = global_ - self.import_route_filters = import_route_filters + self.id = id + self.link_status = link_status + self.link_status_updated_at = link_status_updated_at + self.location_display_name = location_display_name + self.location_name = location_name + self.macsec_config = macsec_config self.metered = metered self.name = name - self.patch_panel_completion_notice = patch_panel_completion_notice + self.operational_status = operational_status + self.port = port + self.provider_api_managed = provider_api_managed self.resource_group = resource_group self.speed_mbps = speed_mbps + self.patch_panel_completion_notice = patch_panel_completion_notice self.type = type - self.carrier_name = carrier_name - self.cross_connect_router = cross_connect_router - self.customer_name = customer_name - self.location_name = location_name - self.macsec_config = macsec_config + self.vlan = vlan @classmethod - def from_dict(cls, _dict: Dict) -> 'GatewayTemplateGatewayTypeDedicatedTemplate': - """Initialize a GatewayTemplateGatewayTypeDedicatedTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GetGatewayResponseGateway': + """Initialize a GetGatewayResponseGateway object from a json dictionary.""" args = {} if 'as_prepends' in _dict: - args['as_prepends'] = [AsPrependTemplate.from_dict(v) for v in _dict.get('as_prepends')] + args['as_prepends'] = [AsPrepend.from_dict(v) for v in _dict.get('as_prepends')] if 'authentication_key' in _dict: - args['authentication_key'] = GatewayTemplateAuthenticationKey.from_dict(_dict.get('authentication_key')) + args['authentication_key'] = GatewayAuthenticationKey.from_dict(_dict.get('authentication_key')) if 'bfd_config' in _dict: - args['bfd_config'] = GatewayBfdConfigTemplate.from_dict(_dict.get('bfd_config')) + args['bfd_config'] = GatewayBfdConfig.from_dict(_dict.get('bfd_config')) if 'bgp_asn' in _dict: args['bgp_asn'] = _dict.get('bgp_asn') else: - raise ValueError('Required property \'bgp_asn\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + raise ValueError('Required property \'bgp_asn\' not present in GetGatewayResponseGateway JSON') if 'bgp_base_cidr' in _dict: args['bgp_base_cidr'] = _dict.get('bgp_base_cidr') if 'bgp_cer_cidr' in _dict: args['bgp_cer_cidr'] = _dict.get('bgp_cer_cidr') + if 'bgp_ibm_asn' in _dict: + args['bgp_ibm_asn'] = _dict.get('bgp_ibm_asn') if 'bgp_ibm_cidr' in _dict: args['bgp_ibm_cidr'] = _dict.get('bgp_ibm_cidr') + if 'bgp_status' in _dict: + args['bgp_status'] = _dict.get('bgp_status') + if 'bgp_status_updated_at' in _dict: + args['bgp_status_updated_at'] = string_to_datetime(_dict.get('bgp_status_updated_at')) + if 'carrier_name' in _dict: + args['carrier_name'] = _dict.get('carrier_name') + if 'change_request' in _dict: + args['change_request'] = _dict.get('change_request') + if 'completion_notice_reject_reason' in _dict: + args['completion_notice_reject_reason'] = _dict.get('completion_notice_reject_reason') if 'connection_mode' in _dict: args['connection_mode'] = _dict.get('connection_mode') + 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 GetGatewayResponseGateway JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in GetGatewayResponseGateway JSON') + if 'cross_account' in _dict: + args['cross_account'] = _dict.get('cross_account') + else: + raise ValueError('Required property \'cross_account\' not present in GetGatewayResponseGateway JSON') + if 'cross_connect_router' in _dict: + args['cross_connect_router'] = _dict.get('cross_connect_router') + if 'customer_name' in _dict: + args['customer_name'] = _dict.get('customer_name') if 'default_export_route_filter' in _dict: args['default_export_route_filter'] = _dict.get('default_export_route_filter') + else: + raise ValueError('Required property \'default_export_route_filter\' not present in GetGatewayResponseGateway JSON') if 'default_import_route_filter' in _dict: args['default_import_route_filter'] = _dict.get('default_import_route_filter') - if 'export_route_filters' in _dict: - args['export_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('export_route_filters')] + else: + raise ValueError('Required property \'default_import_route_filter\' not present in GetGatewayResponseGateway JSON') if 'global' in _dict: args['global_'] = _dict.get('global') else: - raise ValueError('Required property \'global\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'import_route_filters' in _dict: - args['import_route_filters'] = [GatewayTemplateRouteFilter.from_dict(v) for v in _dict.get('import_route_filters')] + raise ValueError('Required property \'global\' not present in GetGatewayResponseGateway JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in GetGatewayResponseGateway JSON') + if 'link_status' in _dict: + args['link_status'] = _dict.get('link_status') + if 'link_status_updated_at' in _dict: + args['link_status_updated_at'] = string_to_datetime(_dict.get('link_status_updated_at')) + if 'location_display_name' in _dict: + args['location_display_name'] = _dict.get('location_display_name') + else: + raise ValueError('Required property \'location_display_name\' not present in GetGatewayResponseGateway JSON') + if 'location_name' in _dict: + args['location_name'] = _dict.get('location_name') + else: + raise ValueError('Required property \'location_name\' not present in GetGatewayResponseGateway JSON') + if 'macsec_config' in _dict: + args['macsec_config'] = GatewayMacsecConfig.from_dict(_dict.get('macsec_config')) if 'metered' in _dict: args['metered'] = _dict.get('metered') else: - raise ValueError('Required property \'metered\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + raise ValueError('Required property \'metered\' not present in GetGatewayResponseGateway JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'patch_panel_completion_notice' in _dict: - args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') + raise ValueError('Required property \'name\' not present in GetGatewayResponseGateway JSON') + if 'operational_status' in _dict: + args['operational_status'] = _dict.get('operational_status') + else: + raise ValueError('Required property \'operational_status\' not present in GetGatewayResponseGateway JSON') + if 'port' in _dict: + args['port'] = GatewayPort.from_dict(_dict.get('port')) + if 'provider_api_managed' in _dict: + args['provider_api_managed'] = _dict.get('provider_api_managed') if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupIdentity.from_dict(_dict.get('resource_group')) + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) if 'speed_mbps' in _dict: args['speed_mbps'] = _dict.get('speed_mbps') else: - raise ValueError('Required property \'speed_mbps\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') + raise ValueError('Required property \'speed_mbps\' not present in GetGatewayResponseGateway JSON') + if 'patch_panel_completion_notice' in _dict: + args['patch_panel_completion_notice'] = _dict.get('patch_panel_completion_notice') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'carrier_name' in _dict: - args['carrier_name'] = _dict.get('carrier_name') - else: - raise ValueError('Required property \'carrier_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'cross_connect_router' in _dict: - args['cross_connect_router'] = _dict.get('cross_connect_router') - else: - raise ValueError('Required property \'cross_connect_router\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'customer_name' in _dict: - args['customer_name'] = _dict.get('customer_name') - else: - raise ValueError('Required property \'customer_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'location_name' in _dict: - args['location_name'] = _dict.get('location_name') - else: - raise ValueError('Required property \'location_name\' not present in GatewayTemplateGatewayTypeDedicatedTemplate JSON') - if 'macsec_config' in _dict: - args['macsec_config'] = GatewayMacsecConfigTemplate.from_dict(_dict.get('macsec_config')) + raise ValueError('Required property \'type\' not present in GetGatewayResponseGateway JSON') + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GatewayTemplateGatewayTypeDedicatedTemplate object from a json dictionary.""" + """Initialize a GetGatewayResponseGateway object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -9779,38 +12341,69 @@ def to_dict(self) -> Dict: _dict['bgp_base_cidr'] = self.bgp_base_cidr if hasattr(self, 'bgp_cer_cidr') and self.bgp_cer_cidr is not None: _dict['bgp_cer_cidr'] = self.bgp_cer_cidr + if hasattr(self, 'bgp_ibm_asn') and self.bgp_ibm_asn is not None: + _dict['bgp_ibm_asn'] = self.bgp_ibm_asn if hasattr(self, 'bgp_ibm_cidr') and self.bgp_ibm_cidr is not None: _dict['bgp_ibm_cidr'] = self.bgp_ibm_cidr + if hasattr(self, 'bgp_status') and self.bgp_status is not None: + _dict['bgp_status'] = self.bgp_status + if hasattr(self, 'bgp_status_updated_at') and self.bgp_status_updated_at is not None: + _dict['bgp_status_updated_at'] = datetime_to_string(self.bgp_status_updated_at) + if hasattr(self, 'carrier_name') and self.carrier_name is not None: + _dict['carrier_name'] = self.carrier_name + if hasattr(self, 'change_request') and self.change_request is not None: + if isinstance(self.change_request, dict): + _dict['change_request'] = self.change_request + else: + _dict['change_request'] = self.change_request.to_dict() + if hasattr(self, 'completion_notice_reject_reason') and self.completion_notice_reject_reason is not None: + _dict['completion_notice_reject_reason'] = self.completion_notice_reject_reason if hasattr(self, 'connection_mode') and self.connection_mode is not None: _dict['connection_mode'] = self.connection_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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'cross_account') and self.cross_account is not None: + _dict['cross_account'] = self.cross_account + if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: + _dict['cross_connect_router'] = self.cross_connect_router + if hasattr(self, 'customer_name') and self.customer_name is not None: + _dict['customer_name'] = self.customer_name if hasattr(self, 'default_export_route_filter') and self.default_export_route_filter is not None: _dict['default_export_route_filter'] = self.default_export_route_filter if hasattr(self, 'default_import_route_filter') and self.default_import_route_filter is not None: _dict['default_import_route_filter'] = self.default_import_route_filter - if hasattr(self, 'export_route_filters') and self.export_route_filters is not None: - export_route_filters_list = [] - for v in self.export_route_filters: - if isinstance(v, dict): - export_route_filters_list.append(v) - else: - export_route_filters_list.append(v.to_dict()) - _dict['export_route_filters'] = export_route_filters_list if hasattr(self, 'global_') and self.global_ is not None: _dict['global'] = self.global_ - if hasattr(self, 'import_route_filters') and self.import_route_filters is not None: - import_route_filters_list = [] - for v in self.import_route_filters: - if isinstance(v, dict): - import_route_filters_list.append(v) - else: - import_route_filters_list.append(v.to_dict()) - _dict['import_route_filters'] = import_route_filters_list + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'link_status') and self.link_status is not None: + _dict['link_status'] = self.link_status + if hasattr(self, 'link_status_updated_at') and self.link_status_updated_at is not None: + _dict['link_status_updated_at'] = datetime_to_string(self.link_status_updated_at) + if hasattr(self, 'location_display_name') and self.location_display_name is not None: + _dict['location_display_name'] = self.location_display_name + if hasattr(self, 'location_name') and self.location_name is not None: + _dict['location_name'] = self.location_name + if hasattr(self, 'macsec_config') and self.macsec_config is not None: + if isinstance(self.macsec_config, dict): + _dict['macsec_config'] = self.macsec_config + else: + _dict['macsec_config'] = self.macsec_config.to_dict() if hasattr(self, 'metered') and self.metered is not None: _dict['metered'] = self.metered if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: - _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice + if hasattr(self, 'operational_status') and self.operational_status is not None: + _dict['operational_status'] = self.operational_status + if hasattr(self, 'port') and self.port is not None: + if isinstance(self.port, dict): + _dict['port'] = self.port + else: + _dict['port'] = self.port.to_dict() + if hasattr(self, 'provider_api_managed') and self.provider_api_managed is not None: + _dict['provider_api_managed'] = self.provider_api_managed if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -9818,21 +12411,12 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'speed_mbps') and self.speed_mbps is not None: _dict['speed_mbps'] = self.speed_mbps + if hasattr(self, 'patch_panel_completion_notice') and self.patch_panel_completion_notice is not None: + _dict['patch_panel_completion_notice'] = self.patch_panel_completion_notice if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'carrier_name') and self.carrier_name is not None: - _dict['carrier_name'] = self.carrier_name - if hasattr(self, 'cross_connect_router') and self.cross_connect_router is not None: - _dict['cross_connect_router'] = self.cross_connect_router - if hasattr(self, 'customer_name') and self.customer_name is not None: - _dict['customer_name'] = self.customer_name - if hasattr(self, 'location_name') and self.location_name is not None: - _dict['location_name'] = self.location_name - if hasattr(self, 'macsec_config') and self.macsec_config is not None: - if isinstance(self.macsec_config, dict): - _dict['macsec_config'] = self.macsec_config - else: - _dict['macsec_config'] = self.macsec_config.to_dict() + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan return _dict def _to_dict(self): @@ -9840,19 +12424,31 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GatewayTemplateGatewayTypeDedicatedTemplate object.""" + """Return a `str` version of this GetGatewayResponseGateway object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GatewayTemplateGatewayTypeDedicatedTemplate') -> bool: + def __eq__(self, other: 'GetGatewayResponseGateway') -> 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: 'GatewayTemplateGatewayTypeDedicatedTemplate') -> bool: + def __ne__(self, other: 'GetGatewayResponseGateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class BgpStatusEnum(str, Enum): + """ + Gateway BGP status. The list of enumerated values for this property may expand in + the future. Code and processes using this field must tolerate unexpected values. + """ + + ACTIVE = 'active' + CONNECT = 'connect' + ESTABLISHED = 'established' + IDLE = 'idle' + + class ConnectionModeEnum(str, Enum): """ Type of services this Gateway is attached to. Mode transit means this Gateway will @@ -9861,6 +12457,7 @@ class ConnectionModeEnum(str, Enum): property may expand in the future. Code and processes using this field must tolerate unexpected values. """ + DIRECT = 'direct' TRANSIT = 'transit' @@ -9870,6 +12467,7 @@ class DefaultExportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' @@ -9879,18 +12477,55 @@ class DefaultImportRouteFilterEnum(str, Enum): The default directional route filter action that applies to routes that do not match any directional route filters. """ + PERMIT = 'permit' DENY = 'deny' + class LinkStatusEnum(str, Enum): + """ + Gateway link status. Only included on type=dedicated gateways. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + """ + + DOWN = 'down' + UP = 'up' + + + class OperationalStatusEnum(str, Enum): + """ + Gateway operational status. The list of enumerated values for this property may + expand in the future. Code and processes using this field must tolerate + unexpected values. + """ + + AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' + AWAITING_LOA = 'awaiting_loa' + CONFIGURING = 'configuring' + CREATE_PENDING = 'create_pending' + CREATE_REJECTED = 'create_rejected' + COMPLETION_NOTICE_APPROVED = 'completion_notice_approved' + COMPLETION_NOTICE_RECEIVED = 'completion_notice_received' + COMPLETION_NOTICE_REJECTED = 'completion_notice_rejected' + DELETE_PENDING = 'delete_pending' + LOA_ACCEPTED = 'loa_accepted' + LOA_CREATED = 'loa_created' + LOA_REJECTED = 'loa_rejected' + PROVISIONED = 'provisioned' + + class TypeEnum(str, Enum): """ - Offering type. + Offering type. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected values. """ + CONNECT = 'connect' DEDICATED = 'dedicated' + class RouteReportOverlappingRouteForConnection(RouteReportOverlappingRoute): """ overlapping route details. @@ -9900,10 +12535,12 @@ class RouteReportOverlappingRouteForConnection(RouteReportOverlappingRoute): :attr str virtual_connection_id: virtual connection ID. """ - def __init__(self, - prefix: str, - type: str, - virtual_connection_id: str) -> None: + def __init__( + self, + prefix: str, + type: str, + virtual_connection_id: str, + ) -> None: """ Initialize a RouteReportOverlappingRouteForConnection object. @@ -9972,9 +12609,11 @@ class TypeEnum(str, Enum): """ type of the route. """ + VIRTUAL_CONNECTION = 'virtual_connection' + class RouteReportOverlappingRouteForOthers(RouteReportOverlappingRoute): """ overlapping route details. @@ -9983,9 +12622,11 @@ class RouteReportOverlappingRouteForOthers(RouteReportOverlappingRoute): :attr str type: type of the route. """ - def __init__(self, - prefix: str, - type: str) -> None: + def __init__( + self, + prefix: str, + type: str, + ) -> None: """ Initialize a RouteReportOverlappingRouteForOthers object. @@ -10046,6 +12687,7 @@ class TypeEnum(str, Enum): """ type of the route. """ + GATEWAY = 'gateway' ON_PREM = 'on_prem' @@ -10054,16 +12696,18 @@ class TypeEnum(str, Enum): # Pagers ############################################################################## -class PortsPager(): + +class PortsPager: """ PortsPager can be used to simplify the use of the "list_ports" method. """ - def __init__(self, - *, - client: DirectLinkV1, - limit: int = None, - location_name: str = None, + def __init__( + self, + *, + client: DirectLinkV1, + limit: int = None, + location_name: str = None, ) -> None: """ Initialize a PortsPager object. @@ -10072,7 +12716,7 @@ def __init__(self, """ self._has_next = True self._client = client - self._page_context = { 'next': None } + self._page_context = {'next': None} self._limit = limit self._location_name = location_name diff --git a/test/integration/test_direct_link_v1.py b/test/integration/test_direct_link_v1.py index 1d621ca..05ef48b 100644 --- a/test/integration/test_direct_link_v1.py +++ b/test/integration/test_direct_link_v1.py @@ -30,6 +30,7 @@ GatewayTemplateAuthenticationKey, GatewayPatchTemplateAuthenticationKey, GatewayTemplateGatewayTypeConnectTemplate, + GatewayPatchTemplate, GatewayPortIdentity, Gateway, AsPrependTemplate, @@ -171,6 +172,7 @@ def test_gateway_crud_actions(self): carrierName = "carrier1" customerName = "customer1" gatewayType = "dedicated" + vlan = 10 """ test create/get/update/delete gateway success """ # create gateway @@ -179,12 +181,15 @@ def test_gateway_crud_actions(self): type=gatewayType, speed_mbps=speedMbps, global_=global_bool, bgp_asn=bgpAsn, bgp_base_cidr=bgpBaseCidr, metered=metered, carrier_name=carrierName, cross_connect_router=crossConnectRouter, - customer_name=customerName, location_name=locationName) + customer_name=customerName, location_name=locationName, vlan=vlan) response = self.dl.create_gateway(gateway_template=gtw_template) assert response is not None assert response.get_status_code() == 201 gateway_id = response.get_result().get("id") + # vlan check after create + assert response.get_result()["vlan"] == vlan + # list gateways response = self.dl.list_gateways() assert response is not None @@ -197,14 +202,28 @@ def test_gateway_crud_actions(self): break assert list_result - # update gateway name + # update gateway name and vlan update_name = os.getenv("DL_SERVICES_GW_NAME")+"-PATCH" - response = self.dl.update_gateway(id=gateway_id, - name=update_name, metered=True) + updated_vlan = 99 + gtw_patch_template = GatewayPatchTemplate(name=update_name, metered=True, vlan=updated_vlan) + response = self.dl.update_gateway(id=gateway_id, gateway_patch_template=gtw_patch_template) assert response is not None assert response.get_status_code() == 200 assert response.get_result()["name"] == update_name + # vlan check after update + assert response.get_result()["vlan"] == updated_vlan + + # update for vlan reset + # gtw_vlan_patch_template = GatewayPatchTemplate(metered=True, vlan=None) + # to reset vlan, we need pass this as JSON object + reset_response = self.dl.update_gateway(id=gateway_id, gateway_patch_template={ "metered": True, "vlan": None }) + assert reset_response is not None + assert reset_response.get_status_code() == 200 + + # vlan is unset after update + assert reset_response.get_result().get("vlan") is None + # delete gateway self.delete_gateway(gateway_id) diff --git a/test/unit/test_direct_link_v1.py b/test/unit/test_direct_link_v1.py index 8fe48bd..64576b5 100644 --- a/test/unit/test_direct_link_v1.py +++ b/test/unit/test_direct_link_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2023. +# (C) Copyright IBM Corp. 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ _service = DirectLinkV1( authenticator=NoAuthAuthenticator(), - version=version + version=version, ) _base_url = 'https://directlink.cloud.ibm.com/v1' @@ -74,7 +74,8 @@ def preprocess_url(operation_path: str): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -119,7 +120,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGateways(): + +class TestListGateways: """ Test Class for list_gateways """ @@ -131,17 +133,18 @@ def test_list_gateways_all_params(self): """ # Set up mock url = preprocess_url('/gateways') - mock_response = '{"gateways": [{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"gateways": [{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.list_gateways() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -162,18 +165,20 @@ def test_list_gateways_value_error(self): """ # Set up mock url = preprocess_url('/gateways') - mock_response = '{"gateways": [{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"gateways": [{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError 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_gateways(**req_copy) @@ -186,7 +191,8 @@ def test_list_gateways_value_error_with_retries(self): _service.disable_retries() self.test_list_gateways_value_error() -class TestCreateGateway(): + +class TestCreateGateway: """ Test Class for create_gateway """ @@ -198,12 +204,14 @@ def test_create_gateway_all_params(self): """ # Set up mock url = preprocess_url('/gateways') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a AsPrependTemplate model as_prepend_template_model = {} @@ -273,6 +281,7 @@ def test_create_gateway_all_params(self): gateway_template_model['customer_name'] = 'newCustomerName' gateway_template_model['location_name'] = 'dal03' gateway_template_model['macsec_config'] = gateway_macsec_config_template_model + gateway_template_model['vlan'] = 10 # Set up parameter values gateway_template = gateway_template_model @@ -280,7 +289,7 @@ def test_create_gateway_all_params(self): # Invoke method response = _service.create_gateway( gateway_template, - headers={} + headers={}, ) # Check for correct operation @@ -306,12 +315,14 @@ def test_create_gateway_value_error(self): """ # Set up mock url = preprocess_url('/gateways') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a AsPrependTemplate model as_prepend_template_model = {} @@ -381,6 +392,7 @@ def test_create_gateway_value_error(self): gateway_template_model['customer_name'] = 'newCustomerName' gateway_template_model['location_name'] = 'dal03' gateway_template_model['macsec_config'] = gateway_macsec_config_template_model + gateway_template_model['vlan'] = 10 # Set up parameter values gateway_template = gateway_template_model @@ -390,7 +402,7 @@ def test_create_gateway_value_error(self): "gateway_template": gateway_template, } for param 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_gateway(**req_copy) @@ -403,7 +415,8 @@ def test_create_gateway_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_value_error() -class TestDeleteGateway(): + +class TestDeleteGateway: """ Test Class for delete_gateway """ @@ -415,9 +428,11 @@ def test_delete_gateway_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -425,7 +440,7 @@ def test_delete_gateway_all_params(self): # Invoke method response = _service.delete_gateway( id, - headers={} + headers={}, ) # Check for correct operation @@ -448,9 +463,11 @@ def test_delete_gateway_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -460,7 +477,7 @@ def test_delete_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_gateway(**req_copy) @@ -473,7 +490,8 @@ def test_delete_gateway_value_error_with_retries(self): _service.disable_retries() self.test_delete_gateway_value_error() -class TestGetGateway(): + +class TestGetGateway: """ Test Class for get_gateway """ @@ -485,12 +503,14 @@ def test_get_gateway_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -498,7 +518,7 @@ def test_get_gateway_all_params(self): # Invoke method response = _service.get_gateway( id, - headers={} + headers={}, ) # Check for correct operation @@ -521,12 +541,14 @@ def test_get_gateway_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -536,7 +558,7 @@ def test_get_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_gateway(**req_copy) @@ -549,7 +571,8 @@ def test_get_gateway_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_value_error() -class TestUpdateGateway(): + +class TestUpdateGateway: """ Test Class for update_gateway """ @@ -561,12 +584,14 @@ def test_update_gateway_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a GatewayPatchTemplateAuthenticationKey model gateway_patch_template_authentication_key_model = {} @@ -592,45 +617,35 @@ def test_update_gateway_all_params(self): gateway_macsec_config_patch_template_model['primary_cak'] = gateway_macsec_config_patch_template_primary_cak_model gateway_macsec_config_patch_template_model['window_size'] = 512 + # Construct a dict representation of a GatewayPatchTemplate model + gateway_patch_template_model = {} + gateway_patch_template_model['authentication_key'] = gateway_patch_template_authentication_key_model + gateway_patch_template_model['bfd_config'] = gateway_bfd_patch_template_model + gateway_patch_template_model['bgp_asn'] = 64999 + gateway_patch_template_model['bgp_cer_cidr'] = '169.254.0.10/30' + gateway_patch_template_model['bgp_ibm_cidr'] = '169.254.0.9/30' + gateway_patch_template_model['connection_mode'] = 'transit' + gateway_patch_template_model['default_export_route_filter'] = 'permit' + gateway_patch_template_model['default_import_route_filter'] = 'permit' + gateway_patch_template_model['global'] = True + gateway_patch_template_model['loa_reject_reason'] = 'The port mentioned was incorrect' + gateway_patch_template_model['macsec_config'] = gateway_macsec_config_patch_template_model + gateway_patch_template_model['metered'] = False + gateway_patch_template_model['name'] = 'testGateway' + gateway_patch_template_model['operational_status'] = 'loa_accepted' + gateway_patch_template_model['patch_panel_completion_notice'] = 'patch panel configuration details' + gateway_patch_template_model['speed_mbps'] = 1000 + gateway_patch_template_model['vlan'] = 10 + # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' - authentication_key = gateway_patch_template_authentication_key_model - bfd_config = gateway_bfd_patch_template_model - bgp_asn = 64999 - bgp_cer_cidr = '169.254.0.10/30' - bgp_ibm_cidr = '169.254.0.9/30' - connection_mode = 'transit' - default_export_route_filter = 'permit' - default_import_route_filter = 'permit' - global_ = True - loa_reject_reason = 'The port mentioned was incorrect' - macsec_config = gateway_macsec_config_patch_template_model - metered = False - name = 'testGateway' - operational_status = 'loa_accepted' - patch_panel_completion_notice = 'patch panel configuration details' - speed_mbps = 1000 + gateway_patch_template = gateway_patch_template_model # Invoke method response = _service.update_gateway( id, - authentication_key=authentication_key, - bfd_config=bfd_config, - bgp_asn=bgp_asn, - bgp_cer_cidr=bgp_cer_cidr, - bgp_ibm_cidr=bgp_ibm_cidr, - connection_mode=connection_mode, - default_export_route_filter=default_export_route_filter, - default_import_route_filter=default_import_route_filter, - global_=global_, - loa_reject_reason=loa_reject_reason, - macsec_config=macsec_config, - metered=metered, - name=name, - operational_status=operational_status, - patch_panel_completion_notice=patch_panel_completion_notice, - speed_mbps=speed_mbps, - headers={} + gateway_patch_template, + headers={}, ) # Check for correct operation @@ -638,22 +653,7 @@ def test_update_gateway_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['authentication_key'] == gateway_patch_template_authentication_key_model - assert req_body['bfd_config'] == gateway_bfd_patch_template_model - assert req_body['bgp_asn'] == 64999 - assert req_body['bgp_cer_cidr'] == '169.254.0.10/30' - assert req_body['bgp_ibm_cidr'] == '169.254.0.9/30' - assert req_body['connection_mode'] == 'transit' - assert req_body['default_export_route_filter'] == 'permit' - assert req_body['default_import_route_filter'] == 'permit' - assert req_body['global'] == True - assert req_body['loa_reject_reason'] == 'The port mentioned was incorrect' - assert req_body['macsec_config'] == gateway_macsec_config_patch_template_model - assert req_body['metered'] == False - assert req_body['name'] == 'testGateway' - assert req_body['operational_status'] == 'loa_accepted' - assert req_body['patch_panel_completion_notice'] == 'patch panel configuration details' - assert req_body['speed_mbps'] == 1000 + assert req_body == gateway_patch_template def test_update_gateway_all_params_with_retries(self): # Enable retries and run test_update_gateway_all_params. @@ -671,12 +671,14 @@ def test_update_gateway_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a GatewayPatchTemplateAuthenticationKey model gateway_patch_template_authentication_key_model = {} @@ -702,31 +704,37 @@ def test_update_gateway_value_error(self): gateway_macsec_config_patch_template_model['primary_cak'] = gateway_macsec_config_patch_template_primary_cak_model gateway_macsec_config_patch_template_model['window_size'] = 512 + # Construct a dict representation of a GatewayPatchTemplate model + gateway_patch_template_model = {} + gateway_patch_template_model['authentication_key'] = gateway_patch_template_authentication_key_model + gateway_patch_template_model['bfd_config'] = gateway_bfd_patch_template_model + gateway_patch_template_model['bgp_asn'] = 64999 + gateway_patch_template_model['bgp_cer_cidr'] = '169.254.0.10/30' + gateway_patch_template_model['bgp_ibm_cidr'] = '169.254.0.9/30' + gateway_patch_template_model['connection_mode'] = 'transit' + gateway_patch_template_model['default_export_route_filter'] = 'permit' + gateway_patch_template_model['default_import_route_filter'] = 'permit' + gateway_patch_template_model['global'] = True + gateway_patch_template_model['loa_reject_reason'] = 'The port mentioned was incorrect' + gateway_patch_template_model['macsec_config'] = gateway_macsec_config_patch_template_model + gateway_patch_template_model['metered'] = False + gateway_patch_template_model['name'] = 'testGateway' + gateway_patch_template_model['operational_status'] = 'loa_accepted' + gateway_patch_template_model['patch_panel_completion_notice'] = 'patch panel configuration details' + gateway_patch_template_model['speed_mbps'] = 1000 + gateway_patch_template_model['vlan'] = 10 + # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' - authentication_key = gateway_patch_template_authentication_key_model - bfd_config = gateway_bfd_patch_template_model - bgp_asn = 64999 - bgp_cer_cidr = '169.254.0.10/30' - bgp_ibm_cidr = '169.254.0.9/30' - connection_mode = 'transit' - default_export_route_filter = 'permit' - default_import_route_filter = 'permit' - global_ = True - loa_reject_reason = 'The port mentioned was incorrect' - macsec_config = gateway_macsec_config_patch_template_model - metered = False - name = 'testGateway' - operational_status = 'loa_accepted' - patch_panel_completion_notice = 'patch panel configuration details' - speed_mbps = 1000 + gateway_patch_template = gateway_patch_template_model # Pass in all but one required param and check for a ValueError req_param_dict = { "id": id, + "gateway_patch_template": gateway_patch_template, } for param 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_gateway(**req_copy) @@ -739,7 +747,8 @@ def test_update_gateway_value_error_with_retries(self): _service.disable_retries() self.test_update_gateway_value_error() -class TestCreateGatewayAction(): + +class TestCreateGatewayAction: """ Test Class for create_gateway_action """ @@ -751,12 +760,14 @@ def test_create_gateway_action_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/actions') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AsPrependTemplate model as_prepend_template_model = {} @@ -821,7 +832,7 @@ def test_create_gateway_action_all_params(self): metered=metered, resource_group=resource_group, updates=updates, - headers={} + headers={}, ) # Check for correct operation @@ -859,12 +870,14 @@ def test_create_gateway_action_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/actions') - mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "patch_panel_completion_notice": "patch panel configuration details", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "type": "dedicated", "vlan": 10}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "prefix": "172.17.0.0/16", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}], "authentication_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"}, "bfd_config": {"bfd_status": "up", "bfd_status_updated_at": "2020-08-20T06:58:41.909Z", "interval": 2000, "multiplier": 10}, "bgp_asn": 64999, "bgp_base_cidr": "bgp_base_cidr", "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "bgp_status_updated_at": "2020-08-20T06:58:41.909Z", "carrier_name": "myCarrierName", "change_request": {"type": "create_gateway"}, "completion_notice_reject_reason": "The completion notice file was blank", "connection_mode": "transit", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "cross_account": false, "cross_connect_router": "xcr01.dal03", "customer_name": "newCustomerName", "default_export_route_filter": "permit", "default_import_route_filter": "permit", "global": true, "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "link_status": "up", "link_status_updated_at": "2020-08-20T06:58:41.909Z", "location_display_name": "Dallas 03", "location_name": "dal03", "macsec_config": {"active": true, "active_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "cipher_suite": "gcm_aes_xpn_256", "confidentiality_offset": 0, "cryptographic_algorithm": "aes_256_cmac", "fallback_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "key_server_priority": 255, "primary_cak": {"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222", "status": "status"}, "sak_expiry_time": 3600, "security_policy": "must_secure", "status": "secured", "window_size": 64}, "metered": false, "name": "myGateway", "operational_status": "awaiting_completion_notice", "port": {"id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"}, "provider_api_managed": false, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8"}, "speed_mbps": 1000, "patch_panel_completion_notice": "patch panel configuration details", "type": "dedicated", "vlan": 10}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AsPrependTemplate model as_prepend_template_model = {} @@ -918,7 +931,7 @@ def test_create_gateway_action_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_gateway_action(**req_copy) @@ -931,7 +944,8 @@ def test_create_gateway_action_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_action_value_error() -class TestListGatewayCompletionNotice(): + +class TestListGatewayCompletionNotice: """ Test Class for list_gateway_completion_notice """ @@ -944,11 +958,13 @@ def test_list_gateway_completion_notice_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/completion_notice') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/pdf', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/pdf', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -956,7 +972,7 @@ def test_list_gateway_completion_notice_all_params(self): # Invoke method response = _service.list_gateway_completion_notice( id, - headers={} + headers={}, ) # Check for correct operation @@ -980,11 +996,13 @@ def test_list_gateway_completion_notice_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/completion_notice') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/pdf', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/pdf', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -994,7 +1012,7 @@ def test_list_gateway_completion_notice_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_gateway_completion_notice(**req_copy) @@ -1007,7 +1025,8 @@ def test_list_gateway_completion_notice_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_completion_notice_value_error() -class TestCreateGatewayCompletionNotice(): + +class TestCreateGatewayCompletionNotice: """ Test Class for create_gateway_completion_notice """ @@ -1019,9 +1038,11 @@ def test_create_gateway_completion_notice_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/completion_notice') - responses.add(responses.PUT, - url, - status=204) + responses.add( + responses.PUT, + url, + status=204, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1033,7 +1054,7 @@ def test_create_gateway_completion_notice_all_params(self): id, upload=upload, upload_content_type=upload_content_type, - headers={} + headers={}, ) # Check for correct operation @@ -1056,9 +1077,11 @@ def test_create_gateway_completion_notice_required_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/completion_notice') - responses.add(responses.PUT, - url, - status=204) + responses.add( + responses.PUT, + url, + status=204, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1066,7 +1089,7 @@ def test_create_gateway_completion_notice_required_params(self): # Invoke method response = _service.create_gateway_completion_notice( id, - headers={} + headers={}, ) # Check for correct operation @@ -1089,9 +1112,11 @@ def test_create_gateway_completion_notice_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/completion_notice') - responses.add(responses.PUT, - url, - status=204) + responses.add( + responses.PUT, + url, + status=204, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1101,7 +1126,7 @@ def test_create_gateway_completion_notice_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_gateway_completion_notice(**req_copy) @@ -1114,7 +1139,8 @@ def test_create_gateway_completion_notice_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_completion_notice_value_error() -class TestListGatewayLetterOfAuthorization(): + +class TestListGatewayLetterOfAuthorization: """ Test Class for list_gateway_letter_of_authorization """ @@ -1127,11 +1153,13 @@ def test_list_gateway_letter_of_authorization_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/letter_of_authorization') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/pdf', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/pdf', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1139,7 +1167,7 @@ def test_list_gateway_letter_of_authorization_all_params(self): # Invoke method response = _service.list_gateway_letter_of_authorization( id, - headers={} + headers={}, ) # Check for correct operation @@ -1163,11 +1191,13 @@ def test_list_gateway_letter_of_authorization_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/letter_of_authorization') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/pdf', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/pdf', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1177,7 +1207,7 @@ def test_list_gateway_letter_of_authorization_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_gateway_letter_of_authorization(**req_copy) @@ -1190,7 +1220,8 @@ def test_list_gateway_letter_of_authorization_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_letter_of_authorization_value_error() -class TestGetGatewayStatistics(): + +class TestGetGatewayStatistics: """ Test Class for get_gateway_statistics """ @@ -1203,11 +1234,13 @@ def test_get_gateway_statistics_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/statistics') mock_response = '{"statistics": [{"created_at": "2020-08-20T06:58:41.909Z", "data": "MKA statistics text...", "type": "macsec_policy"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1217,14 +1250,14 @@ def test_get_gateway_statistics_all_params(self): response = _service.get_gateway_statistics( id, 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 'type={}'.format(type) in query_string @@ -1245,11 +1278,13 @@ def test_get_gateway_statistics_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/statistics') mock_response = '{"statistics": [{"created_at": "2020-08-20T06:58:41.909Z", "data": "MKA statistics text...", "type": "macsec_policy"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1261,7 +1296,7 @@ def test_get_gateway_statistics_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.get_gateway_statistics(**req_copy) @@ -1274,7 +1309,8 @@ def test_get_gateway_statistics_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_statistics_value_error() -class TestGetGatewayStatus(): + +class TestGetGatewayStatus: """ Test Class for get_gateway_status """ @@ -1287,11 +1323,13 @@ def test_get_gateway_status_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/status') mock_response = '{"status": [{"type": "bgp", "updated_at": "2020-08-20T06:58:41.909Z", "value": "active"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1301,14 +1339,14 @@ def test_get_gateway_status_all_params(self): response = _service.get_gateway_status( id, type=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 'type={}'.format(type) in query_string @@ -1329,11 +1367,13 @@ def test_get_gateway_status_required_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/status') mock_response = '{"status": [{"type": "bgp", "updated_at": "2020-08-20T06:58:41.909Z", "value": "active"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1341,7 +1381,7 @@ def test_get_gateway_status_required_params(self): # Invoke method response = _service.get_gateway_status( id, - headers={} + headers={}, ) # Check for correct operation @@ -1365,11 +1405,13 @@ def test_get_gateway_status_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/status') mock_response = '{"status": [{"type": "bgp", "updated_at": "2020-08-20T06:58:41.909Z", "value": "active"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1379,7 +1421,7 @@ def test_get_gateway_status_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_gateway_status(**req_copy) @@ -1392,6 +1434,7 @@ def test_get_gateway_status_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_status_value_error() + # endregion ############################################################################## # End of Service: Gateways @@ -1402,7 +1445,8 @@ def test_get_gateway_status_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -1447,7 +1491,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGatewayExportRouteFilters(): + +class TestListGatewayExportRouteFilters: """ Test Class for list_gateway_export_route_filters """ @@ -1460,11 +1505,13 @@ def test_list_gateway_export_route_filters_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"export_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1472,7 +1519,7 @@ def test_list_gateway_export_route_filters_all_params(self): # Invoke method response = _service.list_gateway_export_route_filters( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -1496,11 +1543,13 @@ def test_list_gateway_export_route_filters_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"export_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1510,7 +1559,7 @@ def test_list_gateway_export_route_filters_value_error(self): "gateway_id": 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_gateway_export_route_filters(**req_copy) @@ -1523,7 +1572,8 @@ def test_list_gateway_export_route_filters_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_export_route_filters_value_error() -class TestCreateGatewayExportRouteFilter(): + +class TestCreateGatewayExportRouteFilter: """ Test Class for create_gateway_export_route_filter """ @@ -1536,11 +1586,13 @@ def test_create_gateway_export_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1558,7 +1610,7 @@ def test_create_gateway_export_route_filter_all_params(self): before=before, ge=ge, le=le, - headers={} + headers={}, ) # Check for correct operation @@ -1589,11 +1641,13 @@ def test_create_gateway_export_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1610,7 +1664,7 @@ def test_create_gateway_export_route_filter_value_error(self): "prefix": prefix, } for param 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_gateway_export_route_filter(**req_copy) @@ -1623,7 +1677,8 @@ def test_create_gateway_export_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_export_route_filter_value_error() -class TestReplaceGatewayExportRouteFilters(): + +class TestReplaceGatewayExportRouteFilters: """ Test Class for replace_gateway_export_route_filters """ @@ -1636,11 +1691,13 @@ def test_replace_gateway_export_route_filters_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"export_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a GatewayTemplateRouteFilter model gateway_template_route_filter_model = {} @@ -1659,7 +1716,7 @@ def test_replace_gateway_export_route_filters_all_params(self): gateway_id, if_match, export_route_filters=export_route_filters, - headers={} + headers={}, ) # Check for correct operation @@ -1686,11 +1743,13 @@ def test_replace_gateway_export_route_filters_required_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"export_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1700,7 +1759,7 @@ def test_replace_gateway_export_route_filters_required_params(self): response = _service.replace_gateway_export_route_filters( gateway_id, if_match, - headers={} + headers={}, ) # Check for correct operation @@ -1724,11 +1783,13 @@ def test_replace_gateway_export_route_filters_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters') mock_response = '{"export_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1740,7 +1801,7 @@ def test_replace_gateway_export_route_filters_value_error(self): "if_match": if_match, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_gateway_export_route_filters(**req_copy) @@ -1753,7 +1814,8 @@ def test_replace_gateway_export_route_filters_value_error_with_retries(self): _service.disable_retries() self.test_replace_gateway_export_route_filters_value_error() -class TestDeleteGatewayExportRouteFilter(): + +class TestDeleteGatewayExportRouteFilter: """ Test Class for delete_gateway_export_route_filter """ @@ -1765,9 +1827,11 @@ def test_delete_gateway_export_route_filter_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1777,7 +1841,7 @@ def test_delete_gateway_export_route_filter_all_params(self): response = _service.delete_gateway_export_route_filter( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -1800,9 +1864,11 @@ def test_delete_gateway_export_route_filter_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1814,7 +1880,7 @@ def test_delete_gateway_export_route_filter_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_gateway_export_route_filter(**req_copy) @@ -1827,7 +1893,8 @@ def test_delete_gateway_export_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_delete_gateway_export_route_filter_value_error() -class TestGetGatewayExportRouteFilter(): + +class TestGetGatewayExportRouteFilter: """ Test Class for get_gateway_export_route_filter """ @@ -1840,11 +1907,13 @@ def test_get_gateway_export_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1854,7 +1923,7 @@ def test_get_gateway_export_route_filter_all_params(self): response = _service.get_gateway_export_route_filter( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -1878,11 +1947,13 @@ def test_get_gateway_export_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -1894,7 +1965,7 @@ def test_get_gateway_export_route_filter_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_gateway_export_route_filter(**req_copy) @@ -1907,7 +1978,8 @@ def test_get_gateway_export_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_export_route_filter_value_error() -class TestUpdateGatewayExportRouteFilter(): + +class TestUpdateGatewayExportRouteFilter: """ Test Class for update_gateway_export_route_filter """ @@ -1920,11 +1992,13 @@ def test_update_gateway_export_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a UpdateRouteFilterTemplate model update_route_filter_template_model = {} @@ -1944,7 +2018,7 @@ def test_update_gateway_export_route_filter_all_params(self): gateway_id, id, update_route_filter_template, - headers={} + headers={}, ) # Check for correct operation @@ -1971,11 +2045,13 @@ def test_update_gateway_export_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/export_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a UpdateRouteFilterTemplate model update_route_filter_template_model = {} @@ -1997,7 +2073,7 @@ def test_update_gateway_export_route_filter_value_error(self): "update_route_filter_template": update_route_filter_template, } for param 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_gateway_export_route_filter(**req_copy) @@ -2010,6 +2086,7 @@ def test_update_gateway_export_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_update_gateway_export_route_filter_value_error() + # endregion ############################################################################## # End of Service: GatewayExportRouteFilters @@ -2020,7 +2097,8 @@ def test_update_gateway_export_route_filter_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -2065,7 +2143,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGatewayImportRouteFilters(): + +class TestListGatewayImportRouteFilters: """ Test Class for list_gateway_import_route_filters """ @@ -2078,11 +2157,13 @@ def test_list_gateway_import_route_filters_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"import_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2090,7 +2171,7 @@ def test_list_gateway_import_route_filters_all_params(self): # Invoke method response = _service.list_gateway_import_route_filters( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -2114,11 +2195,13 @@ def test_list_gateway_import_route_filters_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"import_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2128,7 +2211,7 @@ def test_list_gateway_import_route_filters_value_error(self): "gateway_id": 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_gateway_import_route_filters(**req_copy) @@ -2141,7 +2224,8 @@ def test_list_gateway_import_route_filters_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_import_route_filters_value_error() -class TestCreateGatewayImportRouteFilter(): + +class TestCreateGatewayImportRouteFilter: """ Test Class for create_gateway_import_route_filter """ @@ -2154,11 +2238,13 @@ def test_create_gateway_import_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2176,7 +2262,7 @@ def test_create_gateway_import_route_filter_all_params(self): before=before, ge=ge, le=le, - headers={} + headers={}, ) # Check for correct operation @@ -2207,11 +2293,13 @@ def test_create_gateway_import_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2228,7 +2316,7 @@ def test_create_gateway_import_route_filter_value_error(self): "prefix": prefix, } for param 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_gateway_import_route_filter(**req_copy) @@ -2241,7 +2329,8 @@ def test_create_gateway_import_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_import_route_filter_value_error() -class TestReplaceGatewayImportRouteFilters(): + +class TestReplaceGatewayImportRouteFilters: """ Test Class for replace_gateway_import_route_filters """ @@ -2254,11 +2343,13 @@ def test_replace_gateway_import_route_filters_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"import_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a GatewayTemplateRouteFilter model gateway_template_route_filter_model = {} @@ -2277,7 +2368,7 @@ def test_replace_gateway_import_route_filters_all_params(self): gateway_id, if_match, import_route_filters=import_route_filters, - headers={} + headers={}, ) # Check for correct operation @@ -2304,11 +2395,13 @@ def test_replace_gateway_import_route_filters_required_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"import_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2318,7 +2411,7 @@ def test_replace_gateway_import_route_filters_required_params(self): response = _service.replace_gateway_import_route_filters( gateway_id, if_match, - headers={} + headers={}, ) # Check for correct operation @@ -2342,11 +2435,13 @@ def test_replace_gateway_import_route_filters_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters') mock_response = '{"import_route_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2358,7 +2453,7 @@ def test_replace_gateway_import_route_filters_value_error(self): "if_match": if_match, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_gateway_import_route_filters(**req_copy) @@ -2371,7 +2466,8 @@ def test_replace_gateway_import_route_filters_value_error_with_retries(self): _service.disable_retries() self.test_replace_gateway_import_route_filters_value_error() -class TestDeleteGatewayImportRouteFilter(): + +class TestDeleteGatewayImportRouteFilter: """ Test Class for delete_gateway_import_route_filter """ @@ -2383,9 +2479,11 @@ def test_delete_gateway_import_route_filter_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2395,7 +2493,7 @@ def test_delete_gateway_import_route_filter_all_params(self): response = _service.delete_gateway_import_route_filter( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -2418,9 +2516,11 @@ def test_delete_gateway_import_route_filter_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2432,7 +2532,7 @@ def test_delete_gateway_import_route_filter_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_gateway_import_route_filter(**req_copy) @@ -2445,7 +2545,8 @@ def test_delete_gateway_import_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_delete_gateway_import_route_filter_value_error() -class TestGetGatewayImportRouteFilter(): + +class TestGetGatewayImportRouteFilter: """ Test Class for get_gateway_import_route_filter """ @@ -2458,11 +2559,13 @@ def test_get_gateway_import_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2472,7 +2575,7 @@ def test_get_gateway_import_route_filter_all_params(self): response = _service.get_gateway_import_route_filter( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -2496,11 +2599,13 @@ def test_get_gateway_import_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2512,7 +2617,7 @@ def test_get_gateway_import_route_filter_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_gateway_import_route_filter(**req_copy) @@ -2525,7 +2630,8 @@ def test_get_gateway_import_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_import_route_filter_value_error() -class TestUpdateGatewayImportRouteFilter(): + +class TestUpdateGatewayImportRouteFilter: """ Test Class for update_gateway_import_route_filter """ @@ -2538,11 +2644,13 @@ def test_update_gateway_import_route_filter_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a UpdateRouteFilterTemplate model update_route_filter_template_model = {} @@ -2562,7 +2670,7 @@ def test_update_gateway_import_route_filter_all_params(self): gateway_id, id, update_route_filter_template, - headers={} + headers={}, ) # Check for correct operation @@ -2589,11 +2697,13 @@ def test_update_gateway_import_route_filter_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/import_route_filters/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2020-11-02T20:40:29.622Z", "ge": 25, "id": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "le": 30, "prefix": "192.168.100.0/24", "updated_at": "2020-11-02T20:40:29.622Z"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a UpdateRouteFilterTemplate model update_route_filter_template_model = {} @@ -2615,7 +2725,7 @@ def test_update_gateway_import_route_filter_value_error(self): "update_route_filter_template": update_route_filter_template, } for param 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_gateway_import_route_filter(**req_copy) @@ -2628,6 +2738,7 @@ def test_update_gateway_import_route_filter_value_error_with_retries(self): _service.disable_retries() self.test_update_gateway_import_route_filter_value_error() + # endregion ############################################################################## # End of Service: GatewayImportRouteFilters @@ -2638,7 +2749,8 @@ def test_update_gateway_import_route_filter_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -2683,7 +2795,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGatewayRouteReports(): + +class TestListGatewayRouteReports: """ Test Class for list_gateway_route_reports """ @@ -2696,11 +2809,13 @@ def test_list_gateway_route_reports_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports') mock_response = '{"route_reports": [{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2708,7 +2823,7 @@ def test_list_gateway_route_reports_all_params(self): # Invoke method response = _service.list_gateway_route_reports( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -2732,11 +2847,13 @@ def test_list_gateway_route_reports_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports') mock_response = '{"route_reports": [{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2746,7 +2863,7 @@ def test_list_gateway_route_reports_value_error(self): "gateway_id": 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_gateway_route_reports(**req_copy) @@ -2759,7 +2876,8 @@ def test_list_gateway_route_reports_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_route_reports_value_error() -class TestCreateGatewayRouteReport(): + +class TestCreateGatewayRouteReport: """ Test Class for create_gateway_route_report """ @@ -2772,11 +2890,13 @@ def test_create_gateway_route_report_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports') mock_response = '{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=202) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=202, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2784,7 +2904,7 @@ def test_create_gateway_route_report_all_params(self): # Invoke method response = _service.create_gateway_route_report( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -2808,11 +2928,13 @@ def test_create_gateway_route_report_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports') mock_response = '{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=202) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=202, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2822,7 +2944,7 @@ def test_create_gateway_route_report_value_error(self): "gateway_id": 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.create_gateway_route_report(**req_copy) @@ -2835,7 +2957,8 @@ def test_create_gateway_route_report_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_route_report_value_error() -class TestDeleteGatewayRouteReport(): + +class TestDeleteGatewayRouteReport: """ Test Class for delete_gateway_route_report """ @@ -2847,9 +2970,11 @@ def test_delete_gateway_route_report_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2859,7 +2984,7 @@ def test_delete_gateway_route_report_all_params(self): response = _service.delete_gateway_route_report( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -2882,9 +3007,11 @@ def test_delete_gateway_route_report_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2896,7 +3023,7 @@ def test_delete_gateway_route_report_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_gateway_route_report(**req_copy) @@ -2909,7 +3036,8 @@ def test_delete_gateway_route_report_value_error_with_retries(self): _service.disable_retries() self.test_delete_gateway_route_report_value_error() -class TestGetGatewayRouteReport(): + +class TestGetGatewayRouteReport: """ Test Class for get_gateway_route_report """ @@ -2922,11 +3050,13 @@ def test_get_gateway_route_report_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2936,7 +3066,7 @@ def test_get_gateway_route_report_all_params(self): response = _service.get_gateway_route_report( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -2960,11 +3090,13 @@ def test_get_gateway_route_report_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/route_reports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"advertised_routes": [{"as_path": "64999 64999 64998 I", "prefix": "172.17.0.0/16"}], "created_at": "2019-01-01T12:00:00.000Z", "gateway_routes": [{"prefix": "172.17.0.0/16"}], "id": "1a15dcab-7e26-45e1-b7c5-bc690eaa9724", "on_prem_routes": [{"as_path": "64999 64999 64998 I", "next_hop": "172.17.0.0", "prefix": "172.17.0.0/16"}], "overlapping_routes": [{"routes": [{"prefix": "172.17.0.0/16", "type": "virtual_connection", "virtual_connection_id": "d2d985d8-1d8e-4e8b-96cd-cee2290ecaff"}]}], "status": "complete", "updated_at": "2019-01-01T12:00:00.000Z", "virtual_connection_routes": [{"routes": [{"active": true, "local_preference": "200", "prefix": "172.17.0.0/16"}], "virtual_connection_id": "3c265a62-91da-4261-a950-950b6af0eb58", "virtual_connection_name": "vpc1", "virtual_connection_type": "vpc"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -2976,7 +3108,7 @@ def test_get_gateway_route_report_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_gateway_route_report(**req_copy) @@ -2989,6 +3121,7 @@ def test_get_gateway_route_report_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_route_report_value_error() + # endregion ############################################################################## # End of Service: GatewayRouteReports @@ -2999,7 +3132,8 @@ def test_get_gateway_route_report_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -3044,7 +3178,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGatewayVirtualConnections(): + +class TestListGatewayVirtualConnections: """ Test Class for list_gateway_virtual_connections """ @@ -3057,11 +3192,13 @@ def test_list_gateway_virtual_connections_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections') mock_response = '{"virtual_connections": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3069,7 +3206,7 @@ def test_list_gateway_virtual_connections_all_params(self): # Invoke method response = _service.list_gateway_virtual_connections( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -3093,11 +3230,13 @@ def test_list_gateway_virtual_connections_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections') mock_response = '{"virtual_connections": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3107,7 +3246,7 @@ def test_list_gateway_virtual_connections_value_error(self): "gateway_id": 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_gateway_virtual_connections(**req_copy) @@ -3120,7 +3259,8 @@ def test_list_gateway_virtual_connections_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_virtual_connections_value_error() -class TestCreateGatewayVirtualConnection(): + +class TestCreateGatewayVirtualConnection: """ Test Class for create_gateway_virtual_connection """ @@ -3133,11 +3273,13 @@ def test_create_gateway_virtual_connection_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3151,7 +3293,7 @@ def test_create_gateway_virtual_connection_all_params(self): name, type, network_id=network_id, - headers={} + headers={}, ) # Check for correct operation @@ -3180,11 +3322,13 @@ def test_create_gateway_virtual_connection_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3199,7 +3343,7 @@ def test_create_gateway_virtual_connection_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_gateway_virtual_connection(**req_copy) @@ -3212,7 +3356,8 @@ def test_create_gateway_virtual_connection_value_error_with_retries(self): _service.disable_retries() self.test_create_gateway_virtual_connection_value_error() -class TestDeleteGatewayVirtualConnection(): + +class TestDeleteGatewayVirtualConnection: """ Test Class for delete_gateway_virtual_connection """ @@ -3224,9 +3369,11 @@ def test_delete_gateway_virtual_connection_all_params(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3236,7 +3383,7 @@ def test_delete_gateway_virtual_connection_all_params(self): response = _service.delete_gateway_virtual_connection( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -3259,9 +3406,11 @@ def test_delete_gateway_virtual_connection_value_error(self): """ # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') - responses.add(responses.DELETE, - url, - status=204) + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3273,7 +3422,7 @@ def test_delete_gateway_virtual_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_gateway_virtual_connection(**req_copy) @@ -3286,7 +3435,8 @@ def test_delete_gateway_virtual_connection_value_error_with_retries(self): _service.disable_retries() self.test_delete_gateway_virtual_connection_value_error() -class TestGetGatewayVirtualConnection(): + +class TestGetGatewayVirtualConnection: """ Test Class for get_gateway_virtual_connection """ @@ -3299,11 +3449,13 @@ def test_get_gateway_virtual_connection_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3313,7 +3465,7 @@ def test_get_gateway_virtual_connection_all_params(self): response = _service.get_gateway_virtual_connection( gateway_id, id, - headers={} + headers={}, ) # Check for correct operation @@ -3337,11 +3489,13 @@ def test_get_gateway_virtual_connection_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3353,7 +3507,7 @@ def test_get_gateway_virtual_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_gateway_virtual_connection(**req_copy) @@ -3366,7 +3520,8 @@ def test_get_gateway_virtual_connection_value_error_with_retries(self): _service.disable_retries() self.test_get_gateway_virtual_connection_value_error() -class TestUpdateGatewayVirtualConnection(): + +class TestUpdateGatewayVirtualConnection: """ Test Class for update_gateway_virtual_connection """ @@ -3379,11 +3534,13 @@ def test_update_gateway_virtual_connection_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3397,7 +3554,7 @@ def test_update_gateway_virtual_connection_all_params(self): id, name=name, status=status, - headers={} + headers={}, ) # Check for correct operation @@ -3425,11 +3582,13 @@ def test_update_gateway_virtual_connection_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/virtual_connections/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "newVC", "network_account": "00aa14a2e0fb102c8995ebefff865555", "network_id": "crn:v1:bluemix:public:is:us-east:a/28e4d90ac7504be69447111122223333::vpc:aaa81ac8-5e96-42a0-a4b7-6c2e2d1bbbbb", "status": "attached", "type": "vpc"}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3443,7 +3602,7 @@ def test_update_gateway_virtual_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.update_gateway_virtual_connection(**req_copy) @@ -3456,6 +3615,7 @@ def test_update_gateway_virtual_connection_value_error_with_retries(self): _service.disable_retries() self.test_update_gateway_virtual_connection_value_error() + # endregion ############################################################################## # End of Service: VirtualConnections @@ -3466,7 +3626,8 @@ def test_update_gateway_virtual_connection_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -3511,7 +3672,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListOfferingTypeLocations(): + +class TestListOfferingTypeLocations: """ Test Class for list_offering_type_locations """ @@ -3524,11 +3686,13 @@ def test_list_offering_type_locations_all_params(self): # Set up mock url = preprocess_url('/offering_types/dedicated/locations') mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "macsec_enabled": false, "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "provision_enabled": true, "vpc_region": "us-south"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3536,7 +3700,7 @@ def test_list_offering_type_locations_all_params(self): # Invoke method response = _service.list_offering_type_locations( offering_type, - headers={} + headers={}, ) # Check for correct operation @@ -3560,11 +3724,13 @@ def test_list_offering_type_locations_value_error(self): # Set up mock url = preprocess_url('/offering_types/dedicated/locations') mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "macsec_enabled": false, "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "provision_enabled": true, "vpc_region": "us-south"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3574,7 +3740,7 @@ def test_list_offering_type_locations_value_error(self): "offering_type": offering_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.list_offering_type_locations(**req_copy) @@ -3587,7 +3753,8 @@ def test_list_offering_type_locations_value_error_with_retries(self): _service.disable_retries() self.test_list_offering_type_locations_value_error() -class TestListOfferingTypeLocationCrossConnectRouters(): + +class TestListOfferingTypeLocationCrossConnectRouters: """ Test Class for list_offering_type_location_cross_connect_routers """ @@ -3600,11 +3767,13 @@ def test_list_offering_type_location_cross_connect_routers_all_params(self): # Set up mock url = preprocess_url('/offering_types/dedicated/locations/testString/cross_connect_routers') mock_response = '{"cross_connect_routers": [{"capabilities": ["capabilities"], "router_name": "xcr01.dal03", "total_connections": 1}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3614,7 +3783,7 @@ def test_list_offering_type_location_cross_connect_routers_all_params(self): response = _service.list_offering_type_location_cross_connect_routers( offering_type, location_name, - headers={} + headers={}, ) # Check for correct operation @@ -3638,11 +3807,13 @@ def test_list_offering_type_location_cross_connect_routers_value_error(self): # Set up mock url = preprocess_url('/offering_types/dedicated/locations/testString/cross_connect_routers') mock_response = '{"cross_connect_routers": [{"capabilities": ["capabilities"], "router_name": "xcr01.dal03", "total_connections": 1}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3654,7 +3825,7 @@ def test_list_offering_type_location_cross_connect_routers_value_error(self): "location_name": location_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_offering_type_location_cross_connect_routers(**req_copy) @@ -3667,7 +3838,8 @@ def test_list_offering_type_location_cross_connect_routers_value_error_with_retr _service.disable_retries() self.test_list_offering_type_location_cross_connect_routers_value_error() -class TestListOfferingTypeSpeeds(): + +class TestListOfferingTypeSpeeds: """ Test Class for list_offering_type_speeds """ @@ -3680,11 +3852,13 @@ def test_list_offering_type_speeds_all_params(self): # Set up mock url = preprocess_url('/offering_types/dedicated/speeds') mock_response = '{"speeds": [{"capabilities": ["capabilities"], "link_speed": 2000, "macsec_enabled": false}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3692,7 +3866,7 @@ def test_list_offering_type_speeds_all_params(self): # Invoke method response = _service.list_offering_type_speeds( offering_type, - headers={} + headers={}, ) # Check for correct operation @@ -3716,11 +3890,13 @@ def test_list_offering_type_speeds_value_error(self): # Set up mock url = preprocess_url('/offering_types/dedicated/speeds') mock_response = '{"speeds": [{"capabilities": ["capabilities"], "link_speed": 2000, "macsec_enabled": false}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values offering_type = 'dedicated' @@ -3730,7 +3906,7 @@ def test_list_offering_type_speeds_value_error(self): "offering_type": offering_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.list_offering_type_speeds(**req_copy) @@ -3743,6 +3919,7 @@ def test_list_offering_type_speeds_value_error_with_retries(self): _service.disable_retries() self.test_list_offering_type_speeds_value_error() + # endregion ############################################################################## # End of Service: OfferingInformation @@ -3753,7 +3930,8 @@ def test_list_offering_type_speeds_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -3798,7 +3976,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListPorts(): + +class TestListPorts: """ Test Class for list_ports """ @@ -3811,15 +3990,17 @@ def test_list_ports_all_params(self): # Set up mock url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/v1/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/v1/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"direct_link_count": 1, "id": "01122b9b-820f-4c44-8a31-77f1f0806765", "label": "XCR-FRK-CS-SEC-01", "location_display_name": "Dallas 03", "location_name": "dal03", "provider_name": "provider_1", "supported_link_speeds": [21]}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values start = 'testString' - limit = 1 + limit = 50 location_name = 'testString' # Invoke method @@ -3827,14 +4008,14 @@ def test_list_ports_all_params(self): start=start, limit=limit, location_name=location_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 @@ -3857,16 +4038,17 @@ def test_list_ports_required_params(self): # Set up mock url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/v1/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/v1/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"direct_link_count": 1, "id": "01122b9b-820f-4c44-8a31-77f1f0806765", "label": "XCR-FRK-CS-SEC-01", "location_display_name": "Dallas 03", "location_name": "dal03", "provider_name": "provider_1", "supported_link_speeds": [21]}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.list_ports() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -3888,17 +4070,19 @@ def test_list_ports_value_error(self): # Set up mock url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/v1/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/v1/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"direct_link_count": 1, "id": "01122b9b-820f-4c44-8a31-77f1f0806765", "label": "XCR-FRK-CS-SEC-01", "location_display_name": "Dallas 03", "location_name": "dal03", "provider_name": "provider_1", "supported_link_speeds": [21]}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError 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_ports(**req_copy) @@ -3920,16 +4104,20 @@ def test_list_ports_with_pager_get_next(self): url = preprocess_url('/ports') mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"ports":[{"direct_link_count":1,"id":"01122b9b-820f-4c44-8a31-77f1f0806765","label":"XCR-FRK-CS-SEC-01","location_display_name":"Dallas 03","location_name":"dal03","provider_name":"provider_1","supported_link_speeds":[21]}]}' mock_response2 = '{"total_count":2,"limit":1,"ports":[{"direct_link_count":1,"id":"01122b9b-820f-4c44-8a31-77f1f0806765","label":"XCR-FRK-CS-SEC-01","location_display_name":"Dallas 03","location_name":"dal03","provider_name":"provider_1","supported_link_speeds":[21]}]}' - responses.add(responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200) - responses.add(responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) # Exercise the pager class for this operation all_results = [] @@ -3953,16 +4141,20 @@ def test_list_ports_with_pager_get_all(self): url = preprocess_url('/ports') mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"ports":[{"direct_link_count":1,"id":"01122b9b-820f-4c44-8a31-77f1f0806765","label":"XCR-FRK-CS-SEC-01","location_display_name":"Dallas 03","location_name":"dal03","provider_name":"provider_1","supported_link_speeds":[21]}]}' mock_response2 = '{"total_count":2,"limit":1,"ports":[{"direct_link_count":1,"id":"01122b9b-820f-4c44-8a31-77f1f0806765","label":"XCR-FRK-CS-SEC-01","location_display_name":"Dallas 03","location_name":"dal03","provider_name":"provider_1","supported_link_speeds":[21]}]}' - responses.add(responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200) - responses.add(responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) # Exercise the pager class for this operation pager = PortsPager( @@ -3974,7 +4166,8 @@ def test_list_ports_with_pager_get_all(self): assert all_results is not None assert len(all_results) == 2 -class TestGetPort(): + +class TestGetPort: """ Test Class for get_port """ @@ -3987,11 +4180,13 @@ def test_get_port_all_params(self): # Set up mock url = preprocess_url('/ports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"direct_link_count": 1, "id": "01122b9b-820f-4c44-8a31-77f1f0806765", "label": "XCR-FRK-CS-SEC-01", "location_display_name": "Dallas 03", "location_name": "dal03", "provider_name": "provider_1", "supported_link_speeds": [21]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -3999,7 +4194,7 @@ def test_get_port_all_params(self): # Invoke method response = _service.get_port( id, - headers={} + headers={}, ) # Check for correct operation @@ -4023,11 +4218,13 @@ def test_get_port_value_error(self): # Set up mock url = preprocess_url('/ports/0a06fb9b-820f-4c44-8a31-77f1f0806d28') mock_response = '{"direct_link_count": 1, "id": "01122b9b-820f-4c44-8a31-77f1f0806765", "label": "XCR-FRK-CS-SEC-01", "location_display_name": "Dallas 03", "location_name": "dal03", "provider_name": "provider_1", "supported_link_speeds": [21]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -4037,7 +4234,7 @@ def test_get_port_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_port(**req_copy) @@ -4050,6 +4247,7 @@ def test_get_port_value_error_with_retries(self): _service.disable_retries() self.test_get_port_value_error() + # endregion ############################################################################## # End of Service: Ports @@ -4060,7 +4258,8 @@ def test_get_port_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -4105,7 +4304,8 @@ def test_new_instance_required_param_none(self): version=None, ) -class TestListGatewayAsPrepends(): + +class TestListGatewayAsPrepends: """ Test Class for list_gateway_as_prepends """ @@ -4118,11 +4318,13 @@ def test_list_gateway_as_prepends_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/as_prepends') mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -4130,7 +4332,7 @@ def test_list_gateway_as_prepends_all_params(self): # Invoke method response = _service.list_gateway_as_prepends( gateway_id, - headers={} + headers={}, ) # Check for correct operation @@ -4154,11 +4356,13 @@ def test_list_gateway_as_prepends_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/as_prepends') mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values gateway_id = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' @@ -4168,7 +4372,7 @@ def test_list_gateway_as_prepends_value_error(self): "gateway_id": 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_gateway_as_prepends(**req_copy) @@ -4181,7 +4385,8 @@ def test_list_gateway_as_prepends_value_error_with_retries(self): _service.disable_retries() self.test_list_gateway_as_prepends_value_error() -class TestReplaceGatewayAsPrepends(): + +class TestReplaceGatewayAsPrepends: """ Test Class for replace_gateway_as_prepends """ @@ -4194,11 +4399,13 @@ def test_replace_gateway_as_prepends_all_params(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/as_prepends') mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a AsPrependPrefixArrayTemplate model as_prepend_prefix_array_template_model = {} @@ -4216,7 +4423,7 @@ def test_replace_gateway_as_prepends_all_params(self): gateway_id, if_match, as_prepends=as_prepends, - headers={} + headers={}, ) # Check for correct operation @@ -4243,11 +4450,13 @@ def test_replace_gateway_as_prepends_value_error(self): # Set up mock url = preprocess_url('/gateways/0a06fb9b-820f-4c44-8a31-77f1f0806d28/as_prepends') mock_response = '{"as_prepends": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "length": 4, "policy": "import", "specific_prefixes": ["192.168.3.0/24"], "updated_at": "2019-01-01T12:00:00.000Z"}]}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a AsPrependPrefixArrayTemplate model as_prepend_prefix_array_template_model = {} @@ -4266,7 +4475,7 @@ def test_replace_gateway_as_prepends_value_error(self): "if_match": if_match, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_gateway_as_prepends(**req_copy) @@ -4279,6 +4488,7 @@ def test_replace_gateway_as_prepends_value_error_with_retries(self): _service.disable_retries() self.test_replace_gateway_as_prepends_value_error() + # endregion ############################################################################## # End of Service: GatewayASPrepends @@ -4289,7 +4499,9 @@ def test_replace_gateway_as_prepends_value_error_with_retries(self): # Start of Model Tests ############################################################################## # region -class TestModel_AsPrepend(): + + +class TestModel_AsPrepend: """ Test Class for AsPrepend """ @@ -4324,7 +4536,8 @@ def test_as_prepend_serialization(self): as_prepend_model_json2 = as_prepend_model.to_dict() assert as_prepend_model_json2 == as_prepend_model_json -class TestModel_AsPrependCollection(): + +class TestModel_AsPrependCollection: """ Test Class for AsPrependCollection """ @@ -4336,7 +4549,7 @@ def test_as_prepend_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - as_prepend_entry_model = {} # AsPrependEntry + as_prepend_entry_model = {} # AsPrependEntry as_prepend_entry_model['created_at'] = '2019-01-01T12:00:00Z' as_prepend_entry_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' as_prepend_entry_model['length'] = 4 @@ -4363,7 +4576,8 @@ def test_as_prepend_collection_serialization(self): as_prepend_collection_model_json2 = as_prepend_collection_model.to_dict() assert as_prepend_collection_model_json2 == as_prepend_collection_model_json -class TestModel_AsPrependEntry(): + +class TestModel_AsPrependEntry: """ Test Class for AsPrependEntry """ @@ -4397,7 +4611,8 @@ def test_as_prepend_entry_serialization(self): as_prepend_entry_model_json2 = as_prepend_entry_model.to_dict() assert as_prepend_entry_model_json2 == as_prepend_entry_model_json -class TestModel_AsPrependPrefixArrayTemplate(): + +class TestModel_AsPrependPrefixArrayTemplate: """ Test Class for AsPrependPrefixArrayTemplate """ @@ -4428,7 +4643,8 @@ def test_as_prepend_prefix_array_template_serialization(self): as_prepend_prefix_array_template_model_json2 = as_prepend_prefix_array_template_model.to_dict() assert as_prepend_prefix_array_template_model_json2 == as_prepend_prefix_array_template_model_json -class TestModel_AsPrependTemplate(): + +class TestModel_AsPrependTemplate: """ Test Class for AsPrependTemplate """ @@ -4460,7 +4676,38 @@ def test_as_prepend_template_serialization(self): as_prepend_template_model_json2 = as_prepend_template_model.to_dict() assert as_prepend_template_model_json2 == as_prepend_template_model_json -class TestModel_CrossConnectRouter(): + +class TestModel_CrossAccountGatewayPort: + """ + Test Class for CrossAccountGatewayPort + """ + + def test_cross_account_gateway_port_serialization(self): + """ + Test serialization/deserialization for CrossAccountGatewayPort + """ + + # Construct a json representation of a CrossAccountGatewayPort model + cross_account_gateway_port_model_json = {} + cross_account_gateway_port_model_json['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' + + # Construct a model instance of CrossAccountGatewayPort by calling from_dict on the json representation + cross_account_gateway_port_model = CrossAccountGatewayPort.from_dict(cross_account_gateway_port_model_json) + assert cross_account_gateway_port_model != False + + # Construct a model instance of CrossAccountGatewayPort by calling from_dict on the json representation + cross_account_gateway_port_model_dict = CrossAccountGatewayPort.from_dict(cross_account_gateway_port_model_json).__dict__ + cross_account_gateway_port_model2 = CrossAccountGatewayPort(**cross_account_gateway_port_model_dict) + + # Verify the model instances are equivalent + assert cross_account_gateway_port_model == cross_account_gateway_port_model2 + + # Convert model instance back to dict and verify no loss of data + cross_account_gateway_port_model_json2 = cross_account_gateway_port_model.to_dict() + assert cross_account_gateway_port_model_json2 == cross_account_gateway_port_model_json + + +class TestModel_CrossConnectRouter: """ Test Class for CrossConnectRouter """ @@ -4491,7 +4738,8 @@ def test_cross_connect_router_serialization(self): cross_connect_router_model_json2 = cross_connect_router_model.to_dict() assert cross_connect_router_model_json2 == cross_connect_router_model_json -class TestModel_ExportRouteFilterCollection(): + +class TestModel_ExportRouteFilterCollection: """ Test Class for ExportRouteFilterCollection """ @@ -4503,7 +4751,7 @@ def test_export_route_filter_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_filter_model = {} # RouteFilter + route_filter_model = {} # RouteFilter route_filter_model['action'] = 'permit' route_filter_model['before'] = '1a15dcab-7e40-45e1-b7c5-bc690eaa9782' route_filter_model['created_at'] = '2020-11-02T20:40:29.622000Z' @@ -4532,7 +4780,8 @@ def test_export_route_filter_collection_serialization(self): export_route_filter_collection_model_json2 = export_route_filter_collection_model.to_dict() assert export_route_filter_collection_model_json2 == export_route_filter_collection_model_json -class TestModel_Gateway(): + +class TestModel_Gateway: """ Test Class for Gateway """ @@ -4544,7 +4793,7 @@ def test_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - as_prepend_model = {} # AsPrepend + as_prepend_model = {} # AsPrepend as_prepend_model['created_at'] = '2019-01-01T12:00:00Z' as_prepend_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' as_prepend_model['length'] = 4 @@ -4553,31 +4802,31 @@ def test_gateway_serialization(self): as_prepend_model['specific_prefixes'] = ['192.168.3.0/24'] as_prepend_model['updated_at'] = '2019-01-01T12:00:00Z' - gateway_authentication_key_model = {} # GatewayAuthenticationKey + gateway_authentication_key_model = {} # GatewayAuthenticationKey gateway_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' - gateway_bfd_config_model = {} # GatewayBfdConfig + gateway_bfd_config_model = {} # GatewayBfdConfig gateway_bfd_config_model['bfd_status'] = 'up' gateway_bfd_config_model['bfd_status_updated_at'] = '2020-08-20T06:58:41.909000Z' gateway_bfd_config_model['interval'] = 2000 gateway_bfd_config_model['multiplier'] = 10 - gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate + gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate gateway_change_request_model['type'] = 'create_gateway' - gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak + gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak gateway_macsec_config_active_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_active_cak_model['status'] = 'testString' - gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak + gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak gateway_macsec_config_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_fallback_cak_model['status'] = 'testString' - gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak + gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak gateway_macsec_config_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_primary_cak_model['status'] = 'testString' - gateway_macsec_config_model = {} # GatewayMacsecConfig + gateway_macsec_config_model = {} # GatewayMacsecConfig gateway_macsec_config_model['active'] = True gateway_macsec_config_model['active_cak'] = gateway_macsec_config_active_cak_model gateway_macsec_config_model['cipher_suite'] = 'gcm_aes_xpn_256' @@ -4591,10 +4840,10 @@ def test_gateway_serialization(self): gateway_macsec_config_model['status'] = 'secured' gateway_macsec_config_model['window_size'] = 64 - gateway_port_model = {} # GatewayPort + gateway_port_model = {} # GatewayPort gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' - resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' # Construct a json representation of a Gateway model @@ -4615,6 +4864,7 @@ def test_gateway_serialization(self): gateway_model_json['connection_mode'] = 'transit' gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_model_json['cross_account'] = False gateway_model_json['cross_connect_router'] = 'xcr01.dal03' gateway_model_json['customer_name'] = 'newCustomerName' gateway_model_json['default_export_route_filter'] = 'permit' @@ -4629,11 +4879,11 @@ def test_gateway_serialization(self): gateway_model_json['metered'] = False gateway_model_json['name'] = 'myGateway' gateway_model_json['operational_status'] = 'awaiting_completion_notice' - gateway_model_json['patch_panel_completion_notice'] = 'patch panel configuration details' gateway_model_json['port'] = gateway_port_model gateway_model_json['provider_api_managed'] = False gateway_model_json['resource_group'] = resource_group_reference_model gateway_model_json['speed_mbps'] = 1000 + gateway_model_json['patch_panel_completion_notice'] = 'patch panel configuration details' gateway_model_json['type'] = 'dedicated' gateway_model_json['vlan'] = 10 @@ -4652,7 +4902,8 @@ def test_gateway_serialization(self): gateway_model_json2 = gateway_model.to_dict() assert gateway_model_json2 == gateway_model_json -class TestModel_GatewayActionTemplateAuthenticationKey(): + +class TestModel_GatewayActionTemplateAuthenticationKey: """ Test Class for GatewayActionTemplateAuthenticationKey """ @@ -4681,7 +4932,8 @@ def test_gateway_action_template_authentication_key_serialization(self): gateway_action_template_authentication_key_model_json2 = gateway_action_template_authentication_key_model.to_dict() assert gateway_action_template_authentication_key_model_json2 == gateway_action_template_authentication_key_model_json -class TestModel_GatewayAuthenticationKey(): + +class TestModel_GatewayAuthenticationKey: """ Test Class for GatewayAuthenticationKey """ @@ -4710,7 +4962,8 @@ def test_gateway_authentication_key_serialization(self): gateway_authentication_key_model_json2 = gateway_authentication_key_model.to_dict() assert gateway_authentication_key_model_json2 == gateway_authentication_key_model_json -class TestModel_GatewayBfdConfig(): + +class TestModel_GatewayBfdConfig: """ Test Class for GatewayBfdConfig """ @@ -4742,7 +4995,8 @@ def test_gateway_bfd_config_serialization(self): gateway_bfd_config_model_json2 = gateway_bfd_config_model.to_dict() assert gateway_bfd_config_model_json2 == gateway_bfd_config_model_json -class TestModel_GatewayBfdConfigActionTemplate(): + +class TestModel_GatewayBfdConfigActionTemplate: """ Test Class for GatewayBfdConfigActionTemplate """ @@ -4772,7 +5026,8 @@ def test_gateway_bfd_config_action_template_serialization(self): gateway_bfd_config_action_template_model_json2 = gateway_bfd_config_action_template_model.to_dict() assert gateway_bfd_config_action_template_model_json2 == gateway_bfd_config_action_template_model_json -class TestModel_GatewayBfdConfigTemplate(): + +class TestModel_GatewayBfdConfigTemplate: """ Test Class for GatewayBfdConfigTemplate """ @@ -4802,7 +5057,8 @@ def test_gateway_bfd_config_template_serialization(self): gateway_bfd_config_template_model_json2 = gateway_bfd_config_template_model.to_dict() assert gateway_bfd_config_template_model_json2 == gateway_bfd_config_template_model_json -class TestModel_GatewayBfdPatchTemplate(): + +class TestModel_GatewayBfdPatchTemplate: """ Test Class for GatewayBfdPatchTemplate """ @@ -4832,7 +5088,8 @@ def test_gateway_bfd_patch_template_serialization(self): gateway_bfd_patch_template_model_json2 = gateway_bfd_patch_template_model.to_dict() assert gateway_bfd_patch_template_model_json2 == gateway_bfd_patch_template_model_json -class TestModel_GatewayCollection(): + +class TestModel_GatewayCollection: """ Test Class for GatewayCollection """ @@ -4844,7 +5101,7 @@ def test_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - as_prepend_model = {} # AsPrepend + as_prepend_model = {} # AsPrepend as_prepend_model['created_at'] = '2019-01-01T12:00:00Z' as_prepend_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' as_prepend_model['length'] = 4 @@ -4853,31 +5110,31 @@ def test_gateway_collection_serialization(self): as_prepend_model['specific_prefixes'] = ['192.168.3.0/24'] as_prepend_model['updated_at'] = '2019-01-01T12:00:00Z' - gateway_authentication_key_model = {} # GatewayAuthenticationKey + gateway_authentication_key_model = {} # GatewayAuthenticationKey gateway_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' - gateway_bfd_config_model = {} # GatewayBfdConfig + gateway_bfd_config_model = {} # GatewayBfdConfig gateway_bfd_config_model['bfd_status'] = 'up' gateway_bfd_config_model['bfd_status_updated_at'] = '2020-08-20T06:58:41.909000Z' gateway_bfd_config_model['interval'] = 2000 gateway_bfd_config_model['multiplier'] = 10 - gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate + gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate gateway_change_request_model['type'] = 'create_gateway' - gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak + gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak gateway_macsec_config_active_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_active_cak_model['status'] = 'testString' - gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak + gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak gateway_macsec_config_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_fallback_cak_model['status'] = 'testString' - gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak + gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak gateway_macsec_config_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_primary_cak_model['status'] = 'testString' - gateway_macsec_config_model = {} # GatewayMacsecConfig + gateway_macsec_config_model = {} # GatewayMacsecConfig gateway_macsec_config_model['active'] = True gateway_macsec_config_model['active_cak'] = gateway_macsec_config_active_cak_model gateway_macsec_config_model['cipher_suite'] = 'gcm_aes_xpn_256' @@ -4891,54 +5148,55 @@ def test_gateway_collection_serialization(self): gateway_macsec_config_model['status'] = 'secured' gateway_macsec_config_model['window_size'] = 64 - gateway_port_model = {} # GatewayPort + gateway_port_model = {} # GatewayPort gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' - resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' - gateway_model = {} # Gateway - gateway_model['as_prepends'] = [as_prepend_model] - gateway_model['authentication_key'] = gateway_authentication_key_model - gateway_model['bfd_config'] = gateway_bfd_config_model - gateway_model['bgp_asn'] = 64999 - gateway_model['bgp_base_cidr'] = 'testString' - gateway_model['bgp_cer_cidr'] = '10.254.30.78/30' - gateway_model['bgp_ibm_asn'] = 13884 - gateway_model['bgp_ibm_cidr'] = '10.254.30.77/30' - gateway_model['bgp_status'] = 'active' - gateway_model['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' - gateway_model['carrier_name'] = 'myCarrierName' - gateway_model['change_request'] = gateway_change_request_model - gateway_model['completion_notice_reject_reason'] = 'The completion notice file was blank' - gateway_model['connection_mode'] = 'transit' - gateway_model['created_at'] = '2019-01-01T12:00:00Z' - gateway_model['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - gateway_model['cross_connect_router'] = 'xcr01.dal03' - gateway_model['customer_name'] = 'newCustomerName' - gateway_model['default_export_route_filter'] = 'permit' - gateway_model['default_import_route_filter'] = 'permit' - gateway_model['global'] = True - gateway_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - gateway_model['link_status'] = 'up' - gateway_model['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' - gateway_model['location_display_name'] = 'Dallas 03' - gateway_model['location_name'] = 'dal03' - gateway_model['macsec_config'] = gateway_macsec_config_model - gateway_model['metered'] = False - gateway_model['name'] = 'myGateway' - gateway_model['operational_status'] = 'awaiting_completion_notice' - gateway_model['patch_panel_completion_notice'] = 'patch panel configuration details' - gateway_model['port'] = gateway_port_model - gateway_model['provider_api_managed'] = False - gateway_model['resource_group'] = resource_group_reference_model - gateway_model['speed_mbps'] = 1000 - gateway_model['type'] = 'dedicated' - gateway_model['vlan'] = 10 + gateway_collection_gateways_item_model = {} # GatewayCollectionGatewaysItemGateway + gateway_collection_gateways_item_model['as_prepends'] = [as_prepend_model] + gateway_collection_gateways_item_model['authentication_key'] = gateway_authentication_key_model + gateway_collection_gateways_item_model['bfd_config'] = gateway_bfd_config_model + gateway_collection_gateways_item_model['bgp_asn'] = 64999 + gateway_collection_gateways_item_model['bgp_base_cidr'] = 'testString' + gateway_collection_gateways_item_model['bgp_cer_cidr'] = '10.254.30.78/30' + gateway_collection_gateways_item_model['bgp_ibm_asn'] = 13884 + gateway_collection_gateways_item_model['bgp_ibm_cidr'] = '10.254.30.77/30' + gateway_collection_gateways_item_model['bgp_status'] = 'active' + gateway_collection_gateways_item_model['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_model['carrier_name'] = 'myCarrierName' + gateway_collection_gateways_item_model['change_request'] = gateway_change_request_model + gateway_collection_gateways_item_model['completion_notice_reject_reason'] = 'The completion notice file was blank' + gateway_collection_gateways_item_model['connection_mode'] = 'transit' + gateway_collection_gateways_item_model['created_at'] = '2019-01-01T12:00:00Z' + gateway_collection_gateways_item_model['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_model['cross_account'] = False + gateway_collection_gateways_item_model['cross_connect_router'] = 'xcr01.dal03' + gateway_collection_gateways_item_model['customer_name'] = 'newCustomerName' + gateway_collection_gateways_item_model['default_export_route_filter'] = 'permit' + gateway_collection_gateways_item_model['default_import_route_filter'] = 'permit' + gateway_collection_gateways_item_model['global'] = True + gateway_collection_gateways_item_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_model['link_status'] = 'up' + gateway_collection_gateways_item_model['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_model['location_display_name'] = 'Dallas 03' + gateway_collection_gateways_item_model['location_name'] = 'dal03' + gateway_collection_gateways_item_model['macsec_config'] = gateway_macsec_config_model + gateway_collection_gateways_item_model['metered'] = False + gateway_collection_gateways_item_model['name'] = 'myGateway' + gateway_collection_gateways_item_model['operational_status'] = 'awaiting_completion_notice' + gateway_collection_gateways_item_model['port'] = gateway_port_model + gateway_collection_gateways_item_model['provider_api_managed'] = False + gateway_collection_gateways_item_model['resource_group'] = resource_group_reference_model + gateway_collection_gateways_item_model['speed_mbps'] = 1000 + gateway_collection_gateways_item_model['patch_panel_completion_notice'] = 'patch panel configuration details' + gateway_collection_gateways_item_model['type'] = 'dedicated' + gateway_collection_gateways_item_model['vlan'] = 10 # Construct a json representation of a GatewayCollection model gateway_collection_model_json = {} - gateway_collection_model_json['gateways'] = [gateway_model] + gateway_collection_model_json['gateways'] = [gateway_collection_gateways_item_model] # Construct a model instance of GatewayCollection by calling from_dict on the json representation gateway_collection_model = GatewayCollection.from_dict(gateway_collection_model_json) @@ -4955,7 +5213,8 @@ def test_gateway_collection_serialization(self): gateway_collection_model_json2 = gateway_collection_model.to_dict() assert gateway_collection_model_json2 == gateway_collection_model_json -class TestModel_GatewayMacsecConfig(): + +class TestModel_GatewayMacsecConfig: """ Test Class for GatewayMacsecConfig """ @@ -4967,15 +5226,15 @@ def test_gateway_macsec_config_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak + gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak gateway_macsec_config_active_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_active_cak_model['status'] = 'testString' - gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak + gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak gateway_macsec_config_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_fallback_cak_model['status'] = 'testString' - gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak + gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak gateway_macsec_config_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' gateway_macsec_config_primary_cak_model['status'] = 'testString' @@ -5009,7 +5268,8 @@ def test_gateway_macsec_config_serialization(self): gateway_macsec_config_model_json2 = gateway_macsec_config_model.to_dict() assert gateway_macsec_config_model_json2 == gateway_macsec_config_model_json -class TestModel_GatewayMacsecConfigActiveCak(): + +class TestModel_GatewayMacsecConfigActiveCak: """ Test Class for GatewayMacsecConfigActiveCak """ @@ -5039,7 +5299,8 @@ def test_gateway_macsec_config_active_cak_serialization(self): gateway_macsec_config_active_cak_model_json2 = gateway_macsec_config_active_cak_model.to_dict() assert gateway_macsec_config_active_cak_model_json2 == gateway_macsec_config_active_cak_model_json -class TestModel_GatewayMacsecConfigFallbackCak(): + +class TestModel_GatewayMacsecConfigFallbackCak: """ Test Class for GatewayMacsecConfigFallbackCak """ @@ -5069,7 +5330,8 @@ def test_gateway_macsec_config_fallback_cak_serialization(self): gateway_macsec_config_fallback_cak_model_json2 = gateway_macsec_config_fallback_cak_model.to_dict() assert gateway_macsec_config_fallback_cak_model_json2 == gateway_macsec_config_fallback_cak_model_json -class TestModel_GatewayMacsecConfigPatchTemplate(): + +class TestModel_GatewayMacsecConfigPatchTemplate: """ Test Class for GatewayMacsecConfigPatchTemplate """ @@ -5081,10 +5343,10 @@ def test_gateway_macsec_config_patch_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_macsec_config_patch_template_fallback_cak_model = {} # GatewayMacsecConfigPatchTemplateFallbackCak + gateway_macsec_config_patch_template_fallback_cak_model = {} # GatewayMacsecConfigPatchTemplateFallbackCak gateway_macsec_config_patch_template_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' - gateway_macsec_config_patch_template_primary_cak_model = {} # GatewayMacsecConfigPatchTemplatePrimaryCak + gateway_macsec_config_patch_template_primary_cak_model = {} # GatewayMacsecConfigPatchTemplatePrimaryCak gateway_macsec_config_patch_template_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' # Construct a json representation of a GatewayMacsecConfigPatchTemplate model @@ -5109,7 +5371,8 @@ def test_gateway_macsec_config_patch_template_serialization(self): gateway_macsec_config_patch_template_model_json2 = gateway_macsec_config_patch_template_model.to_dict() assert gateway_macsec_config_patch_template_model_json2 == gateway_macsec_config_patch_template_model_json -class TestModel_GatewayMacsecConfigPatchTemplateFallbackCak(): + +class TestModel_GatewayMacsecConfigPatchTemplateFallbackCak: """ Test Class for GatewayMacsecConfigPatchTemplateFallbackCak """ @@ -5138,7 +5401,8 @@ def test_gateway_macsec_config_patch_template_fallback_cak_serialization(self): gateway_macsec_config_patch_template_fallback_cak_model_json2 = gateway_macsec_config_patch_template_fallback_cak_model.to_dict() assert gateway_macsec_config_patch_template_fallback_cak_model_json2 == gateway_macsec_config_patch_template_fallback_cak_model_json -class TestModel_GatewayMacsecConfigPatchTemplatePrimaryCak(): + +class TestModel_GatewayMacsecConfigPatchTemplatePrimaryCak: """ Test Class for GatewayMacsecConfigPatchTemplatePrimaryCak """ @@ -5167,7 +5431,8 @@ def test_gateway_macsec_config_patch_template_primary_cak_serialization(self): gateway_macsec_config_patch_template_primary_cak_model_json2 = gateway_macsec_config_patch_template_primary_cak_model.to_dict() assert gateway_macsec_config_patch_template_primary_cak_model_json2 == gateway_macsec_config_patch_template_primary_cak_model_json -class TestModel_GatewayMacsecConfigPrimaryCak(): + +class TestModel_GatewayMacsecConfigPrimaryCak: """ Test Class for GatewayMacsecConfigPrimaryCak """ @@ -5197,7 +5462,8 @@ def test_gateway_macsec_config_primary_cak_serialization(self): gateway_macsec_config_primary_cak_model_json2 = gateway_macsec_config_primary_cak_model.to_dict() assert gateway_macsec_config_primary_cak_model_json2 == gateway_macsec_config_primary_cak_model_json -class TestModel_GatewayMacsecConfigTemplate(): + +class TestModel_GatewayMacsecConfigTemplate: """ Test Class for GatewayMacsecConfigTemplate """ @@ -5209,10 +5475,10 @@ def test_gateway_macsec_config_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_macsec_config_template_fallback_cak_model = {} # GatewayMacsecConfigTemplateFallbackCak + gateway_macsec_config_template_fallback_cak_model = {} # GatewayMacsecConfigTemplateFallbackCak gateway_macsec_config_template_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' - gateway_macsec_config_template_primary_cak_model = {} # GatewayMacsecConfigTemplatePrimaryCak + gateway_macsec_config_template_primary_cak_model = {} # GatewayMacsecConfigTemplatePrimaryCak gateway_macsec_config_template_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' # Construct a json representation of a GatewayMacsecConfigTemplate model @@ -5237,7 +5503,8 @@ def test_gateway_macsec_config_template_serialization(self): gateway_macsec_config_template_model_json2 = gateway_macsec_config_template_model.to_dict() assert gateway_macsec_config_template_model_json2 == gateway_macsec_config_template_model_json -class TestModel_GatewayMacsecConfigTemplateFallbackCak(): + +class TestModel_GatewayMacsecConfigTemplateFallbackCak: """ Test Class for GatewayMacsecConfigTemplateFallbackCak """ @@ -5266,7 +5533,8 @@ def test_gateway_macsec_config_template_fallback_cak_serialization(self): gateway_macsec_config_template_fallback_cak_model_json2 = gateway_macsec_config_template_fallback_cak_model.to_dict() assert gateway_macsec_config_template_fallback_cak_model_json2 == gateway_macsec_config_template_fallback_cak_model_json -class TestModel_GatewayMacsecConfigTemplatePrimaryCak(): + +class TestModel_GatewayMacsecConfigTemplatePrimaryCak: """ Test Class for GatewayMacsecConfigTemplatePrimaryCak """ @@ -5295,7 +5563,75 @@ def test_gateway_macsec_config_template_primary_cak_serialization(self): gateway_macsec_config_template_primary_cak_model_json2 = gateway_macsec_config_template_primary_cak_model.to_dict() assert gateway_macsec_config_template_primary_cak_model_json2 == gateway_macsec_config_template_primary_cak_model_json -class TestModel_GatewayPatchTemplateAuthenticationKey(): + +class TestModel_GatewayPatchTemplate: + """ + Test Class for GatewayPatchTemplate + """ + + def test_gateway_patch_template_serialization(self): + """ + Test serialization/deserialization for GatewayPatchTemplate + """ + + # Construct dict forms of any model objects needed in order to build this model. + + gateway_patch_template_authentication_key_model = {} # GatewayPatchTemplateAuthenticationKey + gateway_patch_template_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' + + gateway_bfd_patch_template_model = {} # GatewayBfdPatchTemplate + gateway_bfd_patch_template_model['interval'] = 2000 + gateway_bfd_patch_template_model['multiplier'] = 10 + + gateway_macsec_config_patch_template_fallback_cak_model = {} # GatewayMacsecConfigPatchTemplateFallbackCak + gateway_macsec_config_patch_template_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + + gateway_macsec_config_patch_template_primary_cak_model = {} # GatewayMacsecConfigPatchTemplatePrimaryCak + gateway_macsec_config_patch_template_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + + gateway_macsec_config_patch_template_model = {} # GatewayMacsecConfigPatchTemplate + gateway_macsec_config_patch_template_model['active'] = True + gateway_macsec_config_patch_template_model['fallback_cak'] = gateway_macsec_config_patch_template_fallback_cak_model + gateway_macsec_config_patch_template_model['primary_cak'] = gateway_macsec_config_patch_template_primary_cak_model + gateway_macsec_config_patch_template_model['window_size'] = 512 + + # Construct a json representation of a GatewayPatchTemplate model + gateway_patch_template_model_json = {} + gateway_patch_template_model_json['authentication_key'] = gateway_patch_template_authentication_key_model + gateway_patch_template_model_json['bfd_config'] = gateway_bfd_patch_template_model + gateway_patch_template_model_json['bgp_asn'] = 64999 + gateway_patch_template_model_json['bgp_cer_cidr'] = '169.254.0.10/30' + gateway_patch_template_model_json['bgp_ibm_cidr'] = '169.254.0.9/30' + gateway_patch_template_model_json['connection_mode'] = 'transit' + gateway_patch_template_model_json['default_export_route_filter'] = 'permit' + gateway_patch_template_model_json['default_import_route_filter'] = 'permit' + gateway_patch_template_model_json['global'] = True + gateway_patch_template_model_json['loa_reject_reason'] = 'The port mentioned was incorrect' + gateway_patch_template_model_json['macsec_config'] = gateway_macsec_config_patch_template_model + gateway_patch_template_model_json['metered'] = False + gateway_patch_template_model_json['name'] = 'testGateway' + gateway_patch_template_model_json['operational_status'] = 'loa_accepted' + gateway_patch_template_model_json['patch_panel_completion_notice'] = 'patch panel configuration details' + gateway_patch_template_model_json['speed_mbps'] = 1000 + gateway_patch_template_model_json['vlan'] = 10 + + # Construct a model instance of GatewayPatchTemplate by calling from_dict on the json representation + gateway_patch_template_model = GatewayPatchTemplate.from_dict(gateway_patch_template_model_json) + assert gateway_patch_template_model != False + + # Construct a model instance of GatewayPatchTemplate by calling from_dict on the json representation + gateway_patch_template_model_dict = GatewayPatchTemplate.from_dict(gateway_patch_template_model_json).__dict__ + gateway_patch_template_model2 = GatewayPatchTemplate(**gateway_patch_template_model_dict) + + # Verify the model instances are equivalent + assert gateway_patch_template_model == gateway_patch_template_model2 + + # Convert model instance back to dict and verify no loss of data + gateway_patch_template_model_json2 = gateway_patch_template_model.to_dict() + assert gateway_patch_template_model_json2 == gateway_patch_template_model_json + + +class TestModel_GatewayPatchTemplateAuthenticationKey: """ Test Class for GatewayPatchTemplateAuthenticationKey """ @@ -5324,7 +5660,8 @@ def test_gateway_patch_template_authentication_key_serialization(self): gateway_patch_template_authentication_key_model_json2 = gateway_patch_template_authentication_key_model.to_dict() assert gateway_patch_template_authentication_key_model_json2 == gateway_patch_template_authentication_key_model_json -class TestModel_GatewayPort(): + +class TestModel_GatewayPort: """ Test Class for GatewayPort """ @@ -5353,7 +5690,8 @@ def test_gateway_port_serialization(self): gateway_port_model_json2 = gateway_port_model.to_dict() assert gateway_port_model_json2 == gateway_port_model_json -class TestModel_GatewayPortIdentity(): + +class TestModel_GatewayPortIdentity: """ Test Class for GatewayPortIdentity """ @@ -5382,7 +5720,8 @@ def test_gateway_port_identity_serialization(self): gateway_port_identity_model_json2 = gateway_port_identity_model.to_dict() assert gateway_port_identity_model_json2 == gateway_port_identity_model_json -class TestModel_GatewayStatistic(): + +class TestModel_GatewayStatistic: """ Test Class for GatewayStatistic """ @@ -5413,7 +5752,8 @@ def test_gateway_statistic_serialization(self): gateway_statistic_model_json2 = gateway_statistic_model.to_dict() assert gateway_statistic_model_json2 == gateway_statistic_model_json -class TestModel_GatewayStatisticCollection(): + +class TestModel_GatewayStatisticCollection: """ Test Class for GatewayStatisticCollection """ @@ -5425,7 +5765,7 @@ def test_gateway_statistic_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_statistic_model = {} # GatewayStatistic + gateway_statistic_model = {} # GatewayStatistic gateway_statistic_model['created_at'] = '2020-08-20T06:58:41.909000Z' gateway_statistic_model['data'] = 'MKA statistics text...' gateway_statistic_model['type'] = 'macsec_policy' @@ -5449,7 +5789,8 @@ def test_gateway_statistic_collection_serialization(self): gateway_statistic_collection_model_json2 = gateway_statistic_collection_model.to_dict() assert gateway_statistic_collection_model_json2 == gateway_statistic_collection_model_json -class TestModel_GatewayStatusCollection(): + +class TestModel_GatewayStatusCollection: """ Test Class for GatewayStatusCollection """ @@ -5461,7 +5802,7 @@ def test_gateway_status_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_status_model = {} # GatewayStatusGatewayBGPStatus + gateway_status_model = {} # GatewayStatusGatewayBGPStatus gateway_status_model['type'] = 'bgp' gateway_status_model['updated_at'] = '2020-08-20T06:58:41.909000Z' gateway_status_model['value'] = 'active' @@ -5485,7 +5826,8 @@ def test_gateway_status_collection_serialization(self): gateway_status_collection_model_json2 = gateway_status_collection_model.to_dict() assert gateway_status_collection_model_json2 == gateway_status_collection_model_json -class TestModel_GatewayTemplateAuthenticationKey(): + +class TestModel_GatewayTemplateAuthenticationKey: """ Test Class for GatewayTemplateAuthenticationKey """ @@ -5514,7 +5856,8 @@ def test_gateway_template_authentication_key_serialization(self): gateway_template_authentication_key_model_json2 = gateway_template_authentication_key_model.to_dict() assert gateway_template_authentication_key_model_json2 == gateway_template_authentication_key_model_json -class TestModel_GatewayTemplateRouteFilter(): + +class TestModel_GatewayTemplateRouteFilter: """ Test Class for GatewayTemplateRouteFilter """ @@ -5546,7 +5889,8 @@ def test_gateway_template_route_filter_serialization(self): gateway_template_route_filter_model_json2 = gateway_template_route_filter_model.to_dict() assert gateway_template_route_filter_model_json2 == gateway_template_route_filter_model_json -class TestModel_GatewayVirtualConnection(): + +class TestModel_GatewayVirtualConnection: """ Test Class for GatewayVirtualConnection """ @@ -5581,7 +5925,8 @@ def test_gateway_virtual_connection_serialization(self): gateway_virtual_connection_model_json2 = gateway_virtual_connection_model.to_dict() assert gateway_virtual_connection_model_json2 == gateway_virtual_connection_model_json -class TestModel_GatewayVirtualConnectionCollection(): + +class TestModel_GatewayVirtualConnectionCollection: """ Test Class for GatewayVirtualConnectionCollection """ @@ -5593,7 +5938,7 @@ def test_gateway_virtual_connection_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - gateway_virtual_connection_model = {} # GatewayVirtualConnection + gateway_virtual_connection_model = {} # GatewayVirtualConnection gateway_virtual_connection_model['created_at'] = '2019-01-01T12:00:00Z' gateway_virtual_connection_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' gateway_virtual_connection_model['name'] = 'newVC' @@ -5621,7 +5966,8 @@ def test_gateway_virtual_connection_collection_serialization(self): gateway_virtual_connection_collection_model_json2 = gateway_virtual_connection_collection_model.to_dict() assert gateway_virtual_connection_collection_model_json2 == gateway_virtual_connection_collection_model_json -class TestModel_ImportRouteFilterCollection(): + +class TestModel_ImportRouteFilterCollection: """ Test Class for ImportRouteFilterCollection """ @@ -5633,7 +5979,7 @@ def test_import_route_filter_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_filter_model = {} # RouteFilter + route_filter_model = {} # RouteFilter route_filter_model['action'] = 'permit' route_filter_model['before'] = '1a15dcab-7e40-45e1-b7c5-bc690eaa9782' route_filter_model['created_at'] = '2020-11-02T20:40:29.622000Z' @@ -5662,7 +6008,8 @@ def test_import_route_filter_collection_serialization(self): import_route_filter_collection_model_json2 = import_route_filter_collection_model.to_dict() assert import_route_filter_collection_model_json2 == import_route_filter_collection_model_json -class TestModel_LocationCollection(): + +class TestModel_LocationCollection: """ Test Class for LocationCollection """ @@ -5674,7 +6021,7 @@ def test_location_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - location_output_model = {} # LocationOutput + location_output_model = {} # LocationOutput location_output_model['billing_location'] = 'us' location_output_model['building_colocation_owner'] = 'MyProvider' location_output_model['display_name'] = 'Dallas 9' @@ -5707,7 +6054,8 @@ def test_location_collection_serialization(self): location_collection_model_json2 = location_collection_model.to_dict() assert location_collection_model_json2 == location_collection_model_json -class TestModel_LocationCrossConnectRouterCollection(): + +class TestModel_LocationCrossConnectRouterCollection: """ Test Class for LocationCrossConnectRouterCollection """ @@ -5719,7 +6067,7 @@ def test_location_cross_connect_router_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - cross_connect_router_model = {} # CrossConnectRouter + cross_connect_router_model = {} # CrossConnectRouter cross_connect_router_model['capabilities'] = ['non_macsec', 'macsec'] cross_connect_router_model['router_name'] = 'xcr01.dal03' cross_connect_router_model['total_connections'] = 1 @@ -5743,7 +6091,8 @@ def test_location_cross_connect_router_collection_serialization(self): location_cross_connect_router_collection_model_json2 = location_cross_connect_router_collection_model.to_dict() assert location_cross_connect_router_collection_model_json2 == location_cross_connect_router_collection_model_json -class TestModel_LocationOutput(): + +class TestModel_LocationOutput: """ Test Class for LocationOutput """ @@ -5783,7 +6132,8 @@ def test_location_output_serialization(self): location_output_model_json2 = location_output_model.to_dict() assert location_output_model_json2 == location_output_model_json -class TestModel_OfferingSpeed(): + +class TestModel_OfferingSpeed: """ Test Class for OfferingSpeed """ @@ -5814,7 +6164,8 @@ def test_offering_speed_serialization(self): offering_speed_model_json2 = offering_speed_model.to_dict() assert offering_speed_model_json2 == offering_speed_model_json -class TestModel_OfferingSpeedCollection(): + +class TestModel_OfferingSpeedCollection: """ Test Class for OfferingSpeedCollection """ @@ -5826,7 +6177,7 @@ def test_offering_speed_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - offering_speed_model = {} # OfferingSpeed + offering_speed_model = {} # OfferingSpeed offering_speed_model['capabilities'] = ['metered', 'unmetered'] offering_speed_model['link_speed'] = 2000 offering_speed_model['macsec_enabled'] = False @@ -5850,7 +6201,8 @@ def test_offering_speed_collection_serialization(self): offering_speed_collection_model_json2 = offering_speed_collection_model.to_dict() assert offering_speed_collection_model_json2 == offering_speed_collection_model_json -class TestModel_Port(): + +class TestModel_Port: """ Test Class for Port """ @@ -5885,7 +6237,8 @@ def test_port_serialization(self): port_model_json2 = port_model.to_dict() assert port_model_json2 == port_model_json -class TestModel_PortCollection(): + +class TestModel_PortCollection: """ Test Class for PortCollection """ @@ -5897,14 +6250,14 @@ def test_port_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ports_paginated_collection_first_model = {} # PortsPaginatedCollectionFirst + ports_paginated_collection_first_model = {} # PortsPaginatedCollectionFirst ports_paginated_collection_first_model['href'] = 'https://directlink.cloud.ibm.com/v1/ports?limit=100' - ports_paginated_collection_next_model = {} # PortsPaginatedCollectionNext + ports_paginated_collection_next_model = {} # PortsPaginatedCollectionNext ports_paginated_collection_next_model['href'] = 'https://directlink.cloud.ibm.com/v1/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100' ports_paginated_collection_next_model['start'] = '9d5a91a3e2cbd233b5a5b33436855ed1' - port_model = {} # Port + port_model = {} # Port port_model['direct_link_count'] = 1 port_model['id'] = '01122b9b-820f-4c44-8a31-77f1f0806765' port_model['label'] = 'XCR-FRK-CS-SEC-01' @@ -5936,7 +6289,8 @@ def test_port_collection_serialization(self): port_collection_model_json2 = port_collection_model.to_dict() assert port_collection_model_json2 == port_collection_model_json -class TestModel_PortsPaginatedCollectionFirst(): + +class TestModel_PortsPaginatedCollectionFirst: """ Test Class for PortsPaginatedCollectionFirst """ @@ -5965,7 +6319,8 @@ def test_ports_paginated_collection_first_serialization(self): ports_paginated_collection_first_model_json2 = ports_paginated_collection_first_model.to_dict() assert ports_paginated_collection_first_model_json2 == ports_paginated_collection_first_model_json -class TestModel_PortsPaginatedCollectionNext(): + +class TestModel_PortsPaginatedCollectionNext: """ Test Class for PortsPaginatedCollectionNext """ @@ -5995,7 +6350,8 @@ def test_ports_paginated_collection_next_serialization(self): ports_paginated_collection_next_model_json2 = ports_paginated_collection_next_model.to_dict() assert ports_paginated_collection_next_model_json2 == ports_paginated_collection_next_model_json -class TestModel_ResourceGroupIdentity(): + +class TestModel_ResourceGroupIdentity: """ Test Class for ResourceGroupIdentity """ @@ -6024,7 +6380,8 @@ def test_resource_group_identity_serialization(self): resource_group_identity_model_json2 = resource_group_identity_model.to_dict() assert resource_group_identity_model_json2 == resource_group_identity_model_json -class TestModel_ResourceGroupReference(): + +class TestModel_ResourceGroupReference: """ Test Class for ResourceGroupReference """ @@ -6053,7 +6410,8 @@ def test_resource_group_reference_serialization(self): resource_group_reference_model_json2 = resource_group_reference_model.to_dict() assert resource_group_reference_model_json2 == resource_group_reference_model_json -class TestModel_RouteFilter(): + +class TestModel_RouteFilter: """ Test Class for RouteFilter """ @@ -6089,7 +6447,8 @@ def test_route_filter_serialization(self): route_filter_model_json2 = route_filter_model.to_dict() assert route_filter_model_json2 == route_filter_model_json -class TestModel_RouteReport(): + +class TestModel_RouteReport: """ Test Class for RouteReport """ @@ -6101,32 +6460,32 @@ def test_route_report_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_report_advertised_route_model = {} # RouteReportAdvertisedRoute + route_report_advertised_route_model = {} # RouteReportAdvertisedRoute route_report_advertised_route_model['as_path'] = '64999 64999 64998 I' route_report_advertised_route_model['prefix'] = '172.17.0.0/16' - route_report_route_model = {} # RouteReportRoute + route_report_route_model = {} # RouteReportRoute route_report_route_model['prefix'] = '172.17.0.0/16' - route_report_on_prem_route_model = {} # RouteReportOnPremRoute + route_report_on_prem_route_model = {} # RouteReportOnPremRoute route_report_on_prem_route_model['as_path'] = '64999 64999 64998 I' route_report_on_prem_route_model['next_hop'] = '172.17.0.0' route_report_on_prem_route_model['prefix'] = '172.17.0.0/16' - route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection + route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection route_report_overlapping_route_model['prefix'] = '172.17.0.0/16' route_report_overlapping_route_model['type'] = 'virtual_connection' route_report_overlapping_route_model['virtual_connection_id'] = 'd2d985d8-1d8e-4e8b-96cd-cee2290ecaff' - route_report_overlapping_route_group_model = {} # RouteReportOverlappingRouteGroup + route_report_overlapping_route_group_model = {} # RouteReportOverlappingRouteGroup route_report_overlapping_route_group_model['routes'] = [route_report_overlapping_route_model] - route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute + route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute route_report_virtual_connection_route_model['active'] = True route_report_virtual_connection_route_model['local_preference'] = '200' route_report_virtual_connection_route_model['prefix'] = '172.17.0.0/16' - route_report_connection_model = {} # RouteReportConnection + route_report_connection_model = {} # RouteReportConnection route_report_connection_model['routes'] = [route_report_virtual_connection_route_model] route_report_connection_model['virtual_connection_id'] = '3c265a62-91da-4261-a950-950b6af0eb58' route_report_connection_model['virtual_connection_name'] = 'vpc1' @@ -6159,7 +6518,8 @@ def test_route_report_serialization(self): route_report_model_json2 = route_report_model.to_dict() assert route_report_model_json2 == route_report_model_json -class TestModel_RouteReportAdvertisedRoute(): + +class TestModel_RouteReportAdvertisedRoute: """ Test Class for RouteReportAdvertisedRoute """ @@ -6189,7 +6549,8 @@ def test_route_report_advertised_route_serialization(self): route_report_advertised_route_model_json2 = route_report_advertised_route_model.to_dict() assert route_report_advertised_route_model_json2 == route_report_advertised_route_model_json -class TestModel_RouteReportCollection(): + +class TestModel_RouteReportCollection: """ Test Class for RouteReportCollection """ @@ -6201,38 +6562,38 @@ def test_route_report_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_report_advertised_route_model = {} # RouteReportAdvertisedRoute + route_report_advertised_route_model = {} # RouteReportAdvertisedRoute route_report_advertised_route_model['as_path'] = '64999 64999 64998 I' route_report_advertised_route_model['prefix'] = '172.17.0.0/16' - route_report_route_model = {} # RouteReportRoute + route_report_route_model = {} # RouteReportRoute route_report_route_model['prefix'] = '172.17.0.0/16' - route_report_on_prem_route_model = {} # RouteReportOnPremRoute + route_report_on_prem_route_model = {} # RouteReportOnPremRoute route_report_on_prem_route_model['as_path'] = '64999 64999 64998 I' route_report_on_prem_route_model['next_hop'] = '172.17.0.0' route_report_on_prem_route_model['prefix'] = '172.17.0.0/16' - route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection + route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection route_report_overlapping_route_model['prefix'] = '172.17.0.0/16' route_report_overlapping_route_model['type'] = 'virtual_connection' route_report_overlapping_route_model['virtual_connection_id'] = 'd2d985d8-1d8e-4e8b-96cd-cee2290ecaff' - route_report_overlapping_route_group_model = {} # RouteReportOverlappingRouteGroup + route_report_overlapping_route_group_model = {} # RouteReportOverlappingRouteGroup route_report_overlapping_route_group_model['routes'] = [route_report_overlapping_route_model] - route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute + route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute route_report_virtual_connection_route_model['active'] = True route_report_virtual_connection_route_model['local_preference'] = '200' route_report_virtual_connection_route_model['prefix'] = '172.17.0.0/16' - route_report_connection_model = {} # RouteReportConnection + route_report_connection_model = {} # RouteReportConnection route_report_connection_model['routes'] = [route_report_virtual_connection_route_model] route_report_connection_model['virtual_connection_id'] = '3c265a62-91da-4261-a950-950b6af0eb58' route_report_connection_model['virtual_connection_name'] = 'vpc1' route_report_connection_model['virtual_connection_type'] = 'vpc' - route_report_model = {} # RouteReport + route_report_model = {} # RouteReport route_report_model['advertised_routes'] = [route_report_advertised_route_model] route_report_model['created_at'] = '2019-01-01T12:00:00Z' route_report_model['gateway_routes'] = [route_report_route_model] @@ -6262,7 +6623,8 @@ def test_route_report_collection_serialization(self): route_report_collection_model_json2 = route_report_collection_model.to_dict() assert route_report_collection_model_json2 == route_report_collection_model_json -class TestModel_RouteReportConnection(): + +class TestModel_RouteReportConnection: """ Test Class for RouteReportConnection """ @@ -6274,7 +6636,7 @@ def test_route_report_connection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute + route_report_virtual_connection_route_model = {} # RouteReportVirtualConnectionRoute route_report_virtual_connection_route_model['active'] = True route_report_virtual_connection_route_model['local_preference'] = '200' route_report_virtual_connection_route_model['prefix'] = '172.17.0.0/16' @@ -6301,7 +6663,8 @@ def test_route_report_connection_serialization(self): route_report_connection_model_json2 = route_report_connection_model.to_dict() assert route_report_connection_model_json2 == route_report_connection_model_json -class TestModel_RouteReportOnPremRoute(): + +class TestModel_RouteReportOnPremRoute: """ Test Class for RouteReportOnPremRoute """ @@ -6332,7 +6695,8 @@ def test_route_report_on_prem_route_serialization(self): route_report_on_prem_route_model_json2 = route_report_on_prem_route_model.to_dict() assert route_report_on_prem_route_model_json2 == route_report_on_prem_route_model_json -class TestModel_RouteReportOverlappingRouteGroup(): + +class TestModel_RouteReportOverlappingRouteGroup: """ Test Class for RouteReportOverlappingRouteGroup """ @@ -6344,7 +6708,7 @@ def test_route_report_overlapping_route_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection + route_report_overlapping_route_model = {} # RouteReportOverlappingRouteForConnection route_report_overlapping_route_model['prefix'] = '172.17.0.0/16' route_report_overlapping_route_model['type'] = 'virtual_connection' route_report_overlapping_route_model['virtual_connection_id'] = 'd2d985d8-1d8e-4e8b-96cd-cee2290ecaff' @@ -6368,7 +6732,8 @@ def test_route_report_overlapping_route_group_serialization(self): route_report_overlapping_route_group_model_json2 = route_report_overlapping_route_group_model.to_dict() assert route_report_overlapping_route_group_model_json2 == route_report_overlapping_route_group_model_json -class TestModel_RouteReportRoute(): + +class TestModel_RouteReportRoute: """ Test Class for RouteReportRoute """ @@ -6397,7 +6762,8 @@ def test_route_report_route_serialization(self): route_report_route_model_json2 = route_report_route_model.to_dict() assert route_report_route_model_json2 == route_report_route_model_json -class TestModel_RouteReportVirtualConnectionRoute(): + +class TestModel_RouteReportVirtualConnectionRoute: """ Test Class for RouteReportVirtualConnectionRoute """ @@ -6428,7 +6794,8 @@ def test_route_report_virtual_connection_route_serialization(self): route_report_virtual_connection_route_model_json2 = route_report_virtual_connection_route_model.to_dict() assert route_report_virtual_connection_route_model_json2 == route_report_virtual_connection_route_model_json -class TestModel_UpdateRouteFilterTemplate(): + +class TestModel_UpdateRouteFilterTemplate: """ Test Class for UpdateRouteFilterTemplate """ @@ -6461,7 +6828,8 @@ def test_update_route_filter_template_serialization(self): update_route_filter_template_model_json2 = update_route_filter_template_model.to_dict() assert update_route_filter_template_model_json2 == update_route_filter_template_model_json -class TestModel_GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate(): + +class TestModel_GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate: """ Test Class for GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate """ @@ -6490,7 +6858,8 @@ def test_gateway_action_template_updates_item_gateway_client_bgpasn_update_seria gateway_action_template_updates_item_gateway_client_bgpasn_update_model_json2 = gateway_action_template_updates_item_gateway_client_bgpasn_update_model.to_dict() assert gateway_action_template_updates_item_gateway_client_bgpasn_update_model_json2 == gateway_action_template_updates_item_gateway_client_bgpasn_update_model_json -class TestModel_GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate(): + +class TestModel_GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate: """ Test Class for GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate """ @@ -6520,7 +6889,8 @@ def test_gateway_action_template_updates_item_gateway_client_bgpip_update_serial gateway_action_template_updates_item_gateway_client_bgpip_update_model_json2 = gateway_action_template_updates_item_gateway_client_bgpip_update_model.to_dict() assert gateway_action_template_updates_item_gateway_client_bgpip_update_model_json2 == gateway_action_template_updates_item_gateway_client_bgpip_update_model_json -class TestModel_GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate(): + +class TestModel_GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate: """ Test Class for GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate """ @@ -6549,7 +6919,8 @@ def test_gateway_action_template_updates_item_gateway_client_speed_update_serial gateway_action_template_updates_item_gateway_client_speed_update_model_json2 = gateway_action_template_updates_item_gateway_client_speed_update_model.to_dict() assert gateway_action_template_updates_item_gateway_client_speed_update_model_json2 == gateway_action_template_updates_item_gateway_client_speed_update_model_json -class TestModel_GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate(): + +class TestModel_GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate: """ Test Class for GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate """ @@ -6578,7 +6949,8 @@ def test_gateway_action_template_updates_item_gateway_client_vlan_update_seriali gateway_action_template_updates_item_gateway_client_vlan_update_model_json2 = gateway_action_template_updates_item_gateway_client_vlan_update_model.to_dict() assert gateway_action_template_updates_item_gateway_client_vlan_update_model_json2 == gateway_action_template_updates_item_gateway_client_vlan_update_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate: """ Test Class for GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate """ @@ -6607,7 +6979,8 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_updates gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpasn_update_model_json2 = gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpasn_update_model.to_dict() assert gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpasn_update_model_json2 == gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpasn_update_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate: """ Test Class for GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate """ @@ -6637,7 +7010,8 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_updates gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpip_update_model_json2 = gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpip_update_model.to_dict() assert gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpip_update_model_json2 == gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_bgpip_update_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate: """ Test Class for GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate """ @@ -6666,7 +7040,8 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_updates gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_speed_update_model_json2 = gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_speed_update_model.to_dict() assert gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_speed_update_model_json2 == gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_speed_update_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate: """ Test Class for GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate """ @@ -6695,7 +7070,8 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_updates gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_vlan_update_model_json2 = gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_vlan_update_model.to_dict() assert gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_vlan_update_model_json2 == gateway_change_request_gateway_client_gateway_update_attributes_updates_item_gateway_client_vlan_update_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayCreate(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayCreate: """ Test Class for GatewayChangeRequestGatewayClientGatewayCreate """ @@ -6724,7 +7100,8 @@ def test_gateway_change_request_gateway_client_gateway_create_serialization(self gateway_change_request_gateway_client_gateway_create_model_json2 = gateway_change_request_gateway_client_gateway_create_model.to_dict() assert gateway_change_request_gateway_client_gateway_create_model_json2 == gateway_change_request_gateway_client_gateway_create_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayDelete(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayDelete: """ Test Class for GatewayChangeRequestGatewayClientGatewayDelete """ @@ -6753,7 +7130,8 @@ def test_gateway_change_request_gateway_client_gateway_delete_serialization(self gateway_change_request_gateway_client_gateway_delete_model_json2 = gateway_change_request_gateway_client_gateway_delete_model.to_dict() assert gateway_change_request_gateway_client_gateway_delete_model_json2 == gateway_change_request_gateway_client_gateway_delete_model_json -class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributes(): + +class TestModel_GatewayChangeRequestGatewayClientGatewayUpdateAttributes: """ Test Class for GatewayChangeRequestGatewayClientGatewayUpdateAttributes """ @@ -6765,7 +7143,7 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_seriali # Construct dict forms of any model objects needed in order to build this model. - gateway_change_request_gateway_client_gateway_update_attributes_updates_item_model = {} # GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate + gateway_change_request_gateway_client_gateway_update_attributes_updates_item_model = {} # GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate gateway_change_request_gateway_client_gateway_update_attributes_updates_item_model['speed_mbps'] = 500 # Construct a json representation of a GatewayChangeRequestGatewayClientGatewayUpdateAttributes model @@ -6788,7 +7166,182 @@ def test_gateway_change_request_gateway_client_gateway_update_attributes_seriali gateway_change_request_gateway_client_gateway_update_attributes_model_json2 = gateway_change_request_gateway_client_gateway_update_attributes_model.to_dict() assert gateway_change_request_gateway_client_gateway_update_attributes_model_json2 == gateway_change_request_gateway_client_gateway_update_attributes_model_json -class TestModel_GatewayStatusGatewayBFDStatus(): + +class TestModel_GatewayCollectionGatewaysItemCrossAccountGateway: + """ + Test Class for GatewayCollectionGatewaysItemCrossAccountGateway + """ + + def test_gateway_collection_gateways_item_cross_account_gateway_serialization(self): + """ + Test serialization/deserialization for GatewayCollectionGatewaysItemCrossAccountGateway + """ + + # Construct dict forms of any model objects needed in order to build this model. + + cross_account_gateway_port_model = {} # CrossAccountGatewayPort + cross_account_gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' + + # Construct a json representation of a GatewayCollectionGatewaysItemCrossAccountGateway model + gateway_collection_gateways_item_cross_account_gateway_model_json = {} + gateway_collection_gateways_item_cross_account_gateway_model_json['bgp_status'] = 'active' + gateway_collection_gateways_item_cross_account_gateway_model_json['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_cross_account_gateway_model_json['connection_mode'] = 'transit' + gateway_collection_gateways_item_cross_account_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' + gateway_collection_gateways_item_cross_account_gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_cross_account_gateway_model_json['cross_account'] = True + gateway_collection_gateways_item_cross_account_gateway_model_json['cross_connect_router'] = 'xcr01.dal03' + gateway_collection_gateways_item_cross_account_gateway_model_json['global'] = True + gateway_collection_gateways_item_cross_account_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_cross_account_gateway_model_json['link_status'] = 'up' + gateway_collection_gateways_item_cross_account_gateway_model_json['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_cross_account_gateway_model_json['location_display_name'] = 'Dallas 03' + gateway_collection_gateways_item_cross_account_gateway_model_json['location_name'] = 'dal03' + gateway_collection_gateways_item_cross_account_gateway_model_json['name'] = 'myGateway' + gateway_collection_gateways_item_cross_account_gateway_model_json['operational_status'] = 'awaiting_completion_notice' + gateway_collection_gateways_item_cross_account_gateway_model_json['port'] = cross_account_gateway_port_model + gateway_collection_gateways_item_cross_account_gateway_model_json['speed_mbps'] = 1000 + gateway_collection_gateways_item_cross_account_gateway_model_json['type'] = 'dedicated' + + # Construct a model instance of GatewayCollectionGatewaysItemCrossAccountGateway by calling from_dict on the json representation + gateway_collection_gateways_item_cross_account_gateway_model = GatewayCollectionGatewaysItemCrossAccountGateway.from_dict(gateway_collection_gateways_item_cross_account_gateway_model_json) + assert gateway_collection_gateways_item_cross_account_gateway_model != False + + # Construct a model instance of GatewayCollectionGatewaysItemCrossAccountGateway by calling from_dict on the json representation + gateway_collection_gateways_item_cross_account_gateway_model_dict = GatewayCollectionGatewaysItemCrossAccountGateway.from_dict(gateway_collection_gateways_item_cross_account_gateway_model_json).__dict__ + gateway_collection_gateways_item_cross_account_gateway_model2 = GatewayCollectionGatewaysItemCrossAccountGateway(**gateway_collection_gateways_item_cross_account_gateway_model_dict) + + # Verify the model instances are equivalent + assert gateway_collection_gateways_item_cross_account_gateway_model == gateway_collection_gateways_item_cross_account_gateway_model2 + + # Convert model instance back to dict and verify no loss of data + gateway_collection_gateways_item_cross_account_gateway_model_json2 = gateway_collection_gateways_item_cross_account_gateway_model.to_dict() + assert gateway_collection_gateways_item_cross_account_gateway_model_json2 == gateway_collection_gateways_item_cross_account_gateway_model_json + + +class TestModel_GatewayCollectionGatewaysItemGateway: + """ + Test Class for GatewayCollectionGatewaysItemGateway + """ + + def test_gateway_collection_gateways_item_gateway_serialization(self): + """ + Test serialization/deserialization for GatewayCollectionGatewaysItemGateway + """ + + # Construct dict forms of any model objects needed in order to build this model. + + as_prepend_model = {} # AsPrepend + as_prepend_model['created_at'] = '2019-01-01T12:00:00Z' + as_prepend_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + as_prepend_model['length'] = 4 + as_prepend_model['policy'] = 'import' + as_prepend_model['prefix'] = '172.17.0.0/16' + as_prepend_model['specific_prefixes'] = ['192.168.3.0/24'] + as_prepend_model['updated_at'] = '2019-01-01T12:00:00Z' + + gateway_authentication_key_model = {} # GatewayAuthenticationKey + gateway_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' + + gateway_bfd_config_model = {} # GatewayBfdConfig + gateway_bfd_config_model['bfd_status'] = 'up' + gateway_bfd_config_model['bfd_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_bfd_config_model['interval'] = 2000 + gateway_bfd_config_model['multiplier'] = 10 + + gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate + gateway_change_request_model['type'] = 'create_gateway' + + gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak + gateway_macsec_config_active_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_active_cak_model['status'] = 'testString' + + gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak + gateway_macsec_config_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_fallback_cak_model['status'] = 'testString' + + gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak + gateway_macsec_config_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_primary_cak_model['status'] = 'testString' + + gateway_macsec_config_model = {} # GatewayMacsecConfig + gateway_macsec_config_model['active'] = True + gateway_macsec_config_model['active_cak'] = gateway_macsec_config_active_cak_model + gateway_macsec_config_model['cipher_suite'] = 'gcm_aes_xpn_256' + gateway_macsec_config_model['confidentiality_offset'] = 0 + gateway_macsec_config_model['cryptographic_algorithm'] = 'aes_256_cmac' + gateway_macsec_config_model['fallback_cak'] = gateway_macsec_config_fallback_cak_model + gateway_macsec_config_model['key_server_priority'] = 255 + gateway_macsec_config_model['primary_cak'] = gateway_macsec_config_primary_cak_model + gateway_macsec_config_model['sak_expiry_time'] = 3600 + gateway_macsec_config_model['security_policy'] = 'must_secure' + gateway_macsec_config_model['status'] = 'secured' + gateway_macsec_config_model['window_size'] = 64 + + gateway_port_model = {} # GatewayPort + gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' + + # Construct a json representation of a GatewayCollectionGatewaysItemGateway model + gateway_collection_gateways_item_gateway_model_json = {} + gateway_collection_gateways_item_gateway_model_json['as_prepends'] = [as_prepend_model] + gateway_collection_gateways_item_gateway_model_json['authentication_key'] = gateway_authentication_key_model + gateway_collection_gateways_item_gateway_model_json['bfd_config'] = gateway_bfd_config_model + gateway_collection_gateways_item_gateway_model_json['bgp_asn'] = 64999 + gateway_collection_gateways_item_gateway_model_json['bgp_base_cidr'] = 'testString' + gateway_collection_gateways_item_gateway_model_json['bgp_cer_cidr'] = '10.254.30.78/30' + gateway_collection_gateways_item_gateway_model_json['bgp_ibm_asn'] = 13884 + gateway_collection_gateways_item_gateway_model_json['bgp_ibm_cidr'] = '10.254.30.77/30' + gateway_collection_gateways_item_gateway_model_json['bgp_status'] = 'active' + gateway_collection_gateways_item_gateway_model_json['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_gateway_model_json['carrier_name'] = 'myCarrierName' + gateway_collection_gateways_item_gateway_model_json['change_request'] = gateway_change_request_model + gateway_collection_gateways_item_gateway_model_json['completion_notice_reject_reason'] = 'The completion notice file was blank' + gateway_collection_gateways_item_gateway_model_json['connection_mode'] = 'transit' + gateway_collection_gateways_item_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' + gateway_collection_gateways_item_gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_gateway_model_json['cross_account'] = False + gateway_collection_gateways_item_gateway_model_json['cross_connect_router'] = 'xcr01.dal03' + gateway_collection_gateways_item_gateway_model_json['customer_name'] = 'newCustomerName' + gateway_collection_gateways_item_gateway_model_json['default_export_route_filter'] = 'permit' + gateway_collection_gateways_item_gateway_model_json['default_import_route_filter'] = 'permit' + gateway_collection_gateways_item_gateway_model_json['global'] = True + gateway_collection_gateways_item_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + gateway_collection_gateways_item_gateway_model_json['link_status'] = 'up' + gateway_collection_gateways_item_gateway_model_json['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_collection_gateways_item_gateway_model_json['location_display_name'] = 'Dallas 03' + gateway_collection_gateways_item_gateway_model_json['location_name'] = 'dal03' + gateway_collection_gateways_item_gateway_model_json['macsec_config'] = gateway_macsec_config_model + gateway_collection_gateways_item_gateway_model_json['metered'] = False + gateway_collection_gateways_item_gateway_model_json['name'] = 'myGateway' + gateway_collection_gateways_item_gateway_model_json['operational_status'] = 'awaiting_completion_notice' + gateway_collection_gateways_item_gateway_model_json['port'] = gateway_port_model + gateway_collection_gateways_item_gateway_model_json['provider_api_managed'] = False + gateway_collection_gateways_item_gateway_model_json['resource_group'] = resource_group_reference_model + gateway_collection_gateways_item_gateway_model_json['speed_mbps'] = 1000 + gateway_collection_gateways_item_gateway_model_json['patch_panel_completion_notice'] = 'patch panel configuration details' + gateway_collection_gateways_item_gateway_model_json['type'] = 'dedicated' + gateway_collection_gateways_item_gateway_model_json['vlan'] = 10 + + # Construct a model instance of GatewayCollectionGatewaysItemGateway by calling from_dict on the json representation + gateway_collection_gateways_item_gateway_model = GatewayCollectionGatewaysItemGateway.from_dict(gateway_collection_gateways_item_gateway_model_json) + assert gateway_collection_gateways_item_gateway_model != False + + # Construct a model instance of GatewayCollectionGatewaysItemGateway by calling from_dict on the json representation + gateway_collection_gateways_item_gateway_model_dict = GatewayCollectionGatewaysItemGateway.from_dict(gateway_collection_gateways_item_gateway_model_json).__dict__ + gateway_collection_gateways_item_gateway_model2 = GatewayCollectionGatewaysItemGateway(**gateway_collection_gateways_item_gateway_model_dict) + + # Verify the model instances are equivalent + assert gateway_collection_gateways_item_gateway_model == gateway_collection_gateways_item_gateway_model2 + + # Convert model instance back to dict and verify no loss of data + gateway_collection_gateways_item_gateway_model_json2 = gateway_collection_gateways_item_gateway_model.to_dict() + assert gateway_collection_gateways_item_gateway_model_json2 == gateway_collection_gateways_item_gateway_model_json + + +class TestModel_GatewayStatusGatewayBFDStatus: """ Test Class for GatewayStatusGatewayBFDStatus """ @@ -6819,7 +7372,8 @@ def test_gateway_status_gateway_bfd_status_serialization(self): gateway_status_gateway_bfd_status_model_json2 = gateway_status_gateway_bfd_status_model.to_dict() assert gateway_status_gateway_bfd_status_model_json2 == gateway_status_gateway_bfd_status_model_json -class TestModel_GatewayStatusGatewayBGPStatus(): + +class TestModel_GatewayStatusGatewayBGPStatus: """ Test Class for GatewayStatusGatewayBGPStatus """ @@ -6850,7 +7404,8 @@ def test_gateway_status_gateway_bgp_status_serialization(self): gateway_status_gateway_bgp_status_model_json2 = gateway_status_gateway_bgp_status_model.to_dict() assert gateway_status_gateway_bgp_status_model_json2 == gateway_status_gateway_bgp_status_model_json -class TestModel_GatewayStatusGatewayLinkStatus(): + +class TestModel_GatewayStatusGatewayLinkStatus: """ Test Class for GatewayStatusGatewayLinkStatus """ @@ -6881,7 +7436,8 @@ def test_gateway_status_gateway_link_status_serialization(self): gateway_status_gateway_link_status_model_json2 = gateway_status_gateway_link_status_model.to_dict() assert gateway_status_gateway_link_status_model_json2 == gateway_status_gateway_link_status_model_json -class TestModel_GatewayTemplateGatewayTypeConnectTemplate(): + +class TestModel_GatewayTemplateGatewayTypeConnectTemplate: """ Test Class for GatewayTemplateGatewayTypeConnectTemplate """ @@ -6893,29 +7449,29 @@ def test_gateway_template_gateway_type_connect_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - as_prepend_template_model = {} # AsPrependTemplate + as_prepend_template_model = {} # AsPrependTemplate as_prepend_template_model['length'] = 4 as_prepend_template_model['policy'] = 'import' as_prepend_template_model['prefix'] = '172.17.0.0/16' as_prepend_template_model['specific_prefixes'] = ['192.168.3.0/24'] - gateway_template_authentication_key_model = {} # GatewayTemplateAuthenticationKey + gateway_template_authentication_key_model = {} # GatewayTemplateAuthenticationKey gateway_template_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' - gateway_bfd_config_template_model = {} # GatewayBfdConfigTemplate + gateway_bfd_config_template_model = {} # GatewayBfdConfigTemplate gateway_bfd_config_template_model['interval'] = 2000 gateway_bfd_config_template_model['multiplier'] = 10 - gateway_template_route_filter_model = {} # GatewayTemplateRouteFilter + gateway_template_route_filter_model = {} # GatewayTemplateRouteFilter gateway_template_route_filter_model['action'] = 'permit' gateway_template_route_filter_model['ge'] = 25 gateway_template_route_filter_model['le'] = 30 gateway_template_route_filter_model['prefix'] = '192.168.100.0/24' - resource_group_identity_model = {} # ResourceGroupIdentity + resource_group_identity_model = {} # ResourceGroupIdentity resource_group_identity_model['id'] = '56969d6043e9465c883cb9f7363e78e8' - gateway_port_identity_model = {} # GatewayPortIdentity + gateway_port_identity_model = {} # GatewayPortIdentity gateway_port_identity_model['id'] = 'fffdcb1a-fee4-41c7-9e11-9cd99e65c777' # Construct a json representation of a GatewayTemplateGatewayTypeConnectTemplate model @@ -6956,7 +7512,8 @@ def test_gateway_template_gateway_type_connect_template_serialization(self): gateway_template_gateway_type_connect_template_model_json2 = gateway_template_gateway_type_connect_template_model.to_dict() assert gateway_template_gateway_type_connect_template_model_json2 == gateway_template_gateway_type_connect_template_model_json -class TestModel_GatewayTemplateGatewayTypeDedicatedTemplate(): + +class TestModel_GatewayTemplateGatewayTypeDedicatedTemplate: """ Test Class for GatewayTemplateGatewayTypeDedicatedTemplate """ @@ -6968,35 +7525,35 @@ def test_gateway_template_gateway_type_dedicated_template_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - as_prepend_template_model = {} # AsPrependTemplate + as_prepend_template_model = {} # AsPrependTemplate as_prepend_template_model['length'] = 4 as_prepend_template_model['policy'] = 'import' as_prepend_template_model['prefix'] = '172.17.0.0/16' as_prepend_template_model['specific_prefixes'] = ['192.168.3.0/24'] - gateway_template_authentication_key_model = {} # GatewayTemplateAuthenticationKey + gateway_template_authentication_key_model = {} # GatewayTemplateAuthenticationKey gateway_template_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' - gateway_bfd_config_template_model = {} # GatewayBfdConfigTemplate + gateway_bfd_config_template_model = {} # GatewayBfdConfigTemplate gateway_bfd_config_template_model['interval'] = 2000 gateway_bfd_config_template_model['multiplier'] = 10 - gateway_template_route_filter_model = {} # GatewayTemplateRouteFilter + gateway_template_route_filter_model = {} # GatewayTemplateRouteFilter gateway_template_route_filter_model['action'] = 'permit' gateway_template_route_filter_model['ge'] = 25 gateway_template_route_filter_model['le'] = 30 gateway_template_route_filter_model['prefix'] = '192.168.100.0/24' - resource_group_identity_model = {} # ResourceGroupIdentity + resource_group_identity_model = {} # ResourceGroupIdentity resource_group_identity_model['id'] = '56969d6043e9465c883cb9f7363e78e8' - gateway_macsec_config_template_fallback_cak_model = {} # GatewayMacsecConfigTemplateFallbackCak + gateway_macsec_config_template_fallback_cak_model = {} # GatewayMacsecConfigTemplateFallbackCak gateway_macsec_config_template_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' - gateway_macsec_config_template_primary_cak_model = {} # GatewayMacsecConfigTemplatePrimaryCak + gateway_macsec_config_template_primary_cak_model = {} # GatewayMacsecConfigTemplatePrimaryCak gateway_macsec_config_template_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' - gateway_macsec_config_template_model = {} # GatewayMacsecConfigTemplate + gateway_macsec_config_template_model = {} # GatewayMacsecConfigTemplate gateway_macsec_config_template_model['active'] = True gateway_macsec_config_template_model['fallback_cak'] = gateway_macsec_config_template_fallback_cak_model gateway_macsec_config_template_model['primary_cak'] = gateway_macsec_config_template_primary_cak_model @@ -7028,6 +7585,7 @@ def test_gateway_template_gateway_type_dedicated_template_serialization(self): gateway_template_gateway_type_dedicated_template_model_json['customer_name'] = 'newCustomerName' gateway_template_gateway_type_dedicated_template_model_json['location_name'] = 'dal03' gateway_template_gateway_type_dedicated_template_model_json['macsec_config'] = gateway_macsec_config_template_model + gateway_template_gateway_type_dedicated_template_model_json['vlan'] = 10 # Construct a model instance of GatewayTemplateGatewayTypeDedicatedTemplate by calling from_dict on the json representation gateway_template_gateway_type_dedicated_template_model = GatewayTemplateGatewayTypeDedicatedTemplate.from_dict(gateway_template_gateway_type_dedicated_template_model_json) @@ -7044,7 +7602,182 @@ def test_gateway_template_gateway_type_dedicated_template_serialization(self): gateway_template_gateway_type_dedicated_template_model_json2 = gateway_template_gateway_type_dedicated_template_model.to_dict() assert gateway_template_gateway_type_dedicated_template_model_json2 == gateway_template_gateway_type_dedicated_template_model_json -class TestModel_RouteReportOverlappingRouteForConnection(): + +class TestModel_GetGatewayResponseCrossAccountGateway: + """ + Test Class for GetGatewayResponseCrossAccountGateway + """ + + def test_get_gateway_response_cross_account_gateway_serialization(self): + """ + Test serialization/deserialization for GetGatewayResponseCrossAccountGateway + """ + + # Construct dict forms of any model objects needed in order to build this model. + + cross_account_gateway_port_model = {} # CrossAccountGatewayPort + cross_account_gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' + + # Construct a json representation of a GetGatewayResponseCrossAccountGateway model + get_gateway_response_cross_account_gateway_model_json = {} + get_gateway_response_cross_account_gateway_model_json['bgp_status'] = 'active' + get_gateway_response_cross_account_gateway_model_json['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + get_gateway_response_cross_account_gateway_model_json['connection_mode'] = 'transit' + get_gateway_response_cross_account_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' + get_gateway_response_cross_account_gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + get_gateway_response_cross_account_gateway_model_json['cross_account'] = True + get_gateway_response_cross_account_gateway_model_json['cross_connect_router'] = 'xcr01.dal03' + get_gateway_response_cross_account_gateway_model_json['global'] = True + get_gateway_response_cross_account_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + get_gateway_response_cross_account_gateway_model_json['link_status'] = 'up' + get_gateway_response_cross_account_gateway_model_json['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + get_gateway_response_cross_account_gateway_model_json['location_display_name'] = 'Dallas 03' + get_gateway_response_cross_account_gateway_model_json['location_name'] = 'dal03' + get_gateway_response_cross_account_gateway_model_json['name'] = 'myGateway' + get_gateway_response_cross_account_gateway_model_json['operational_status'] = 'awaiting_completion_notice' + get_gateway_response_cross_account_gateway_model_json['port'] = cross_account_gateway_port_model + get_gateway_response_cross_account_gateway_model_json['speed_mbps'] = 1000 + get_gateway_response_cross_account_gateway_model_json['type'] = 'dedicated' + + # Construct a model instance of GetGatewayResponseCrossAccountGateway by calling from_dict on the json representation + get_gateway_response_cross_account_gateway_model = GetGatewayResponseCrossAccountGateway.from_dict(get_gateway_response_cross_account_gateway_model_json) + assert get_gateway_response_cross_account_gateway_model != False + + # Construct a model instance of GetGatewayResponseCrossAccountGateway by calling from_dict on the json representation + get_gateway_response_cross_account_gateway_model_dict = GetGatewayResponseCrossAccountGateway.from_dict(get_gateway_response_cross_account_gateway_model_json).__dict__ + get_gateway_response_cross_account_gateway_model2 = GetGatewayResponseCrossAccountGateway(**get_gateway_response_cross_account_gateway_model_dict) + + # Verify the model instances are equivalent + assert get_gateway_response_cross_account_gateway_model == get_gateway_response_cross_account_gateway_model2 + + # Convert model instance back to dict and verify no loss of data + get_gateway_response_cross_account_gateway_model_json2 = get_gateway_response_cross_account_gateway_model.to_dict() + assert get_gateway_response_cross_account_gateway_model_json2 == get_gateway_response_cross_account_gateway_model_json + + +class TestModel_GetGatewayResponseGateway: + """ + Test Class for GetGatewayResponseGateway + """ + + def test_get_gateway_response_gateway_serialization(self): + """ + Test serialization/deserialization for GetGatewayResponseGateway + """ + + # Construct dict forms of any model objects needed in order to build this model. + + as_prepend_model = {} # AsPrepend + as_prepend_model['created_at'] = '2019-01-01T12:00:00Z' + as_prepend_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + as_prepend_model['length'] = 4 + as_prepend_model['policy'] = 'import' + as_prepend_model['prefix'] = '172.17.0.0/16' + as_prepend_model['specific_prefixes'] = ['192.168.3.0/24'] + as_prepend_model['updated_at'] = '2019-01-01T12:00:00Z' + + gateway_authentication_key_model = {} # GatewayAuthenticationKey + gateway_authentication_key_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c' + + gateway_bfd_config_model = {} # GatewayBfdConfig + gateway_bfd_config_model['bfd_status'] = 'up' + gateway_bfd_config_model['bfd_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + gateway_bfd_config_model['interval'] = 2000 + gateway_bfd_config_model['multiplier'] = 10 + + gateway_change_request_model = {} # GatewayChangeRequestGatewayClientGatewayCreate + gateway_change_request_model['type'] = 'create_gateway' + + gateway_macsec_config_active_cak_model = {} # GatewayMacsecConfigActiveCak + gateway_macsec_config_active_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_active_cak_model['status'] = 'testString' + + gateway_macsec_config_fallback_cak_model = {} # GatewayMacsecConfigFallbackCak + gateway_macsec_config_fallback_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_fallback_cak_model['status'] = 'testString' + + gateway_macsec_config_primary_cak_model = {} # GatewayMacsecConfigPrimaryCak + gateway_macsec_config_primary_cak_model['crn'] = 'crn:v1:bluemix:public:hs-crypto:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222' + gateway_macsec_config_primary_cak_model['status'] = 'testString' + + gateway_macsec_config_model = {} # GatewayMacsecConfig + gateway_macsec_config_model['active'] = True + gateway_macsec_config_model['active_cak'] = gateway_macsec_config_active_cak_model + gateway_macsec_config_model['cipher_suite'] = 'gcm_aes_xpn_256' + gateway_macsec_config_model['confidentiality_offset'] = 0 + gateway_macsec_config_model['cryptographic_algorithm'] = 'aes_256_cmac' + gateway_macsec_config_model['fallback_cak'] = gateway_macsec_config_fallback_cak_model + gateway_macsec_config_model['key_server_priority'] = 255 + gateway_macsec_config_model['primary_cak'] = gateway_macsec_config_primary_cak_model + gateway_macsec_config_model['sak_expiry_time'] = 3600 + gateway_macsec_config_model['security_policy'] = 'must_secure' + gateway_macsec_config_model['status'] = 'secured' + gateway_macsec_config_model['window_size'] = 64 + + gateway_port_model = {} # GatewayPort + gateway_port_model['id'] = '54321b1a-fee4-41c7-9e11-9cd99e000aaa' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' + + # Construct a json representation of a GetGatewayResponseGateway model + get_gateway_response_gateway_model_json = {} + get_gateway_response_gateway_model_json['as_prepends'] = [as_prepend_model] + get_gateway_response_gateway_model_json['authentication_key'] = gateway_authentication_key_model + get_gateway_response_gateway_model_json['bfd_config'] = gateway_bfd_config_model + get_gateway_response_gateway_model_json['bgp_asn'] = 64999 + get_gateway_response_gateway_model_json['bgp_base_cidr'] = 'testString' + get_gateway_response_gateway_model_json['bgp_cer_cidr'] = '10.254.30.78/30' + get_gateway_response_gateway_model_json['bgp_ibm_asn'] = 13884 + get_gateway_response_gateway_model_json['bgp_ibm_cidr'] = '10.254.30.77/30' + get_gateway_response_gateway_model_json['bgp_status'] = 'active' + get_gateway_response_gateway_model_json['bgp_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + get_gateway_response_gateway_model_json['carrier_name'] = 'myCarrierName' + get_gateway_response_gateway_model_json['change_request'] = gateway_change_request_model + get_gateway_response_gateway_model_json['completion_notice_reject_reason'] = 'The completion notice file was blank' + get_gateway_response_gateway_model_json['connection_mode'] = 'transit' + get_gateway_response_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' + get_gateway_response_gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::dedicated:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + get_gateway_response_gateway_model_json['cross_account'] = False + get_gateway_response_gateway_model_json['cross_connect_router'] = 'xcr01.dal03' + get_gateway_response_gateway_model_json['customer_name'] = 'newCustomerName' + get_gateway_response_gateway_model_json['default_export_route_filter'] = 'permit' + get_gateway_response_gateway_model_json['default_import_route_filter'] = 'permit' + get_gateway_response_gateway_model_json['global'] = True + get_gateway_response_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' + get_gateway_response_gateway_model_json['link_status'] = 'up' + get_gateway_response_gateway_model_json['link_status_updated_at'] = '2020-08-20T06:58:41.909000Z' + get_gateway_response_gateway_model_json['location_display_name'] = 'Dallas 03' + get_gateway_response_gateway_model_json['location_name'] = 'dal03' + get_gateway_response_gateway_model_json['macsec_config'] = gateway_macsec_config_model + get_gateway_response_gateway_model_json['metered'] = False + get_gateway_response_gateway_model_json['name'] = 'myGateway' + get_gateway_response_gateway_model_json['operational_status'] = 'awaiting_completion_notice' + get_gateway_response_gateway_model_json['port'] = gateway_port_model + get_gateway_response_gateway_model_json['provider_api_managed'] = False + get_gateway_response_gateway_model_json['resource_group'] = resource_group_reference_model + get_gateway_response_gateway_model_json['speed_mbps'] = 1000 + get_gateway_response_gateway_model_json['patch_panel_completion_notice'] = 'patch panel configuration details' + get_gateway_response_gateway_model_json['type'] = 'dedicated' + get_gateway_response_gateway_model_json['vlan'] = 10 + + # Construct a model instance of GetGatewayResponseGateway by calling from_dict on the json representation + get_gateway_response_gateway_model = GetGatewayResponseGateway.from_dict(get_gateway_response_gateway_model_json) + assert get_gateway_response_gateway_model != False + + # Construct a model instance of GetGatewayResponseGateway by calling from_dict on the json representation + get_gateway_response_gateway_model_dict = GetGatewayResponseGateway.from_dict(get_gateway_response_gateway_model_json).__dict__ + get_gateway_response_gateway_model2 = GetGatewayResponseGateway(**get_gateway_response_gateway_model_dict) + + # Verify the model instances are equivalent + assert get_gateway_response_gateway_model == get_gateway_response_gateway_model2 + + # Convert model instance back to dict and verify no loss of data + get_gateway_response_gateway_model_json2 = get_gateway_response_gateway_model.to_dict() + assert get_gateway_response_gateway_model_json2 == get_gateway_response_gateway_model_json + + +class TestModel_RouteReportOverlappingRouteForConnection: """ Test Class for RouteReportOverlappingRouteForConnection """ @@ -7075,7 +7808,8 @@ def test_route_report_overlapping_route_for_connection_serialization(self): route_report_overlapping_route_for_connection_model_json2 = route_report_overlapping_route_for_connection_model.to_dict() assert route_report_overlapping_route_for_connection_model_json2 == route_report_overlapping_route_for_connection_model_json -class TestModel_RouteReportOverlappingRouteForOthers(): + +class TestModel_RouteReportOverlappingRouteForOthers: """ Test Class for RouteReportOverlappingRouteForOthers """