diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c78da0a..d0e97db 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.24.0 +current_version = 0.26.2 commit = True message = Update version {current_version} -> {new_version} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 46b0e8a..211326a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -28,18 +28,20 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + include: + - language: python + build-mode: none # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -50,7 +52,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -64,4 +66,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..232214f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,92 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '39 19 * * 4' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: python + build-mode: none + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.travis.yml b/.travis.yml index b99793a..93c7039 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ notifications: matrix: include: - - python: 3.7 + - python: 3.9 before_script: - >- [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] @@ -19,8 +19,8 @@ matrix: && openssl aes-256-cbc -K $encrypted_fc092b9428d6_key -iv $encrypted_fc092b9428d6_iv -in cis.env.enc -out cis.env -d || true && openssl aes-256-cbc -K $encrypted_89a9eb4f9417_key -iv $encrypted_89a9eb4f9417_iv -in dns.env.enc -out dns.env -d || true - python: 3.8 - - python: 3.9 - python: 3.10 + - python: 3.11 before_install: - sudo apt-get update @@ -29,12 +29,15 @@ before_install: - echo -e "machine github.ibm.com\n login $GH_TOKEN" > ~/.netrc install: + - sudo rm /etc/apt/sources.list.d/mongodb-4.4.list + - wget -O- https://pgp.mongodb.com/server-4.4.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-4.4.gpg + - echo "deb [signed-by=/usr/share/keyrings/mongodb-4.4.gpg] http://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-4.4.list - pip install tox-travis script: tox before_deploy: -- nvm install 18 +- nvm install 20 - npm install npm@latest -g - npm install @semantic-release/changelog - npm install @semantic-release/exec @@ -47,7 +50,7 @@ deploy: script: npx semantic-release skip_cleanup: true on: - python: '3.7' + python: '3.9' branch: master - provider: pypi setuptools_version: "60.8.2" @@ -56,5 +59,5 @@ deploy: repository: https://upload.pypi.org/legacy skip_cleanup: true on: - python: '3.7' + python: '3.9' tags: true \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 282fac8..6e725f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## [0.26.2](https://github.com/IBM/networking-python-sdk/compare/v0.26.1...v0.26.2) (2024-06-17) + + +### Bug Fixes + +* Another possible fix for travis failure ([#114](https://github.com/IBM/networking-python-sdk/issues/114)) ([d18c6e5](https://github.com/IBM/networking-python-sdk/commit/d18c6e53ddd08324a2f5990a88207cde6e394ea7)) + +## [0.26.1](https://github.com/IBM/networking-python-sdk/compare/v0.26.0...v0.26.1) (2024-06-14) + + +### Bug Fixes + +* fixing the PGP mongodb reference issue ([#112](https://github.com/IBM/networking-python-sdk/issues/112)) ([10e6007](https://github.com/IBM/networking-python-sdk/commit/10e6007a083fb4b0a5c49ff10f64432ddee624e7)) + +# [0.26.0](https://github.com/IBM/networking-python-sdk/compare/v0.25.0...v0.26.0) (2024-06-12) + + +### Features + +* Added the new connection type - Redundant GRE ([#105](https://github.com/IBM/networking-python-sdk/issues/105)) ([5e6e23a](https://github.com/IBM/networking-python-sdk/commit/5e6e23a83ce70dfc3003fbc23dcfb904edec8cf4)) + +# [0.25.0](https://github.com/IBM/networking-python-sdk/compare/v0.24.0...v0.25.0) (2024-03-14) + + +### Bug Fixes + +* udating dependency versions ([#95](https://github.com/IBM/networking-python-sdk/issues/95)) ([9cfd59b](https://github.com/IBM/networking-python-sdk/commit/9cfd59b99e7b3896fdd3df72597de19c77fc12ee)) + + +### Features + +* direct link changes build release ([2ed3b18](https://github.com/IBM/networking-python-sdk/commit/2ed3b1893701da168ac54a9f2ec49549c44752d7)) +* directlink - dedicated vlan mapping ([1cb591a](https://github.com/IBM/networking-python-sdk/commit/1cb591a5ba79a3fb03dfceb3926ac476e29491a7)) +* directlink provider updated to latest spec ([0bd2ad1](https://github.com/IBM/networking-python-sdk/commit/0bd2ad1a99b74021ffd6281f7f8047821cea5e95)) +* Updating the list of reserved ASN numbers ([#92](https://github.com/IBM/networking-python-sdk/issues/92)) ([b5ca185](https://github.com/IBM/networking-python-sdk/commit/b5ca185a4a2faa7dc692a7992ad3d2ad85e9808b)) + # [0.24.0](https://github.com/IBM/networking-python-sdk/compare/v0.23.2...v0.24.0) (2023-09-12) diff --git a/README.md b/README.md index 71f5033..f470e0d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) -# IBM Cloud Networking Services Python SDK Version 0.24.0 +# IBM Cloud Networking Services Python SDK Version 0.26.2 Python client library to interact with various [IBM Cloud Networking Service APIs](https://cloud.ibm.com/apidocs?category=network). @@ -22,7 +22,7 @@ Python client library to interact with various [IBM Cloud Networking Service API npx markdown-toc -i README.md --> - + - [Overview](#overview) - [Prerequisites](#prerequisites) @@ -99,13 +99,13 @@ IBM Cloud services: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibm-cloud-networking-services==0.24.0" +pip install --upgrade "ibm-cloud-networking-services==0.26.2" ``` or ```bash -easy_install --upgrade "ibm-cloud-networking-servies==0.24.0" +easy_install --upgrade "ibm-cloud-networking-servies==0.26.2" ``` ## Using the SDK diff --git a/dl.env.properties b/dl.env.properties index 094a66a..56ea133 100644 --- a/dl.env.properties +++ b/dl.env.properties @@ -3,7 +3,12 @@ export DL_SERVICES_APIKEY="" export DL_SERVICES_LOCATION_NAME=dal09 export DL_SERVICES_LOCATION_LONG_NAME='Dallas 09' export DL_SERVICES_SERVICE_URL=https://directlink.test.cloud.ibm.com/v1 +export DL_PROVIDER_SERVICES_URL_V2=https://directlink.test.cloud.ibm.com/provider/v2 +export DL_PROVIDER_SERVICES_APIKEY="" +export DL_PROVIDER_SERVICES_CUSTOMER_ACCT_ID="" export DL_SERVICES_IAM_URL=https://iam.test.cloud.ibm.com/identity/token export DL_SERVICES_GW_NAME=SDK-PY-DL-gateway +export DL_PROVIDER_SERVICES_GW_NAME=SDK-PVDR-PY-DL-gw +export DL_PROVIDER_SERVICES_UPDATED_GW_NAME=SDK-PVDR-PY-DL-gw-updated export DL_SERVICES_CONN_NAME=SDK-PY-DL-vc export DL_SERVICES_AUTHENTICATION_KEY=crn:v1:public:is:us-south:a/3b1bd7fa2bc3406ea70ba4ade8aa3f1b::vpc:r134-1680db5a-7672-41af-89fb-bbbc94ac6964 \ No newline at end of file diff --git a/ibm_cloud_networking_services/direct_link_provider_v2.py b/ibm_cloud_networking_services/direct_link_provider_v2.py index 846b6a6..be08cfd 100644 --- a/ibm_cloud_networking_services/direct_link_provider_v2.py +++ b/ibm_cloud_networking_services/direct_link_provider_v2.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2021. +# (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,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.43.0-49eab5c7-20211117-152138 - +# IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 + """ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) @@ -39,6 +39,7 @@ # Service ############################################################################## + class DirectLinkProviderV2(BaseService): """The Direct Link Provider V2 service.""" @@ -46,10 +47,11 @@ class DirectLinkProviderV2(BaseService): DEFAULT_SERVICE_NAME = 'direct_link_provider' @classmethod - def new_instance(cls, - version: str, - service_name: str = DEFAULT_SERVICE_NAME, - ) -> 'DirectLinkProviderV2': + def new_instance( + cls, + version: str, + service_name: str = DEFAULT_SERVICE_NAME, + ) -> 'DirectLinkProviderV2': """ Return a new client for the Direct Link Provider 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 Provider service. @@ -87,22 +90,19 @@ 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 - ######################### # providerAPIs ######################### - - def list_provider_gateways(self, + def list_provider_gateways( + self, *, start: str = None, limit: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ List gateways. @@ -118,32 +118,37 @@ def list_provider_gateways(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='list_provider_gateways') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='list_provider_gateways', + ) headers.update(sdk_headers) params = { 'version': self.version, 'start': start, - 'limit': limit + 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] 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_provider_gateway(self, + def create_provider_gateway( + self, bgp_asn: int, customer_account_id: str, name: str, @@ -154,7 +159,7 @@ def create_provider_gateway(self, bgp_ibm_cidr: str = None, vlan: int = None, check_only: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create gateway. @@ -188,7 +193,7 @@ def create_provider_gateway(self, "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 vlan: (optional) VLAN requested for this gateway. - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. :param str check_only: (optional) When true, perform request validation only and do not create a gateway. :param dict headers: A `dict` containing the request headers @@ -208,14 +213,16 @@ def create_provider_gateway(self, raise ValueError('speed_mbps must be provided') port = convert_model(port) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='create_provider_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='create_provider_gateway', + ) headers.update(sdk_headers) params = { 'version': self.version, - 'check_only': check_only + 'check_only': check_only, } data = { @@ -226,7 +233,7 @@ def create_provider_gateway(self, 'speed_mbps': speed_mbps, 'bgp_cer_cidr': bgp_cer_cidr, 'bgp_ibm_cidr': bgp_ibm_cidr, - 'vlan': vlan + 'vlan': vlan, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -234,22 +241,25 @@ def create_provider_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] 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_provider_gateway(self, + def delete_provider_gateway( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete gateway. @@ -262,38 +272,43 @@ def delete_provider_gateway(self, :rtype: DetailedResponse with `dict` result representing a `ProviderGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='delete_provider_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='delete_provider_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] 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_provider_gateway(self, + def get_provider_gateway( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get gateway. @@ -308,36 +323,41 @@ def get_provider_gateway(self, :rtype: DetailedResponse with `dict` result representing a `ProviderGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='get_provider_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='get_provider_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] 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_provider_gateway(self, + def update_provider_gateway( + self, id: str, *, bgp_asn: int = None, @@ -346,7 +366,7 @@ def update_provider_gateway(self, name: str = None, speed_mbps: int = None, vlan: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Update gateway. @@ -379,22 +399,24 @@ def update_provider_gateway(self, :param str name: (optional) The unique user-defined name for this gateway. :param int speed_mbps: (optional) Gateway speed in megabits per second. :param int vlan: (optional) VLAN to be modified for this gateway. - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. :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 `ProviderGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='update_provider_gateway') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='update_provider_gateway', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } data = { @@ -403,7 +425,7 @@ def update_provider_gateway(self, 'bgp_ibm_cidr': bgp_ibm_cidr, 'name': name, 'speed_mbps': speed_mbps, - 'vlan': vlan + 'vlan': vlan, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -411,27 +433,30 @@ def update_provider_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] 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 list_provider_ports(self, + def list_provider_ports( + self, *, start: str = None, limit: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ List ports. @@ -447,34 +472,39 @@ def list_provider_ports(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='list_provider_ports') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='list_provider_ports', + ) headers.update(sdk_headers) params = { 'version': self.version, 'start': start, - 'limit': limit + 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] 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_provider_port(self, + def get_provider_port( + self, id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get port. @@ -487,30 +517,35 @@ def get_provider_port(self, :rtype: DetailedResponse with `dict` result representing a `ProviderPort` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V2', - operation_id='get_provider_port') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V2', + operation_id='get_provider_port', + ) headers.update(sdk_headers) params = { - 'version': self.version + 'version': self.version, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] 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 @@ -521,7 +556,7 @@ def get_provider_port(self, ############################################################################## -class ProviderGateway(): +class ProviderGateway: """ gateway. @@ -554,25 +589,27 @@ class ProviderGateway(): :attr int vlan: (optional) VLAN for this gateway. """ - def __init__(self, - bgp_asn: int, - bgp_ibm_asn: int, - created_at: datetime, - customer_account_id: str, - id: str, - name: str, - operational_status: str, - port: 'ProviderGatewayPortReference', - provider_api_managed: bool, - speed_mbps: int, - type: str, - *, - bgp_cer_cidr: str = None, - bgp_ibm_cidr: str = None, - bgp_status: str = None, - change_request: 'ProviderGatewayChangeRequest' = None, - crn: str = None, - vlan: int = None) -> None: + def __init__( + self, + bgp_asn: int, + bgp_ibm_asn: int, + created_at: datetime, + customer_account_id: str, + id: str, + name: str, + operational_status: str, + port: 'ProviderGatewayPortReference', + provider_api_managed: bool, + speed_mbps: int, + type: str, + *, + bgp_cer_cidr: str = None, + bgp_ibm_cidr: str = None, + bgp_status: str = None, + change_request: 'ProviderGatewayChangeRequest' = None, + crn: str = None, + vlan: int = None, + ) -> None: """ Initialize a ProviderGateway object. @@ -720,7 +757,10 @@ def to_dict(self) -> Dict: 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: - _dict['port'] = self.port.to_dict() + 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, 'speed_mbps') and self.speed_mbps is not None: @@ -755,6 +795,7 @@ class BgpStatusEnum(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. """ + ACTIVE = 'active' CONNECT = 'connect' ESTABLISHED = 'established' @@ -767,6 +808,7 @@ class OperationalStatusEnum(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. """ + CONFIGURING = 'configuring' CREATE_PENDING = 'create_pending' CREATE_REJECTED = 'create_rejected' @@ -774,22 +816,27 @@ class OperationalStatusEnum(str, Enum): PROVISIONED = 'provisioned' -class ProviderGatewayChangeRequest(): + +class ProviderGatewayChangeRequest: """ ProviderGatewayChangeRequest. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a ProviderGatewayChangeRequest object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ProviderGatewayChangeRequestProviderGatewayCreate', 'ProviderGatewayChangeRequestProviderGatewayDelete', 'ProviderGatewayChangeRequestProviderGatewayUpdateAttributes'])) + ", ".join(['ProviderGatewayChangeRequestProviderGatewayCreate', 'ProviderGatewayChangeRequestProviderGatewayDelete', 'ProviderGatewayChangeRequestProviderGatewayUpdateAttributes']) + ) raise Exception(msg) -class ProviderGatewayCollection(): + +class ProviderGatewayCollection: """ A paginated collection of resources. @@ -803,13 +850,15 @@ class ProviderGatewayCollection(): :attr List[ProviderGateway] gateways: Collection of Direct Link gateways. """ - def __init__(self, - first: 'ProviderGatewayCollectionFirst', - limit: int, - total_count: int, - gateways: List['ProviderGateway'], - *, - next: 'ProviderGatewayCollectionNext' = None) -> None: + def __init__( + self, + first: 'ProviderGatewayCollectionFirst', + limit: int, + total_count: int, + gateways: List['ProviderGateway'], + *, + next: 'ProviderGatewayCollectionNext' = None, + ) -> None: """ Initialize a ProviderGatewayCollection object. @@ -848,7 +897,7 @@ def from_dict(cls, _dict: Dict) -> 'ProviderGatewayCollection': else: raise ValueError('Required property \'total_count\' not present in ProviderGatewayCollection JSON') if 'gateways' in _dict: - args['gateways'] = [ProviderGateway.from_dict(x) for x in _dict.get('gateways')] + args['gateways'] = [ProviderGateway.from_dict(v) for v in _dict.get('gateways')] else: raise ValueError('Required property \'gateways\' not present in ProviderGatewayCollection JSON') return cls(**args) @@ -862,15 +911,27 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count if hasattr(self, 'gateways') and self.gateways is not None: - _dict['gateways'] = [x.to_dict() for x in self.gateways] + gateways_list = [] + for v in self.gateways: + if isinstance(v, dict): + gateways_list.append(v) + else: + gateways_list.append(v.to_dict()) + _dict['gateways'] = gateways_list return _dict def _to_dict(self): @@ -891,15 +952,18 @@ def __ne__(self, other: 'ProviderGatewayCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderGatewayCollectionFirst(): + +class ProviderGatewayCollectionFirst: """ 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 ProviderGatewayCollectionFirst object. @@ -947,7 +1011,8 @@ def __ne__(self, other: 'ProviderGatewayCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderGatewayCollectionNext(): + +class ProviderGatewayCollectionNext: """ A reference to the next page of resources; this reference is included for all pages except the last page. @@ -956,9 +1021,11 @@ class ProviderGatewayCollectionNext(): :attr str start: start token for the next page of resources. """ - def __init__(self, - href: str, - start: str) -> None: + def __init__( + self, + href: str, + start: str, + ) -> None: """ Initialize a ProviderGatewayCollectionNext object. @@ -1014,15 +1081,18 @@ def __ne__(self, other: 'ProviderGatewayCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderGatewayPortIdentity(): + +class ProviderGatewayPortIdentity: """ Select Port Label for the gateway. :attr str id: Port identifier. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a ProviderGatewayPortIdentity object. @@ -1070,15 +1140,18 @@ def __ne__(self, other: 'ProviderGatewayPortIdentity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderGatewayPortReference(): + +class ProviderGatewayPortReference: """ Port identifier for the gateway. :attr str id: Port identifier. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a ProviderGatewayPortReference object. @@ -1126,22 +1199,27 @@ def __ne__(self, other: 'ProviderGatewayPortReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderGatewayUpdateAttributesUpdatesItem(): + +class ProviderGatewayUpdateAttributesUpdatesItem: """ ProviderGatewayUpdateAttributesUpdatesItem. """ - def __init__(self) -> None: + def __init__( + self, + ) -> None: """ Initialize a ProviderGatewayUpdateAttributesUpdatesItem object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN'])) + ", ".join(['ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate', 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN']) + ) raise Exception(msg) -class ProviderPort(): + +class ProviderPort: """ Provider port details. @@ -1154,13 +1232,15 @@ class ProviderPort(): second. """ - def __init__(self, - id: str, - label: str, - location_display_name: str, - location_name: str, - provider_name: str, - supported_link_speeds: List[int]) -> None: + def __init__( + self, + id: str, + label: str, + location_display_name: str, + location_name: str, + provider_name: str, + supported_link_speeds: List[int], + ) -> None: """ Initialize a ProviderPort object. @@ -1249,7 +1329,8 @@ def __ne__(self, other: 'ProviderPort') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderPortCollection(): + +class ProviderPortCollection: """ List of port label details. @@ -1262,13 +1343,15 @@ class ProviderPortCollection(): :attr List[ProviderPort] ports: (optional) Array of ports. """ - def __init__(self, - first: 'ProviderPortCollectionFirst', - limit: int, - total_count: int, - *, - next: 'ProviderPortCollectionNext' = None, - ports: List['ProviderPort'] = None) -> None: + def __init__( + self, + first: 'ProviderPortCollectionFirst', + limit: int, + total_count: int, + *, + next: 'ProviderPortCollectionNext' = None, + ports: List['ProviderPort'] = None, + ) -> None: """ Initialize a ProviderPortCollection object. @@ -1307,7 +1390,7 @@ def from_dict(cls, _dict: Dict) -> 'ProviderPortCollection': else: raise ValueError('Required property \'total_count\' not present in ProviderPortCollection JSON') if 'ports' in _dict: - args['ports'] = [ProviderPort.from_dict(x) for x in _dict.get('ports')] + args['ports'] = [ProviderPort.from_dict(v) for v in _dict.get('ports')] return cls(**args) @classmethod @@ -1319,15 +1402,27 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count if hasattr(self, 'ports') and self.ports is not None: - _dict['ports'] = [x.to_dict() for x in self.ports] + ports_list = [] + for v in self.ports: + if isinstance(v, dict): + ports_list.append(v) + else: + ports_list.append(v.to_dict()) + _dict['ports'] = ports_list return _dict def _to_dict(self): @@ -1348,15 +1443,18 @@ def __ne__(self, other: 'ProviderPortCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderPortCollectionFirst(): + +class ProviderPortCollectionFirst: """ 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 ProviderPortCollectionFirst object. @@ -1404,7 +1502,8 @@ def __ne__(self, other: 'ProviderPortCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ProviderPortCollectionNext(): + +class ProviderPortCollectionNext: """ A reference to the next page of resources; this reference is included for all pages except the last page. @@ -1413,9 +1512,11 @@ class ProviderPortCollectionNext(): :attr str start: start token for the next page of resources. """ - def __init__(self, - href: str, - start: str) -> None: + def __init__( + self, + href: str, + start: str, + ) -> None: """ Initialize a ProviderPortCollectionNext object. @@ -1471,6 +1572,7 @@ def __ne__(self, other: 'ProviderPortCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProviderGatewayChangeRequestProviderGatewayCreate(ProviderGatewayChangeRequest): """ gateway create. @@ -1478,8 +1580,10 @@ class ProviderGatewayChangeRequestProviderGatewayCreate(ProviderGatewayChangeReq :attr str type: type of gateway change request. """ - def __init__(self, - type: str) -> None: + def __init__( + self, + type: str, + ) -> None: """ Initialize a ProviderGatewayChangeRequestProviderGatewayCreate object. @@ -1532,9 +1636,11 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + CREATE_GATEWAY = 'create_gateway' + class ProviderGatewayChangeRequestProviderGatewayDelete(ProviderGatewayChangeRequest): """ gateway delete. @@ -1542,8 +1648,10 @@ class ProviderGatewayChangeRequestProviderGatewayDelete(ProviderGatewayChangeReq :attr str type: type of gateway change request. """ - def __init__(self, - type: str) -> None: + def __init__( + self, + type: str, + ) -> None: """ Initialize a ProviderGatewayChangeRequestProviderGatewayDelete object. @@ -1596,9 +1704,11 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + DELETE_GATEWAY = 'delete_gateway' + class ProviderGatewayChangeRequestProviderGatewayUpdateAttributes(ProviderGatewayChangeRequest): """ gateway attributes update. @@ -1608,9 +1718,11 @@ class ProviderGatewayChangeRequestProviderGatewayUpdateAttributes(ProviderGatewa updates. """ - def __init__(self, - type: str, - updates: List['ProviderGatewayUpdateAttributesUpdatesItem']) -> None: + def __init__( + self, + type: str, + updates: List['ProviderGatewayUpdateAttributesUpdatesItem'], + ) -> None: """ Initialize a ProviderGatewayChangeRequestProviderGatewayUpdateAttributes object. @@ -1648,11 +1760,11 @@ def to_dict(self) -> Dict: _dict['type'] = self.type if hasattr(self, 'updates') and self.updates is not None: updates_list = [] - for x in self.updates: - if isinstance(x, dict): - updates_list.append(x) + for v in self.updates: + if isinstance(v, dict): + updates_list.append(v) else: - updates_list.append(x.to_dict()) + updates_list.append(v.to_dict()) _dict['updates'] = updates_list return _dict @@ -1678,9 +1790,11 @@ class TypeEnum(str, Enum): """ type of gateway change request. """ + UPDATE_ATTRIBUTES = 'update_attributes' + class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate(ProviderGatewayUpdateAttributesUpdatesItem): """ The autonomous system number (ASN) of Border Gateway Protocol @@ -1689,9 +1803,11 @@ class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate(Prov :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 ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate object. @@ -1738,6 +1854,7 @@ def __ne__(self, other: 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatew """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate(ProviderGatewayUpdateAttributesUpdatesItem): """ Update BGP customer and IBM CIDR. @@ -1762,10 +1879,12 @@ class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate(Provi 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 ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate object. @@ -1835,6 +1954,7 @@ def __ne__(self, other: 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatew """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate(ProviderGatewayUpdateAttributesUpdatesItem): """ gateway speed change. @@ -1842,9 +1962,11 @@ class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate(Provi :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 ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate object. @@ -1891,23 +2013,26 @@ def __ne__(self, other: 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatew """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN(ProviderGatewayUpdateAttributesUpdatesItem): """ 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. - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. """ - def __init__(self, - *, - vlan: int = None) -> None: + def __init__( + self, + *, + vlan: int = None, + ) -> None: """ Initialize a ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN object. :param int vlan: (optional) VLAN to be updated for this gateway. - VLAN provided should be in the range 1 to 4094. + VLAN provided should be in the range 2 to 3967. """ # pylint: disable=super-init-not-called self.vlan = vlan @@ -1949,3 +2074,135 @@ def __eq__(self, other: 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatew def __ne__(self, other: 'ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + +############################################################################## +# Pagers +############################################################################## + + +class ProviderGatewaysPager: + """ + ProviderGatewaysPager can be used to simplify the use of the "list_provider_gateways" method. + """ + + def __init__( + self, + *, + client: DirectLinkProviderV2, + limit: int = None, + ) -> None: + """ + Initialize a ProviderGatewaysPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ProviderGateway. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_provider_gateways( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = next_page_link.get('start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('gateways') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ProviderGateway. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ProviderPortsPager: + """ + ProviderPortsPager can be used to simplify the use of the "list_provider_ports" method. + """ + + def __init__( + self, + *, + client: DirectLinkProviderV2, + limit: int = None, + ) -> None: + """ + Initialize a ProviderPortsPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ProviderPort. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_provider_ports( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = next_page_link.get('start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('ports') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ProviderPort. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results 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/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index 5f29f60..f44c195 100644 --- a/ibm_cloud_networking_services/transit_gateway_apis_v1.py +++ b/ibm_cloud_networking_services/transit_gateway_apis_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. @@ -523,6 +523,7 @@ def create_transit_gateway_connection( remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, + tunnels: List['TransitGatewayRedundantGRETunnelTemplate'] = None, zone: 'ZoneIdentity' = None, **kwargs, ) -> DetailedResponse: @@ -533,51 +534,56 @@ def create_transit_gateway_connection( :param str transit_gateway_id: The Transit Gateway identifier. :param str network_type: Defines what type of network is connected via this - connection. For access to gre_tunnel or unbound_gre_tunnel connections - contact IBM support. + connection. :param str base_connection_id: (optional) Deprecated: network_type 'gre_tunnel' connections must be created over an existing network_type 'classic' connection. This field must specify the ID of an active transit gateway network_type 'classic' connection in the same transit gateway. This field is required for network type 'gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'unbound_gre_tunnel' + 'directlink', 'vpc', + 'power_virtual_server', 'unbound_gre_tunnel' and 'redundant_gre' connections. :param str base_network_type: (optional) The type of network the Unbound GRE tunnel is targeting. This field is required for network type - 'unbound_gre_tunnel' connections. This field is required to be unspecified - for network type 'classic', 'directlink', 'vpc', 'power_virtual_server' and - 'gre_tunnel' connections. + 'unbound_gre_tunnel' and must be set to 'classic'. For a 'redundant_gre' + network type, the value is required and can be either VPC or Classic. This + field is required to be unspecified for network type 'classic', + 'directlink', 'vpc', 'power_virtual_server' and 'gre_tunnel' connections. :param str local_gateway_ip: (optional) Local gateway IP address. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc' and 'power_virtual_server' connections. + 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str local_tunnel_ip: (optional) Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str name: (optional) The user-defined name for this transit gateway connection. Network type 'vpc' connections are defaulted to the name of the VPC. Network type 'classic' connections are named 'Classic'. - This field is required for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + This field is required for network type 'gre_tunnel', 'unbound_gre_tunnel' + and 'redundant_gre' connections. This field is optional for network type 'classic', 'directlink', 'vpc' and 'power_virtual_server' connections. :param str network_account_id: (optional) The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type - 'unbound_gre_tunnel' when the associated_network_type is 'classic' and the - GRE tunnel is in a different account than the gateway. + 'unbound_gre_tunnel' when the associated_network_type is 'classic' or + network_type is 'redundant_gre' and the GRE tunnel is in a different + account than the gateway. :param str network_id: (optional) The ID of the network being connected via this connection. For network types 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / PowerVS / Direct Link gateway respectively. This field is required for network type 'vpc', - 'power_virtual_server' and 'directlink' connections. This field is required - to be unspecified for network type 'classic', 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + 'power_virtual_server' and 'directlink' connections. It is also required + for 'redundant_gre' connections when the base_network_type is set to VPC. + This field is required to be unspecified for network type 'classic', + 'gre_tunnel' and 'unbound_gre_tunnel' connections. :param List[TransitGatewayConnectionPrefixFilter] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type 'vpc', 'classic', @@ -587,13 +593,13 @@ def create_transit_gateway_connection( applied last, or just before applying the default. This field is optional for network type 'classic', 'vpc', 'directlink', and 'power_virtual_server' connections. This field is required to be unspecified for network type - 'gre_tunnel' and 'unbound_gre_tunnel' connections. + 'gre_tunnel', 'unbound_gre_tunnel' and 'redundant_gre' connections. :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field is optional for network type 'classic', 'vpc', 'directlink', and 'power_virtual_server' connections. This field is required to be - unspecified for network type 'gre_tunnel' and 'unbound_gre_tunnel' - connections. + unspecified for network type 'gre_tunnel', 'unbound_gre_tunnel' and + 'redundant_gre' connections. :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If @@ -602,25 +608,31 @@ def create_transit_gateway_connection( This field is optional for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'gre_tunnel' connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc' and 'power_virtual_server' connections. + 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. + :param List[TransitGatewayRedundantGRETunnelTemplate] tunnels: (optional) + Array of GRE tunnels for a transit gateway redundant GRE tunnel connection. + This field is required for 'redundant_gre' connections. :param ZoneIdentity zone: (optional) Specify the connection's location. The specified availability zone must reside in the gateway's region. Use the IBM Cloud global catalog to list zones within the desired region. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :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 `TransitGatewayConnectionCust` object @@ -632,6 +644,8 @@ def create_transit_gateway_connection( raise ValueError('network_type must be provided') if prefix_filters is not None: prefix_filters = [convert_model(x) for x in prefix_filters] + if tunnels is not None: + tunnels = [convert_model(x) for x in tunnels] if zone is not None: zone = convert_model(zone) headers = {} @@ -660,6 +674,7 @@ def create_transit_gateway_connection( 'remote_bgp_asn': remote_bgp_asn, 'remote_gateway_ip': remote_gateway_ip, 'remote_tunnel_ip': remote_tunnel_ip, + 'tunnels': tunnels, 'zone': zone, } data = {k: v for (k, v) in data.items() if v is not None} @@ -929,29 +944,33 @@ def create_transit_gateway_connection_actions( response = self.send(request, **kwargs) return response - ######################### - # Transit Location - ######################### - - def list_gateway_locations( + def get_transit_gateway_gre_tunnel( self, + transit_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all locations that support Transit Gateways. + Retrieves specified Transit Gateway redundant gre connection tunnels. - List all locations that support Transit Gateways. + This request retrieves a list of all the tunnels for the redundant gre conneciton. + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection 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 `TSCollection` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelCollection` object """ + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + 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_locations', + operation_id='get_transit_gateway_gre_tunnel', ) headers.update(sdk_headers) @@ -964,7 +983,10 @@ def list_gateway_locations( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/locations' + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -975,29 +997,70 @@ def list_gateway_locations( response = self.send(request, **kwargs) return response - def get_gateway_location( + def create_transit_gateway_gre_tunnel( self, + transit_gateway_id: str, + id: str, + local_gateway_ip: str, + local_tunnel_ip: str, name: str, + remote_gateway_ip: str, + remote_tunnel_ip: str, + zone: 'ZoneIdentity', + *, + remote_bgp_asn: int = None, **kwargs, ) -> DetailedResponse: """ - Show the details of a given Transit Gateway location. + Create Transit Gateway redundant GRE tunnel. - Get the details of a Transit Gateway Location. + Add a tunnel to an existing Redundant GRE connection. - :param str name: The Transit Gateway location Name. + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param str name: The user-defined name for this tunnel connection. + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. + :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following + ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, + 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If + 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. :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 `TSLocation` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ - if not name: + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if local_gateway_ip is None: + raise ValueError('local_gateway_ip must be provided') + if local_tunnel_ip is None: + raise ValueError('local_tunnel_ip must be provided') + if name is None: raise ValueError('name must be provided') + if remote_gateway_ip is None: + raise ValueError('remote_gateway_ip must be provided') + if remote_tunnel_ip is None: + raise ValueError('remote_tunnel_ip must be provided') + if zone is None: + raise ValueError('zone must be provided') + zone = convert_model(zone) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_gateway_location', + operation_id='create_transit_gateway_gre_tunnel', ) headers.update(sdk_headers) @@ -1005,56 +1068,70 @@ def get_gateway_location( 'version': self.version, } + data = { + 'local_gateway_ip': local_gateway_ip, + 'local_tunnel_ip': local_tunnel_ip, + 'name': name, + 'remote_gateway_ip': remote_gateway_ip, + 'remote_tunnel_ip': remote_tunnel_ip, + 'zone': zone, + 'remote_bgp_asn': remote_bgp_asn, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['name'] - path_param_values = self.encode_path_vars(name) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/locations/{name}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Transit Gateway Connection Prefix Filters - ######################### - - def list_transit_gateway_connection_prefix_filters( + def delete_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, + gre_tunnel_id: str, **kwargs, ) -> DetailedResponse: """ - Retrieves all prefix filters in a Transit Gateway connection. + Delete specified Transit Gateway redundant GRE tunnel. - This request retrieves all prefix filters in a Transit Gateway connection. + Remove a tunnel from a redundant GRE connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. + :param str gre_tunnel_id: The tunnel 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 `PrefixFilterCollection` object + :rtype: DetailedResponse """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_transit_gateway_connection_prefix_filters', + operation_id='delete_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1065,14 +1142,13 @@ def list_transit_gateway_connection_prefix_filters( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -1081,75 +1157,37 @@ def list_transit_gateway_connection_prefix_filters( response = self.send(request, **kwargs) return response - def create_transit_gateway_connection_prefix_filter( + def get_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, - action: str, - prefix: str, - *, - before: str = None, - ge: int = None, - le: int = None, + gre_tunnel_id: str, **kwargs, ) -> DetailedResponse: """ - Add a prefix filter to a Transit Gateway Connection. + Retrieves specified Transit Gateway connection tunnel. - Add a prefix filter to a Transit Gateway Connection. + This request retrieves a connection tunnel from the Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. - :param str action: Whether or not this prefix filter should allow or deny - prefixes matching this filter's prefix definition. - :param str prefix: The IPv4 Prefix to be matched by this filter. If both - the 'le' and 'ge' are zero, then this filter will only apply to routes that - exactly match this prefix, while a non-zero value for either 'le' or 'ge', - this filter can apply to multiple routes with different prefix lengths, but - will still only apply to prefixes contained in the address space defined by - 'prefix'. - :param str before: (optional) A reference to the prefix filter that will be - the next filter applied to the Transit Gateway connection. - If this field is blank, this prefix filter will be the last rule applied - before the connection's default rule. - When a prefix filter is created with the same before field as an existing - prefix filter, the existing filter will be applied before the new filter, - and the existing filter's before field will be updated accordingly. - :param int ge: (optional) Defines the minimum matched prefix precision. If - this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater than or equal to this value. - This value can be zero, or a non-negative number greater than or equal to - the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'ge' route matching - behavior. If the 'le' value is non-zero the the 'ge' value must between the - prefix length and the - 'le' value, inclusive. - :param int le: (optional) Defines the maximum matched prefix precision. If - this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. - This value can be zero, or a non-negative number greater than or equal to - the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'le' route matching - behavior. If the 'ge' value is non-zero the the 'le' value must between the - 'ge' value and 32, inclusive. + :param str gre_tunnel_id: The tunnel 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 `PrefixFilterCust` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if action is None: - raise ValueError('action must be provided') - if prefix is None: - raise ValueError('prefix must be provided') + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_transit_gateway_connection_prefix_filter', + operation_id='get_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1157,69 +1195,60 @@ def create_transit_gateway_connection_prefix_filter( 'version': self.version, } - data = { - 'action': action, - 'prefix': prefix, - 'before': before, - 'ge': ge, - 'le': le, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def replace_transit_gateway_connection_prefix_filter( + def update_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, - prefix_filters: List['PrefixFilterPut'], + gre_tunnel_id: str, + *, + name: str = None, **kwargs, ) -> DetailedResponse: """ - Replaces the prefix filters of the Transit Gateway Connection. + Updates specified Transit Gateway redundant GRE tunnel. - Replaces the prefix filters of the Transit Gateway Connection. + Update the name of a connection tunnel. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. - :param List[PrefixFilterPut] prefix_filters: Array of prefix filters. + :param str gre_tunnel_id: The tunnel identifier. + :param str name: (optional) The user-defined name for this connection + tunnel. :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 `PrefixFilterCollection` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if prefix_filters is None: - raise ValueError('prefix_filters must be provided') - prefix_filters = [convert_model(x) for x in prefix_filters] + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='replace_transit_gateway_connection_prefix_filter', + operation_id='update_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1228,7 +1257,7 @@ def replace_transit_gateway_connection_prefix_filter( } data = { - 'prefix_filters': prefix_filters, + 'name': name, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1239,12 +1268,12 @@ def replace_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='PATCH', url=url, headers=headers, params=params, @@ -1254,37 +1283,29 @@ def replace_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def delete_transit_gateway_connection_prefix_filter( + ######################### + # Transit Location + ######################### + + def list_gateway_locations( self, - transit_gateway_id: str, - id: str, - filter_id: str, **kwargs, ) -> DetailedResponse: """ - Remove prefix filter from Transit Gateway Connection. + List all locations that support Transit Gateways. - Delete a prefix filter. + List all locations that support Transit Gateways. - :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `TSCollection` object """ - if not transit_gateway_id: - raise ValueError('transit_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_transit_gateway_connection_prefix_filter', + operation_id='list_gateway_locations', ) headers.update(sdk_headers) @@ -1295,13 +1316,11 @@ def delete_transit_gateway_connection_prefix_filter( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/locations' request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -1310,37 +1329,29 @@ def delete_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def get_transit_gateway_connection_prefix_filter( + def get_gateway_location( self, - transit_gateway_id: str, - id: str, - filter_id: str, + name: str, **kwargs, ) -> DetailedResponse: """ - Retrieves specified Transit Gateway connection prefix filter. + Show the details of a given Transit Gateway location. - This request retrieves a prefix filter from the Transit Gateway Connection. + Get the details of a Transit Gateway Location. - :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. + :param str name: The Transit Gateway location Name. :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 `PrefixFilterCust` object + :rtype: DetailedResponse with `dict` result representing a `TSLocation` object """ - if not transit_gateway_id: - raise ValueError('transit_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') + if not name: + raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_transit_gateway_connection_prefix_filter', + operation_id='get_gateway_location', ) headers.update(sdk_headers) @@ -1353,10 +1364,10 @@ def get_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) + path_param_keys = ['name'] + path_param_values = self.encode_path_vars(name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/locations/{name}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -1367,29 +1378,90 @@ def get_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def update_transit_gateway_connection_prefix_filter( + ######################### + # Transit Gateway Connection Prefix Filters + ######################### + + def list_transit_gateway_connection_prefix_filters( self, transit_gateway_id: str, id: str, - filter_id: str, - *, - action: str = None, - before: str = None, - ge: int = None, - le: int = None, - prefix: str = None, **kwargs, ) -> DetailedResponse: """ - Updates specified Transit Gateway connection prefix filter. + Retrieves all prefix filters in a Transit Gateway connection. - Update prefix filter for a Transit Gateway Connection. + This request retrieves all prefix filters in a Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. - :param str action: (optional) Whether or not this prefix filter should - allow or deny prefixes matching this filter's prefix definition. + :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 `PrefixFilterCollection` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + 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_transit_gateway_connection_prefix_filters', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_transit_gateway_connection_prefix_filter( + self, + transit_gateway_id: str, + id: str, + action: str, + prefix: str, + *, + before: str = None, + ge: int = None, + le: int = None, + **kwargs, + ) -> DetailedResponse: + """ + Add a prefix filter to a Transit Gateway Connection. + + Add a prefix filter to a Transit Gateway Connection. + + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param str action: Whether or not this prefix filter should allow or deny + prefixes matching this filter's prefix definition. + :param str prefix: The IPv4 Prefix to be matched by this filter. If both + the 'le' and 'ge' are zero, then this filter will only apply to routes that + exactly match this prefix, while a non-zero value for either 'le' or 'ge', + this filter can apply to multiple routes with different prefix lengths, but + will still only apply to prefixes contained in the address space defined by + 'prefix'. :param str before: (optional) A reference to the prefix filter that will be the next filter applied to the Transit Gateway connection. If this field is blank, this prefix filter will be the last rule applied @@ -1399,7 +1471,7 @@ def update_transit_gateway_connection_prefix_filter( and the existing filter's before field will be updated accordingly. :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater or equal to this value. + 'prefix' that have a prefix length greater than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If this value is set to zero, the filter will not use the 'ge' route matching @@ -1414,7 +1486,6 @@ def update_transit_gateway_connection_prefix_filter( this value is set to zero, the filter will not use the 'le' route matching behavior. If the 'ge' value is non-zero the the 'le' value must between the 'ge' value and 32, inclusive. - :param str prefix: (optional) The IPv4 Prefix to be matched by this filter. :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 `PrefixFilterCust` object @@ -1424,13 +1495,15 @@ def update_transit_gateway_connection_prefix_filter( raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') + if action is None: + raise ValueError('action must be provided') + 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='update_transit_gateway_connection_prefix_filter', + operation_id='create_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1440,10 +1513,10 @@ def update_transit_gateway_connection_prefix_filter( data = { 'action': action, + 'prefix': prefix, 'before': before, 'ge': ge, 'le': le, - 'prefix': prefix, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1454,12 +1527,12 @@ def update_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, @@ -1469,35 +1542,38 @@ def update_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - ######################### - # Transit Gateway Route Reports - ######################### - - def list_transit_gateway_route_reports( + def replace_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, + id: str, + prefix_filters: List['PrefixFilterPut'], **kwargs, ) -> DetailedResponse: """ - List route reports. + Replaces the prefix filters of the Transit Gateway Connection. - Retrieve all route reports for the specified Transit Gateway. There will normally - be at most one completed report and one pending report. Additionally, completed - route reports are written to IBM Cloud Activity Tracker. + Replaces the prefix filters of the Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param List[PrefixFilterPut] prefix_filters: Array of prefix filters. :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 `RouteReportCollection` object + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCollection` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if prefix_filters is None: + raise ValueError('prefix_filters must be provided') + prefix_filters = [convert_model(x) for x in prefix_filters] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_transit_gateway_route_reports', + operation_id='replace_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1505,50 +1581,64 @@ def list_transit_gateway_route_reports( 'version': self.version, } + data = { + 'prefix_filters': prefix_filters, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id'] - path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def create_transit_gateway_route_report( + def delete_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, + id: str, + filter_id: str, **kwargs, ) -> DetailedResponse: """ - Request a route report. + Remove prefix filter from Transit Gateway Connection. - Request route report generation. While report generation is in progress, - additional requests to generate a report are ignored and return the current - pending report. + Delete a prefix filter. :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter 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 `RouteReport` object + :rtype: DetailedResponse """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_transit_gateway_route_report', + operation_id='delete_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1559,14 +1649,13 @@ def create_transit_gateway_route_report( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id'] - path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, @@ -1575,33 +1664,37 @@ def create_transit_gateway_route_report( response = self.send(request, **kwargs) return response - def delete_transit_gateway_route_report( + def get_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, id: str, + filter_id: str, **kwargs, ) -> DetailedResponse: """ - Delete route report. + Retrieves specified Transit Gateway connection prefix filter. - Delete a route report. + This request retrieves a prefix filter from the Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: Route report identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_transit_gateway_route_report', + operation_id='get_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1612,13 +1705,14 @@ def delete_transit_gateway_route_report( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -1627,33 +1721,70 @@ def delete_transit_gateway_route_report( response = self.send(request, **kwargs) return response - def get_transit_gateway_route_report( + def update_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, id: str, + filter_id: str, + *, + action: str = None, + before: str = None, + ge: int = None, + le: int = None, + prefix: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve route report. + Updates specified Transit Gateway connection prefix filter. - Retrieve a route report. + Update prefix filter for a Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: Route report identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter identifier. + :param str action: (optional) Whether or not this prefix filter should + allow or deny prefixes matching this filter's prefix definition. + :param str before: (optional) A reference to the prefix filter that will be + the next filter applied to the Transit Gateway connection. + If this field is blank, this prefix filter will be the last rule applied + before the connection's default rule. + When a prefix filter is created with the same before field as an existing + prefix filter, the existing filter will be applied before the new filter, + and the existing filter's before field will be updated accordingly. + :param int ge: (optional) Defines the minimum matched prefix precision. If + this field is non-zero then the filter will match all routes within the + 'prefix' that have a prefix length greater or equal to this value. + This value can be zero, or a non-negative number greater than or equal to + the prefix length of the filter's prefix or less then or equal to 32. If + this value is set to zero, the filter will not use the 'ge' route matching + behavior. If the 'le' value is non-zero the the 'ge' value must between the + prefix length and the + 'le' value, inclusive. + :param int le: (optional) Defines the maximum matched prefix precision. If + this field is non-zero then the filter will match all routes within the + 'prefix' that have a prefix length less than or equal to this value. + This value can be zero, or a non-negative number greater than or equal to + the prefix length of the filter's prefix or less then or equal to 32. If + this value is set to zero, the filter will not use the 'le' route matching + behavior. If the 'ge' value is non-zero the the 'le' value must between the + 'ge' value and 32, inclusive. + :param str prefix: (optional) The IPv4 Prefix to be matched by this filter. :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 `RouteReport` object + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_transit_gateway_route_report', + operation_id='update_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1661,17 +1792,240 @@ def get_transit_gateway_route_report( 'version': self.version, } + data = { + 'action': action, + 'before': before, + 'ge': ge, + 'le': le, + 'prefix': prefix, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + ######################### + # Transit Gateway Route Reports + ######################### + + def list_transit_gateway_route_reports( + self, + transit_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + List route reports. + + Retrieve all route reports for the specified Transit Gateway. There will normally + be at most one completed report and one pending report. Additionally, completed + route reports are written to IBM Cloud Activity Tracker. + + :param str transit_gateway_id: The Transit 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 `RouteReportCollection` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_transit_gateway_route_reports', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id'] + path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_transit_gateway_route_report( + self, + transit_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Request a route report. + + Request route report generation. While report generation is in progress, + additional requests to generate a report are ignored and return the current + pending report. + + :param str transit_gateway_id: The Transit 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 `RouteReport` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id'] + path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def delete_transit_gateway_route_report( + self, + transit_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete route report. + + Delete a route report. + + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: Route report identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + 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_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_transit_gateway_route_report( + self, + transit_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve route report. + + Retrieve a route report. + + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: Route report 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 `RouteReport` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + 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_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', url=url, headers=headers, params=params, @@ -1686,44 +2040,45 @@ def get_transit_gateway_route_report( ############################################################################## -class PaginationFirstConnection: +class GreTunnelZoneReference: """ - A reference to the first page of resources. + Location of GRE tunnel. This field only applies to network type 'gre_tunnel' + connections. - :attr str href: url. + :attr str name: Availability zone name. """ def __init__( self, - href: str, + name: str, ) -> None: """ - Initialize a PaginationFirstConnection object. + Initialize a GreTunnelZoneReference object. - :param str href: url. + :param str name: Availability zone name. """ - self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': - """Initialize a PaginationFirstConnection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GreTunnelZoneReference': + """Initialize a GreTunnelZoneReference object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') + raise ValueError('Required property \'name\' not present in GreTunnelZoneReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PaginationFirstConnection object from a json dictionary.""" + """Initialize a GreTunnelZoneReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -1731,21 +2086,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PaginationFirstConnection object.""" + """Return a `str` version of this GreTunnelZoneReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PaginationFirstConnection') -> bool: + def __eq__(self, other: 'GreTunnelZoneReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PaginationFirstConnection') -> bool: + def __ne__(self, other: 'GreTunnelZoneReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PaginationFirstTG: +class PaginationFirstConnection: """ A reference to the first page of resources. @@ -1757,25 +2112,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PaginationFirstTG object. + Initialize a PaginationFirstConnection object. :param str href: url. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': - """Initialize a PaginationFirstTG object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': + """Initialize a PaginationFirstConnection object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') + raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PaginationFirstTG object from a json dictionary.""" + """Initialize a PaginationFirstConnection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -1790,16 +2145,75 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PaginationFirstTG object.""" + """Return a `str` version of this PaginationFirstConnection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PaginationFirstTG') -> bool: + def __eq__(self, other: 'PaginationFirstConnection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PaginationFirstTG') -> bool: + def __ne__(self, other: 'PaginationFirstConnection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PaginationFirstTG: + """ + A reference to the first page of resources. + + :attr str href: url. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a PaginationFirstTG object. + + :param str href: url. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': + """Initialize a PaginationFirstTG object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PaginationFirstTG object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this PaginationFirstTG object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PaginationFirstTG') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'PaginationFirstTG') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -2463,45 +2877,52 @@ class ActionEnum(str, Enum): -class ResourceGroupIdentity: +class RedundantGRETunnelCollection: """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. + Collection of all tunnels for redundant gre connection. - :attr str id: The unique identifier for this resource group. + :attr List[RedundantGRETunnelReference] tunnels: Collection of all tunnels for + redundant gre connection. """ def __init__( self, - id: str, + tunnels: List['RedundantGRETunnelReference'], ) -> None: """ - Initialize a ResourceGroupIdentity object. + Initialize a RedundantGRETunnelCollection object. - :param str id: The unique identifier for this resource group. + :param List[RedundantGRETunnelReference] tunnels: Collection of all tunnels + for redundant gre connection. """ - self.id = id + self.tunnels = tunnels @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': - """Initialize a ResourceGroupIdentity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelCollection': + """Initialize a RedundantGRETunnelCollection object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'tunnels' in _dict: + args['tunnels'] = [RedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] else: - raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') + raise ValueError('Required property \'tunnels\' not present in RedundantGRETunnelCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupIdentity object from a json dictionary.""" + """Initialize a RedundantGRETunnelCollection 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, 'tunnels') and self.tunnels is not None: + tunnels_list = [] + for v in self.tunnels: + if isinstance(v, dict): + tunnels_list.append(v) + else: + tunnels_list.append(v.to_dict()) + _dict['tunnels'] = tunnels_list return _dict def _to_dict(self): @@ -2509,69 +2930,242 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupIdentity object.""" + """Return a `str` version of this RedundantGRETunnelCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupIdentity') -> bool: + def __eq__(self, other: 'RedundantGRETunnelCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ResourceGroupIdentity') -> bool: + def __ne__(self, other: 'RedundantGRETunnelCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResourceGroupReference: +class RedundantGRETunnelReference: """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. + Details for a redundant GRE tunnel. - :attr str id: The unique identifier for this resource group. - :attr str href: The URL for this resource group. + :attr str base_network_type: The type of network the redundant GRE tunnel is + targeting. + :attr datetime created_at: The date and time that this GRE tunnel was created. + :attr str id: The unique identifier for this redundant GRE tunnel. + :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the + tunnel is created. + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr int mtu: GRE tunnel MTU. + :attr str name: The user-defined name for this tunnel. + :attr str network_account_id: (optional) The ID of the account for cross account + Classic connections. This field is required when the GRE tunnel is in a + different account than the gateway and the base network is Classic. + :attr str network_id: (optional) The ID of the network VPC being connected via + this connection. + :attr int remote_bgp_asn: Remote network BGP ASN. The following ASN values are + reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, + 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' is omitted on + create requests, IBM will assign an ASN. + :attr str remote_gateway_ip: Remote gateway IP address. + :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr str status: Tunnel's current configuration state. 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 updated_at: The date and time that this tunnel was last updated. + :attr RgreTunnelZoneReference zone: The tunnel's location. The specified + availability zone must reside in the gateway's region. Use the IBM Cloud global + catalog to list zones within the desired region. """ def __init__( self, + base_network_type: str, + created_at: datetime, id: str, - href: str, + local_bgp_asn: int, + local_gateway_ip: str, + local_tunnel_ip: str, + mtu: int, + name: str, + remote_bgp_asn: int, + remote_gateway_ip: str, + remote_tunnel_ip: str, + status: str, + updated_at: datetime, + zone: 'RgreTunnelZoneReference', + *, + network_account_id: str = None, + network_id: str = None, ) -> None: """ - Initialize a ResourceGroupReference object. + Initialize a RedundantGRETunnelReference object. - :param str id: The unique identifier for this resource group. - :param str href: The URL for this resource group. + :param str base_network_type: The type of network the redundant GRE tunnel + is targeting. + :param datetime created_at: The date and time that this GRE tunnel was + created. + :param str id: The unique identifier for this redundant GRE tunnel. + :param int local_bgp_asn: Local network BGP ASN. It is assigned by IBM + when the tunnel is created. + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param int mtu: GRE tunnel MTU. + :param str name: The user-defined name for this tunnel. + :param int remote_bgp_asn: Remote network BGP ASN. The following ASN values + are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, + 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If + 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param str status: Tunnel's current configuration state. 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 updated_at: The date and time that this tunnel was last + updated. + :param RgreTunnelZoneReference zone: The tunnel's location. The specified + availability zone must reside in the gateway's region. Use the IBM Cloud + global catalog to list zones within the desired region. + :param str network_account_id: (optional) The ID of the account for cross + account Classic connections. This field is required when the GRE tunnel is + in a different account than the gateway and the base network is Classic. + :param str network_id: (optional) The ID of the network VPC being connected + via this connection. """ + self.base_network_type = base_network_type + self.created_at = created_at self.id = id - self.href = href + self.local_bgp_asn = local_bgp_asn + self.local_gateway_ip = local_gateway_ip + self.local_tunnel_ip = local_tunnel_ip + self.mtu = mtu + self.name = name + self.network_account_id = network_account_id + self.network_id = network_id + self.remote_bgp_asn = remote_bgp_asn + self.remote_gateway_ip = remote_gateway_ip + self.remote_tunnel_ip = remote_tunnel_ip + self.status = status + self.updated_at = updated_at + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': - """Initialize a ResourceGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelReference': + """Initialize a RedundantGRETunnelReference object from a json dictionary.""" args = {} + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + else: + raise ValueError('Required property \'base_network_type\' not present in RedundantGRETunnelReference JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in RedundantGRETunnelReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + raise ValueError('Required property \'id\' not present in RedundantGRETunnelReference JSON') + if 'local_bgp_asn' in _dict: + args['local_bgp_asn'] = _dict.get('local_bgp_asn') else: - raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') + raise ValueError('Required property \'local_bgp_asn\' not present in RedundantGRETunnelReference JSON') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') + else: + raise ValueError('Required property \'local_gateway_ip\' not present in RedundantGRETunnelReference JSON') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + else: + raise ValueError('Required property \'local_tunnel_ip\' not present in RedundantGRETunnelReference JSON') + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + else: + raise ValueError('Required property \'mtu\' not present in RedundantGRETunnelReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RedundantGRETunnelReference JSON') + if 'network_account_id' in _dict: + args['network_account_id'] = _dict.get('network_account_id') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + else: + raise ValueError('Required property \'remote_bgp_asn\' not present in RedundantGRETunnelReference JSON') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + else: + raise ValueError('Required property \'remote_gateway_ip\' not present in RedundantGRETunnelReference JSON') + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + else: + raise ValueError('Required property \'remote_tunnel_ip\' not present in RedundantGRETunnelReference JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in RedundantGRETunnelReference 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 RedundantGRETunnelReference JSON') + if 'zone' in _dict: + args['zone'] = RgreTunnelZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in RedundantGRETunnelReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupReference object from a json dictionary.""" + """Initialize a RedundantGRETunnelReference 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, 'base_network_type') and self.base_network_type is not None: + _dict['base_network_type'] = self.base_network_type + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'local_bgp_asn') and self.local_bgp_asn is not None: + _dict['local_bgp_asn'] = self.local_bgp_asn + if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: + _dict['local_gateway_ip'] = self.local_gateway_ip + if hasattr(self, 'local_tunnel_ip') and self.local_tunnel_ip is not None: + _dict['local_tunnel_ip'] = self.local_tunnel_ip + if hasattr(self, 'mtu') and self.mtu is not None: + _dict['mtu'] = self.mtu + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'network_account_id') and self.network_account_id is not None: + _dict['network_account_id'] = self.network_account_id + if hasattr(self, 'network_id') and self.network_id is not None: + _dict['network_id'] = self.network_id + if hasattr(self, 'remote_bgp_asn') and self.remote_bgp_asn is not None: + _dict['remote_bgp_asn'] = self.remote_bgp_asn + if hasattr(self, 'remote_gateway_ip') and self.remote_gateway_ip is not None: + _dict['remote_gateway_ip'] = self.remote_gateway_ip + if hasattr(self, 'remote_tunnel_ip') and self.remote_tunnel_ip is not None: + _dict['remote_tunnel_ip'] = self.remote_tunnel_ip + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -2579,53 +3173,269 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupReference object.""" + """Return a `str` version of this RedundantGRETunnelReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupReference') -> bool: + def __eq__(self, other: 'RedundantGRETunnelReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ResourceGroupReference') -> bool: + def __ne__(self, other: 'RedundantGRETunnelReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class BaseNetworkTypeEnum(str, Enum): + """ + The type of network the redundant GRE tunnel is targeting. + """ -class RouteReport: + CLASSIC = 'classic' + VPC = 'vpc' + + + class StatusEnum(str, Enum): + """ + Tunnel's current configuration state. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. + """ + + ATTACHED = 'attached' + FAILED = 'failed' + PENDING = 'pending' + DELETING = 'deleting' + DETACHING = 'detaching' + DETACHED = 'detached' + SUSPENDING = 'suspending' + SUSPENDED = 'suspended' + + + +class ResourceGroupIdentity: """ - route report. + The resource group to use. If unspecified, the account's [default resource + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr List[RouteReportConnection] connections: Array of connections with their - routes. - :attr datetime created_at: Date and time route report was requested. - :attr str id: Report identifier. - :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of - overlapping routes. - :attr str status: 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. - :attr datetime updated_at: (optional) Date and time route report was last - modified. + :attr str id: The unique identifier for this resource group. """ def __init__( self, - connections: List['RouteReportConnection'], - created_at: datetime, id: str, - overlapping_routes: List['RouteReportOverlappingRouteGroup'], - status: str, - *, - updated_at: datetime = None, ) -> None: """ - Initialize a RouteReport object. + Initialize a ResourceGroupIdentity object. - :param List[RouteReportConnection] connections: Array of connections with - their routes. - :param datetime created_at: Date and time route report was requested. + :param str id: The unique identifier for this resource group. + """ + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': + """Initialize a ResourceGroupIdentity object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResourceGroupIdentity 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 ResourceGroupIdentity object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceGroupIdentity') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResourceGroupIdentity') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResourceGroupReference: + """ + The resource group to use. If unspecified, the account's [default resource + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. + + :attr str href: The URL for this resource group. + :attr str id: The unique identifier for this resource group. + """ + + def __init__( + self, + href: str, + id: str, + ) -> None: + """ + Initialize a ResourceGroupReference object. + + :param str href: The URL for this resource group. + :param str id: The unique identifier for this resource group. + """ + self.href = href + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': + """Initialize a ResourceGroupReference object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResourceGroupReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResourceGroupReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceGroupReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResourceGroupReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RgreTunnelZoneReference: + """ + The tunnel's location. The specified availability zone must reside in the gateway's + region. Use the IBM Cloud global catalog to list zones within the desired region. + + :attr str name: Availability zone name. + """ + + def __init__( + self, + name: str, + ) -> None: + """ + Initialize a RgreTunnelZoneReference object. + + :param str name: Availability zone name. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RgreTunnelZoneReference': + """Initialize a RgreTunnelZoneReference object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RgreTunnelZoneReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RgreTunnelZoneReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RgreTunnelZoneReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RgreTunnelZoneReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RgreTunnelZoneReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RouteReport: + """ + route report. + + :attr List[RouteReportConnection] connections: Array of connections with their + routes. + :attr datetime created_at: Date and time route report was requested. + :attr str id: Report identifier. + :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of + overlapping routes. + :attr str status: 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. + :attr datetime updated_at: (optional) Date and time route report was last + modified. + """ + + def __init__( + self, + connections: List['RouteReportConnection'], + created_at: datetime, + id: str, + overlapping_routes: List['RouteReportOverlappingRouteGroup'], + status: str, + *, + updated_at: datetime = None, + ) -> None: + """ + Initialize a RouteReport object. + + :param List[RouteReportConnection] connections: Array of connections with + their routes. + :param datetime created_at: Date and time route report was requested. :param str id: Report identifier. :param List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of overlapping routes. @@ -3362,6 +4172,7 @@ class TSLocation: region, a single data center, or a point of presence. :attr List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. + :attr List[ZoneReferenceCollection] zones: List of valid zones for GRE tunnels. """ def __init__( @@ -3370,6 +4181,7 @@ def __init__( name: str, type: str, local_connection_locations: List['TSLocalLocation'], + zones: List['ZoneReferenceCollection'], ) -> None: """ Initialize a TSLocation object. @@ -3381,11 +4193,14 @@ def __init__( region, a single data center, or a point of presence. :param List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. + :param List[ZoneReferenceCollection] zones: List of valid zones for GRE + tunnels. """ self.billing_location = billing_location self.name = name self.type = type self.local_connection_locations = local_connection_locations + self.zones = zones @classmethod def from_dict(cls, _dict: Dict) -> 'TSLocation': @@ -3407,6 +4222,10 @@ def from_dict(cls, _dict: Dict) -> 'TSLocation': args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in _dict.get('local_connection_locations')] else: raise ValueError('Required property \'local_connection_locations\' not present in TSLocation JSON') + if 'zones' in _dict: + args['zones'] = [ZoneReferenceCollection.from_dict(v) for v in _dict.get('zones')] + else: + raise ValueError('Required property \'zones\' not present in TSLocation JSON') return cls(**args) @classmethod @@ -3431,6 +4250,14 @@ def to_dict(self) -> Dict: else: local_connection_locations_list.append(v.to_dict()) _dict['local_connection_locations'] = local_connection_locations_list + if hasattr(self, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list return _dict def _to_dict(self): @@ -3537,161 +4364,181 @@ def __ne__(self, other: 'TSLocationBasic') -> bool: class TransitConnection: """ - Transit gateway connection. - - :attr str base_connection_id: (optional) network_type 'gre_tunnel' connections - use 'base_connection_id' to specify the id of a network_type 'classic' - connection the tunnel is configured over. The specified connection must reside - in the same transit gateway and be in an active state. The 'classic' connection - cannot be deleted until any 'gre_tunnel' connections using it are deleted. This - field only applies to and is required for network type 'gre_tunnel' connections. + Connection included in transit gateway. + + :attr str base_network_type: (optional) The type of network the GRE tunnel is + targeting. + :attr str name: The user-defined name for this transit gateway connection. + :attr str network_id: (optional) The ID of the network being connected via this + connection. This field is required for some types, such as 'vpc', + 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types + 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the CRN + of the VPC / PowerVS / Direct Link gateway respectively. + :attr str network_type: Defines what type of network is connected via this + 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 id: The unique identifier for this Transit Gateway Connection. + :attr str base_connection_id: (optional) Deprecated: network_type 'gre_tunnel' + connections use 'base_connection_id' to specify the ID of a network_type + 'classic' connection the tunnel is configured over. The specified connection + must reside in the same transit gateway and be in an active state. The 'classic' + connection cannot be deleted until any 'gre_tunnel' connections using it are + deleted. This field only applies to and is required for network type + 'gre_tunnel' connections. :attr datetime created_at: The date and time that this connection was created. - :attr str id: The unique identifier for this connection. :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only - applies to network type 'gre_tunnel' connections. + applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str local_gateway_ip: (optional) Local gateway IP address. This field - only applies to network type 'gre_tunnel' connections. + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only - applies to network type 'gre_tunnel' connections. + applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network - type 'gre_tunnel' connections. - :attr str name: The user-defined name for this transit gateway connection. + type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. - :attr str network_id: (optional) The ID of the network being connected via this - connection. This field is required for some types, such as 'vpc', - 'power_virtual_server' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. - :attr str network_type: Defines what type of network is connected via this - 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 List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. - :attr str prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. + :attr str prefix_filters_default: (optional) Default setting of permit or deny + which applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only - applies to network type 'gre_tunnel' connections. + applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field - only applies to network type 'gre_tunnel' connections. + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field - only applies to network type 'gre_tunnel' connections. - :attr str request_status: (optional) Only visible for cross account connections, - this field represents the status of a connection request between IBM Cloud - accounts. 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 status: Connection state. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - :attr TransitGatewayReference transit_gateway: Reference to the transit gateway - that contains this connection. - :attr datetime updated_at: (optional) The date and time that this connection was - last updated. - :attr ZoneReference zone: (optional) Location of GRE tunnel. This field only - applies to network type 'gre_tunnel' connections. + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + :attr str request_status: Only visible for cross account connections, this field + represents the status of a connection request between IBM Cloud accounts. 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 status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + :attr TransitGatewayReference transit_gateway: Transit gateway reference. + :attr List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) + Collection of all tunnels for 'redundant_gre' connection. + :attr datetime updated_at: The date and time that this connection was last + updated. + :attr GreTunnelZoneReference zone: (optional) Location of GRE tunnel. This + field only applies to network type 'gre_tunnel' connections. """ def __init__( self, - created_at: datetime, - id: str, name: str, network_type: str, - prefix_filters_default: str, + id: str, + created_at: datetime, + request_status: str, status: str, transit_gateway: 'TransitGatewayReference', + updated_at: datetime, *, + base_network_type: str = None, + network_id: str = None, base_connection_id: str = None, local_bgp_asn: int = None, local_gateway_ip: str = None, local_tunnel_ip: str = None, mtu: int = None, network_account_id: str = None, - network_id: str = None, prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - request_status: str = None, - updated_at: datetime = None, - zone: 'ZoneReference' = None, + tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, + zone: 'GreTunnelZoneReference' = None, ) -> None: """ Initialize a TransitConnection object. - :param datetime created_at: The date and time that this connection was - created. - :param str id: The unique identifier for this connection. :param str name: The user-defined name for this transit gateway connection. :param str network_type: Defines what type of network is connected via this 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 prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. - :param str status: Connection state. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - :param TransitGatewayReference transit_gateway: Reference to the transit - gateway that contains this connection. - :param str base_connection_id: (optional) network_type 'gre_tunnel' - connections use 'base_connection_id' to specify the id of a network_type - 'classic' connection the tunnel is configured over. The specified - connection must reside in the same transit gateway and be in an active - state. The 'classic' connection cannot be deleted until any 'gre_tunnel' - connections using it are deleted. This field only applies to and is - required for network type 'gre_tunnel' connections. - :param int local_bgp_asn: (optional) Local network BGP ASN. This field - only applies to network type 'gre_tunnel' connections. - :param str local_gateway_ip: (optional) Local gateway IP address. This - field only applies to network type 'gre_tunnel' connections. - :param str local_tunnel_ip: (optional) Local tunnel IP address. This field - only applies to network type 'gre_tunnel' connections. - :param int mtu: (optional) GRE tunnel MTU. This field only applies to - network type 'gre_tunnel' connections. - :param str network_account_id: (optional) The ID of the account which owns - the connected network. Generally only used if the network is in a different - IBM Cloud account than the gateway. - :param str network_id: (optional) The ID of the network being connected via - this connection. This field is required for some types, such as 'vpc', - 'power_virtual_server' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + :param str id: The unique identifier for this Transit Gateway Connection. + :param datetime created_at: The date and time that this connection was + created. + :param str request_status: Only visible for cross account connections, this + field represents the status of a connection request between IBM Cloud + accounts. 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 status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param TransitGatewayReference transit_gateway: Transit gateway reference. + :param datetime updated_at: The date and time that this connection was last + updated. + :param str base_network_type: (optional) The type of network the GRE tunnel + is targeting. + :param str network_id: (optional) The ID of the network being connected via + this connection. This field is required for some types, such as 'vpc', + 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types + 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the + CRN of the VPC / PowerVS / Direct Link gateway respectively. + :param str base_connection_id: (optional) Deprecated: network_type + 'gre_tunnel' connections use 'base_connection_id' to specify the ID of a + network_type 'classic' connection the tunnel is configured over. The + specified connection must reside in the same transit gateway and be in an + active state. The 'classic' connection cannot be deleted until any + 'gre_tunnel' connections using it are deleted. This field only applies to + and is required for network type 'gre_tunnel' connections. + :param int local_bgp_asn: (optional) Local network BGP ASN. This field + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. + :param str local_gateway_ip: (optional) Local gateway IP address. This + field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. + :param str local_tunnel_ip: (optional) Local tunnel IP address. This field + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. + :param int mtu: (optional) GRE tunnel MTU. This field only applies to + network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + :param str network_account_id: (optional) The ID of the account which owns + the connected network. Generally only used if the network is in a different + IBM Cloud account than the gateway. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. + This field does not apply to the 'redundant_gre' network type. + :param str prefix_filters_default: (optional) Default setting of permit or + deny which applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field - only applies to network type 'gre_tunnel' connections. + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This - field only applies to network type 'gre_tunnel' connections. + field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This - field only applies to network type 'gre_tunnel' connections. - :param str request_status: (optional) Only visible for cross account - connections, this field represents the status of a connection request - between IBM Cloud accounts. 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 updated_at: (optional) The date and time that this - connection was last updated. - :param ZoneReference zone: (optional) Location of GRE tunnel. This field - only applies to network type 'gre_tunnel' connections. + field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. + :param List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) + Collection of all tunnels for 'redundant_gre' connection. + :param GreTunnelZoneReference zone: (optional) Location of GRE tunnel. + This field only applies to network type 'gre_tunnel' connections. """ + self.base_network_type = base_network_type + self.name = name + self.network_id = network_id + self.network_type = network_type + self.id = id self.base_connection_id = base_connection_id self.created_at = created_at - self.id = id self.local_bgp_asn = local_bgp_asn self.local_gateway_ip = local_gateway_ip self.local_tunnel_ip = local_tunnel_ip self.mtu = mtu - self.name = name self.network_account_id = network_account_id - self.network_id = network_id - self.network_type = network_type self.prefix_filters = prefix_filters self.prefix_filters_default = prefix_filters_default self.remote_bgp_asn = remote_bgp_asn @@ -3700,6 +4547,7 @@ def __init__( self.request_status = request_status self.status = status self.transit_gateway = transit_gateway + self.tunnels = tunnels self.updated_at = updated_at self.zone = zone @@ -3707,16 +4555,28 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnection': """Initialize a TransitConnection object from a json dictionary.""" args = {} + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in TransitConnection JSON') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'network_type' in _dict: + args['network_type'] = _dict.get('network_type') + else: + raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitConnection JSON') if 'base_connection_id' in _dict: args['base_connection_id'] = _dict.get('base_connection_id') 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 TransitConnection JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in TransitConnection JSON') if 'local_bgp_asn' in _dict: args['local_bgp_asn'] = _dict.get('local_bgp_asn') if 'local_gateway_ip' in _dict: @@ -3725,24 +4585,12 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') if 'mtu' in _dict: args['mtu'] = _dict.get('mtu') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in TransitConnection JSON') if 'network_account_id' in _dict: args['network_account_id'] = _dict.get('network_account_id') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'network_type' in _dict: - args['network_type'] = _dict.get('network_type') - else: - raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') if 'prefix_filters' in _dict: args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] if 'prefix_filters_default' in _dict: args['prefix_filters_default'] = _dict.get('prefix_filters_default') - else: - raise ValueError('Required property \'prefix_filters_default\' not present in TransitConnection JSON') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') if 'remote_gateway_ip' in _dict: @@ -3751,6 +4599,8 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') if 'request_status' in _dict: args['request_status'] = _dict.get('request_status') + else: + raise ValueError('Required property \'request_status\' not present in TransitConnection JSON') if 'status' in _dict: args['status'] = _dict.get('status') else: @@ -3759,10 +4609,14 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': args['transit_gateway'] = TransitGatewayReference.from_dict(_dict.get('transit_gateway')) else: raise ValueError('Required property \'transit_gateway\' not present in TransitConnection JSON') + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayRedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] 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 TransitConnection JSON') if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -3773,12 +4627,20 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'base_network_type') and self.base_network_type is not None: + _dict['base_network_type'] = self.base_network_type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'network_id') and self.network_id is not None: + _dict['network_id'] = self.network_id + if hasattr(self, 'network_type') and self.network_type is not None: + _dict['network_type'] = self.network_type + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'base_connection_id') and self.base_connection_id is not None: _dict['base_connection_id'] = self.base_connection_id if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id if hasattr(self, 'local_bgp_asn') and self.local_bgp_asn is not None: _dict['local_bgp_asn'] = self.local_bgp_asn if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: @@ -3787,14 +4649,8 @@ def to_dict(self) -> Dict: _dict['local_tunnel_ip'] = self.local_tunnel_ip if hasattr(self, 'mtu') and self.mtu is not None: _dict['mtu'] = self.mtu - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name if hasattr(self, 'network_account_id') and self.network_account_id is not None: _dict['network_account_id'] = self.network_account_id - if hasattr(self, 'network_id') and self.network_id is not None: - _dict['network_id'] = self.network_id - if hasattr(self, 'network_type') and self.network_type is not None: - _dict['network_type'] = self.network_type if hasattr(self, 'prefix_filters') and self.prefix_filters is not None: prefix_filters_list = [] for v in self.prefix_filters: @@ -3820,6 +4676,14 @@ def to_dict(self) -> Dict: _dict['transit_gateway'] = self.transit_gateway else: _dict['transit_gateway'] = self.transit_gateway.to_dict() + if hasattr(self, 'tunnels') and self.tunnels is not None: + tunnels_list = [] + for v in self.tunnels: + if isinstance(v, dict): + tunnels_list.append(v) + else: + tunnels_list.append(v.to_dict()) + _dict['tunnels'] = tunnels_list if hasattr(self, 'updated_at') and self.updated_at is not None: _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'zone') and self.zone is not None: @@ -3847,6 +4711,15 @@ def __ne__(self, other: 'TransitConnection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class BaseNetworkTypeEnum(str, Enum): + """ + The type of network the GRE tunnel is targeting. + """ + + CLASSIC = 'classic' + VPC = 'vpc' + + class NetworkTypeEnum(str, Enum): """ Defines what type of network is connected via this connection. The list of @@ -3860,12 +4733,14 @@ class NetworkTypeEnum(str, Enum): UNBOUND_GRE_TUNNEL = 'unbound_gre_tunnel' VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' + REDUNDANT_GRE = 'redundant_gre' class PrefixFiltersDefaultEnum(str, Enum): """ Default setting of permit or deny which applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. """ PERMIT = 'permit' @@ -3889,8 +4764,9 @@ class RequestStatusEnum(str, Enum): class StatusEnum(str, Enum): """ - Connection state. The list of enumerated values for this property may expand in - the future. Code and processes using this field must tolerate unexpected values. + Connection's current configuration state. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. """ ATTACHED = 'attached' @@ -4289,45 +5165,45 @@ class TransitGatewayConnectionCollection: :attr List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :attr PaginationFirstTGWConnection first: (optional) A reference to the first - page of resources. + :attr PaginationFirstTGWConnection first: A reference to the first page of + resources. This will be returned when number of connections in response are greater than max page limit. - :attr int limit: (optional) The maximum number of connections returned on one - request. This will be returned when number of connections in response are - greater than max page limit. + :attr int limit: The maximum number of connections returned on one request. This + will be returned when number of connections in response are greater than max + page limit. :attr PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :attr int total_count: (optional) total number of resources across all pages - (considering the supplied query parameter filters). + :attr int total_count: total number of resources across all pages (considering + the supplied query parameter filters). """ def __init__( self, connections: List['TransitGatewayConnectionCust'], + first: 'PaginationFirstTGWConnection', + limit: int, + total_count: int, *, - first: 'PaginationFirstTGWConnection' = None, - limit: int = None, next: 'PaginationNextTGWConnection' = None, - total_count: int = None, ) -> None: """ Initialize a TransitGatewayConnectionCollection object. :param List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :param PaginationFirstTGWConnection first: (optional) A reference to the - first page of resources. + :param PaginationFirstTGWConnection first: A reference to the first page of + resources. This will be returned when number of connections in response are greater than max page limit. - :param int limit: (optional) The maximum number of connections returned on - one request. This will be returned when number of connections in response - are greater than max page limit. + :param int limit: The maximum number of connections returned on one + request. This will be returned when number of connections in response are + greater than max page limit. + :param int total_count: total number of resources across all pages + (considering the supplied query parameter filters). :param PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :param int total_count: (optional) total number of resources across all - pages (considering the supplied query parameter filters). """ self.connections = connections self.first = first @@ -4345,12 +5221,18 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCollection': raise ValueError('Required property \'connections\' not present in TransitGatewayConnectionCollection JSON') if 'first' in _dict: args['first'] = PaginationFirstTGWConnection.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in TransitGatewayConnectionCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in TransitGatewayConnectionCollection JSON') if 'next' in _dict: args['next'] = PaginationNextTGWConnection.from_dict(_dict.get('next')) if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in TransitGatewayConnectionCollection JSON') return cls(**args) @classmethod @@ -4413,9 +5295,9 @@ class TransitGatewayConnectionCust: :attr str name: The user-defined name for this transit gateway connection. :attr str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as 'vpc', - 'power_virtual_server' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types + 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the CRN + of the VPC / PowerVS / Direct Link gateway respectively. :attr str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. @@ -4442,27 +5324,30 @@ class TransitGatewayConnectionCust: :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those - at the end of the array is applied last, or just before the default. - :attr str prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + at the end of the array is applied last, or just before the default. This field + does not apply to the 'redundant_gre' network type. + :attr str prefix_filters_default: (optional) Default setting of permit or deny + which applies to any routes that don't match a specified filter. This field does + not apply to the 'redundant_gre' network type. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. - :attr str request_status: (optional) Only visible for cross account connections, - this field represents the status of a connection request between IBM Cloud - accounts. 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 status: (optional) Connection's current configuration state. The list - of enumerated values for this property may expand in the future. Code and + :attr str request_status: Only visible for cross account connections, this field + represents the status of a connection request between IBM Cloud accounts. 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 updated_at: (optional) The date and time that this connection was - last updated. - :attr TransitGatewayConnectionCustZone zone: (optional) Location of GRE tunnel. - This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' - connections. + :attr str status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + :attr List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) + Collection of all tunnels for 'redundant_gre' connection. + :attr datetime updated_at: The date and time that this connection was last + updated. + :attr GreTunnelZoneReference zone: (optional) Location of GRE tunnel. This + field only applies to network type 'gre_tunnel' connections. """ def __init__( @@ -4471,7 +5356,9 @@ def __init__( network_type: str, id: str, created_at: datetime, - prefix_filters_default: str, + request_status: str, + status: str, + updated_at: datetime, *, base_network_type: str = None, network_id: str = None, @@ -4482,13 +5369,12 @@ def __init__( mtu: int = None, network_account_id: str = None, prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - request_status: str = None, - status: str = None, - updated_at: datetime = None, - zone: 'TransitGatewayConnectionCustZone' = None, + tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, + zone: 'GreTunnelZoneReference' = None, ) -> None: """ Initialize a TransitGatewayConnectionCust object. @@ -4501,15 +5387,23 @@ def __init__( :param str id: The unique identifier for this Transit Gateway Connection. :param datetime created_at: The date and time that this connection was created. - :param str prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + :param str request_status: Only visible for cross account connections, this + field represents the status of a connection request between IBM Cloud + accounts. 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 status: Connection's current configuration state. 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 updated_at: The date and time that this connection was last + updated. :param str base_network_type: (optional) The type of network the GRE tunnel is targeting. :param str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as 'vpc', - 'power_virtual_server' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types + 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the + CRN of the VPC / PowerVS / Direct Link gateway respectively. :param str base_connection_id: (optional) Deprecated: network_type 'gre_tunnel' connections use 'base_connection_id' to specify the ID of a network_type 'classic' connection the tunnel is configured over. The @@ -4535,7 +5429,10 @@ def __init__( (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the - default. + default. This field does not apply to the 'redundant_gre' network type. + :param str prefix_filters_default: (optional) Default setting of permit or + deny which applies to any routes that don't match a specified filter. This + field does not apply to the 'redundant_gre' network type. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. @@ -4545,19 +5442,10 @@ def __init__( :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. - :param str request_status: (optional) Only visible for cross account - connections, this field represents the status of a connection request - between IBM Cloud accounts. 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 status: (optional) Connection's current configuration state. 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 updated_at: (optional) The date and time that this - connection was last updated. - :param TransitGatewayConnectionCustZone zone: (optional) Location of GRE - tunnel. This field only applies to network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + :param List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) + Collection of all tunnels for 'redundant_gre' connection. + :param GreTunnelZoneReference zone: (optional) Location of GRE tunnel. + This field only applies to network type 'gre_tunnel' connections. """ self.base_network_type = base_network_type self.name = name @@ -4578,6 +5466,7 @@ def __init__( self.remote_tunnel_ip = remote_tunnel_ip self.request_status = request_status self.status = status + self.tunnels = tunnels self.updated_at = updated_at self.zone = zone @@ -4621,8 +5510,6 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] if 'prefix_filters_default' in _dict: args['prefix_filters_default'] = _dict.get('prefix_filters_default') - else: - raise ValueError('Required property \'prefix_filters_default\' not present in TransitGatewayConnectionCust JSON') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') if 'remote_gateway_ip' in _dict: @@ -4631,12 +5518,20 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') if 'request_status' in _dict: args['request_status'] = _dict.get('request_status') + else: + raise ValueError('Required property \'request_status\' not present in TransitGatewayConnectionCust JSON') if 'status' in _dict: args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in TransitGatewayConnectionCust JSON') + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayRedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] 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 TransitGatewayConnectionCust JSON') if 'zone' in _dict: - args['zone'] = TransitGatewayConnectionCustZone.from_dict(_dict.get('zone')) + args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -4691,6 +5586,14 @@ def to_dict(self) -> Dict: _dict['request_status'] = self.request_status if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + if hasattr(self, 'tunnels') and self.tunnels is not None: + tunnels_list = [] + for v in self.tunnels: + if isinstance(v, dict): + tunnels_list.append(v) + else: + tunnels_list.append(v.to_dict()) + _dict['tunnels'] = tunnels_list if hasattr(self, 'updated_at') and self.updated_at is not None: _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'zone') and self.zone is not None: @@ -4724,6 +5627,7 @@ class BaseNetworkTypeEnum(str, Enum): """ CLASSIC = 'classic' + VPC = 'vpc' class NetworkTypeEnum(str, Enum): @@ -4739,12 +5643,13 @@ class NetworkTypeEnum(str, Enum): UNBOUND_GRE_TUNNEL = 'unbound_gre_tunnel' VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' + REDUNDANT_GRE = 'redundant_gre' class PrefixFiltersDefaultEnum(str, Enum): """ Default setting of permit or deny which applies to any routes that don't match a - specified filter. + specified filter. This field does not apply to the 'redundant_gre' network type. """ PERMIT = 'permit' @@ -4785,45 +5690,71 @@ class StatusEnum(str, Enum): -class TransitGatewayConnectionCustZone: +class TransitGatewayConnectionPrefixFilter: """ - Location of GRE tunnel. This field only applies to network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + A prefix filter for a Transit Gateway connection. - :attr str name: Availability zone name. + :attr str action: Whether to permit or deny prefix filter. + :attr int ge: (optional) IP Prefix GE. + :attr int le: (optional) IP Prefix LE. + :attr str prefix: IP Prefix. """ def __init__( self, - name: str, + action: str, + prefix: str, + *, + ge: int = None, + le: int = None, ) -> None: """ - Initialize a TransitGatewayConnectionCustZone object. + Initialize a TransitGatewayConnectionPrefixFilter object. - :param str name: Availability zone name. + :param str action: Whether to permit or deny prefix filter. + :param str prefix: IP Prefix. + :param int ge: (optional) IP Prefix GE. + :param int le: (optional) IP Prefix LE. """ - self.name = name + self.action = action + self.ge = ge + self.le = le + self.prefix = prefix @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCustZone': - """Initialize a TransitGatewayConnectionCustZone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': + """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') + if 'ge' in _dict: + args['ge'] = _dict.get('ge') + if 'le' in _dict: + args['le'] = _dict.get('le') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') else: - raise ValueError('Required property \'name\' not present in TransitGatewayConnectionCustZone JSON') + raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionCustZone object from a json dictionary.""" + """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'ge') and self.ge is not None: + _dict['ge'] = self.ge + if hasattr(self, 'le') and self.le is not None: + _dict['le'] = self.le + if hasattr(self, 'prefix') and self.prefix is not None: + _dict['prefix'] = self.prefix return _dict def _to_dict(self): @@ -4831,72 +5762,147 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionCustZone object.""" + """Return a `str` version of this TransitGatewayConnectionPrefixFilter object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionCustZone') -> bool: + def __eq__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TransitGatewayConnectionCustZone') -> bool: + def __ne__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + Whether to permit or deny prefix filter. + """ + + PERMIT = 'permit' + DENY = 'deny' + -class TransitGatewayConnectionPrefixFilter: + +class TransitGatewayConnectionPrefixFilterReference: """ - A prefix filter for a Transit Gateway connection. + A prefix filter reference object for a Transit Gateway connection. :attr str action: Whether to permit or deny prefix filter. + :attr str before: (optional) Identifier of prefix filter that handles the + ordering and follow semantics: + - When a filter reference another filter in it's before field, then the filter + making the reference is applied before + the referenced filter. For example: if filter A references filter B in its + before field, A is applied before B. + - When a new filter is added that has the same before as an existing filter, + then the older filter will have its before + field updated to point to the new filter. Starting with the above example: if + filter C is added and it references B in its + before field, then A's before field should be modified to point to C, so the + order of application would be A, C and finally B. + - A filter that has an empty before reference will be applied last (though the + date order mentioned above will still apply). + So continuing the above examples, if filter B has an empty before field, then + it will be applied last, but if filter D + is created with an empty before field, then B's before field will be modified + to point to D, so B will be applied before D. + :attr datetime created_at: The date and time that this prefix filter was + created. :attr int ge: (optional) IP Prefix GE. + :attr str id: Prefix Filter identifier. :attr int le: (optional) IP Prefix LE. :attr str prefix: IP Prefix. + :attr datetime updated_at: (optional) The date and time that this prefix filter + was last updated. """ def __init__( self, action: str, + created_at: datetime, + id: str, prefix: str, *, + before: str = None, ge: int = None, le: int = None, + updated_at: datetime = None, ) -> None: """ - Initialize a TransitGatewayConnectionPrefixFilter object. + Initialize a TransitGatewayConnectionPrefixFilterReference object. :param str action: Whether to permit or deny prefix filter. + :param datetime created_at: The date and time that this prefix filter was + created. + :param str id: Prefix Filter identifier. :param str prefix: IP Prefix. + :param str before: (optional) Identifier of prefix filter that handles the + ordering and follow semantics: + - When a filter reference another filter in it's before field, then the + filter making the reference is applied before + the referenced filter. For example: if filter A references filter B in + its before field, A is applied before B. + - When a new filter is added that has the same before as an existing + filter, then the older filter will have its before + field updated to point to the new filter. Starting with the above + example: if filter C is added and it references B in its + before field, then A's before field should be modified to point to C, so + the order of application would be A, C and finally B. + - A filter that has an empty before reference will be applied last (though + the date order mentioned above will still apply). + So continuing the above examples, if filter B has an empty before field, + then it will be applied last, but if filter D + is created with an empty before field, then B's before field will be + modified to point to D, so B will be applied before D. :param int ge: (optional) IP Prefix GE. :param int le: (optional) IP Prefix LE. + :param datetime updated_at: (optional) The date and time that this prefix + filter was last updated. """ self.action = action + self.before = before + self.created_at = created_at self.ge = ge + self.id = id self.le = le self.prefix = prefix + self.updated_at = updated_at @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': - """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': + """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') + raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') if 'ge' in _dict: args['ge'] = _dict.get('ge') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') if 'le' in _dict: args['le'] = _dict.get('le') if 'prefix' in _dict: args['prefix'] = _dict.get('prefix') else: - raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') + raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" + """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -4904,12 +5910,237 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + _dict['before'] = self.before + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'ge') and self.ge is not None: _dict['ge'] = self.ge + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'le') and self.le is not None: _dict['le'] = self.le if hasattr(self, 'prefix') and self.prefix is not None: _dict['prefix'] = self.prefix + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this TransitGatewayConnectionPrefixFilterReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ActionEnum(str, Enum): + """ + Whether to permit or deny prefix filter. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + +class TransitGatewayRedundantGRETunnelReference: + """ + Details for a redundant GRE tunnel. + + :attr datetime created_at: The date and time that this GRE tunnel was created. + :attr str id: The unique identifier for this redundant GRE tunnel. + :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the + tunnel is created. + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr int mtu: GRE tunnel MTU. + :attr str name: The user-defined name for this tunnel. + :attr int remote_bgp_asn: Remote network BGP ASN. The following ASN values are + reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, + 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' is omitted on + create requests, IBM will assign an ASN. + :attr str remote_gateway_ip: Remote gateway IP address. + :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr str status: Tunnel's current configuration state. 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 updated_at: The date and time that this tunnel was last updated. + :attr RgreTunnelZoneReference zone: The tunnel's location. The specified + availability zone must reside in the gateway's region. Use the IBM Cloud global + catalog to list zones within the desired region. + """ + + def __init__( + self, + created_at: datetime, + id: str, + local_bgp_asn: int, + local_gateway_ip: str, + local_tunnel_ip: str, + mtu: int, + name: str, + remote_bgp_asn: int, + remote_gateway_ip: str, + remote_tunnel_ip: str, + status: str, + updated_at: datetime, + zone: 'RgreTunnelZoneReference', + ) -> None: + """ + Initialize a TransitGatewayRedundantGRETunnelReference object. + + :param datetime created_at: The date and time that this GRE tunnel was + created. + :param str id: The unique identifier for this redundant GRE tunnel. + :param int local_bgp_asn: Local network BGP ASN. It is assigned by IBM + when the tunnel is created. + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param int mtu: GRE tunnel MTU. + :param str name: The user-defined name for this tunnel. + :param int remote_bgp_asn: Remote network BGP ASN. The following ASN values + are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, + 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If + 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param str status: Tunnel's current configuration state. 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 updated_at: The date and time that this tunnel was last + updated. + :param RgreTunnelZoneReference zone: The tunnel's location. The specified + availability zone must reside in the gateway's region. Use the IBM Cloud + global catalog to list zones within the desired region. + """ + self.created_at = created_at + self.id = id + self.local_bgp_asn = local_bgp_asn + self.local_gateway_ip = local_gateway_ip + self.local_tunnel_ip = local_tunnel_ip + self.mtu = mtu + self.name = name + self.remote_bgp_asn = remote_bgp_asn + self.remote_gateway_ip = remote_gateway_ip + self.remote_tunnel_ip = remote_tunnel_ip + self.status = status + self.updated_at = updated_at + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TransitGatewayRedundantGRETunnelReference': + """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'local_bgp_asn' in _dict: + args['local_bgp_asn'] = _dict.get('local_bgp_asn') + else: + raise ValueError('Required property \'local_bgp_asn\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') + else: + raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + else: + raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + else: + raise ValueError('Required property \'mtu\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + else: + raise ValueError('Required property \'remote_bgp_asn\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + else: + raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + else: + raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in TransitGatewayRedundantGRETunnelReference 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 TransitGatewayRedundantGRETunnelReference JSON') + if 'zone' in _dict: + args['zone'] = RgreTunnelZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'local_bgp_asn') and self.local_bgp_asn is not None: + _dict['local_bgp_asn'] = self.local_bgp_asn + if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: + _dict['local_gateway_ip'] = self.local_gateway_ip + if hasattr(self, 'local_tunnel_ip') and self.local_tunnel_ip is not None: + _dict['local_tunnel_ip'] = self.local_tunnel_ip + if hasattr(self, 'mtu') and self.mtu is not None: + _dict['mtu'] = self.mtu + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_bgp_asn') and self.remote_bgp_asn is not None: + _dict['remote_bgp_asn'] = self.remote_bgp_asn + if hasattr(self, 'remote_gateway_ip') and self.remote_gateway_ip is not None: + _dict['remote_gateway_ip'] = self.remote_gateway_ip + if hasattr(self, 'remote_tunnel_ip') and self.remote_tunnel_ip is not None: + _dict['remote_tunnel_ip'] = self.remote_tunnel_ip + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -4917,168 +6148,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionPrefixFilter object.""" + """Return a `str` version of this TransitGatewayRedundantGRETunnelReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: + def __eq__(self, other: 'TransitGatewayRedundantGRETunnelReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: + def __ne__(self, other: 'TransitGatewayRedundantGRETunnelReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class StatusEnum(str, Enum): """ - Whether to permit or deny prefix filter. + Tunnel's current configuration state. 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' + ATTACHED = 'attached' + FAILED = 'failed' + PENDING = 'pending' + DELETING = 'deleting' + DETACHING = 'detaching' + DETACHED = 'detached' + SUSPENDING = 'suspending' + SUSPENDED = 'suspended' -class TransitGatewayConnectionPrefixFilterReference: +class TransitGatewayRedundantGRETunnelTemplate: """ - A prefix filter reference object for a Transit Gateway connection. - - :attr str action: Whether to permit or deny prefix filter. - :attr str before: (optional) Identifier of prefix filter that handles the - ordering and follow semantics: - - When a filter reference another filter in it's before field, then the filter - making the reference is applied before - the referenced filter. For example: if filter A references filter B in its - before field, A is applied before B. - - When a new filter is added that has the same before as an existing filter, - then the older filter will have its before - field updated to point to the new filter. Starting with the above example: if - filter C is added and it references B in its - before field, then A's before field should be modified to point to C, so the - order of application would be A, C and finally B. - - A filter that has an empty before reference will be applied last (though the - date order mentioned above will still apply). - So continuing the above examples, if filter B has an empty before field, then - it will be applied last, but if filter D - is created with an empty before field, then B's before field will be modified - to point to D, so B will be applied before D. - :attr datetime created_at: The date and time that this prefix filter was - created. - :attr int ge: (optional) IP Prefix GE. - :attr str id: Prefix Filter identifier. - :attr int le: (optional) IP Prefix LE. - :attr str prefix: IP Prefix. - :attr datetime updated_at: (optional) The date and time that this prefix filter - was last updated. + A create template with information for redundant GRE tunnel. + + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr str name: The user-defined name for this tunnel connection. + :attr int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN + values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, + 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' + is omitted on create requests, IBM will assign an ASN. + :attr str remote_gateway_ip: Remote gateway IP address. + :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. """ def __init__( self, - action: str, - created_at: datetime, - id: str, - prefix: str, + local_gateway_ip: str, + local_tunnel_ip: str, + name: str, + remote_gateway_ip: str, + remote_tunnel_ip: str, + zone: 'ZoneIdentity', *, - before: str = None, - ge: int = None, - le: int = None, - updated_at: datetime = None, + remote_bgp_asn: int = None, ) -> None: """ - Initialize a TransitGatewayConnectionPrefixFilterReference object. - - :param str action: Whether to permit or deny prefix filter. - :param datetime created_at: The date and time that this prefix filter was - created. - :param str id: Prefix Filter identifier. - :param str prefix: IP Prefix. - :param str before: (optional) Identifier of prefix filter that handles the - ordering and follow semantics: - - When a filter reference another filter in it's before field, then the - filter making the reference is applied before - the referenced filter. For example: if filter A references filter B in - its before field, A is applied before B. - - When a new filter is added that has the same before as an existing - filter, then the older filter will have its before - field updated to point to the new filter. Starting with the above - example: if filter C is added and it references B in its - before field, then A's before field should be modified to point to C, so - the order of application would be A, C and finally B. - - A filter that has an empty before reference will be applied last (though - the date order mentioned above will still apply). - So continuing the above examples, if filter B has an empty before field, - then it will be applied last, but if filter D - is created with an empty before field, then B's before field will be - modified to point to D, so B will be applied before D. - :param int ge: (optional) IP Prefix GE. - :param int le: (optional) IP Prefix LE. - :param datetime updated_at: (optional) The date and time that this prefix - filter was last updated. + Initialize a TransitGatewayRedundantGRETunnelTemplate object. + + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param str name: The user-defined name for this tunnel connection. + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip + and remote_tunnel_ip addresses must be in the same /30 network. Neither can + be the network nor broadcast addresses. + :param ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. + :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following + ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, + 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If + 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. """ - self.action = action - self.before = before - self.created_at = created_at - self.ge = ge - self.id = id - self.le = le - self.prefix = prefix - self.updated_at = updated_at + self.local_gateway_ip = local_gateway_ip + self.local_tunnel_ip = local_tunnel_ip + self.name = name + self.remote_bgp_asn = remote_bgp_asn + self.remote_gateway_ip = remote_gateway_ip + self.remote_tunnel_ip = remote_tunnel_ip + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': - """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayRedundantGRETunnelTemplate': + """Initialize a TransitGatewayRedundantGRETunnelTemplate object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: - raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: - raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'ge' in _dict: - args['ge'] = _dict.get('ge') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'le' in _dict: - args['le'] = _dict.get('le') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') else: - raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + else: + raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" + """Initialize a TransitGatewayRedundantGRETunnelTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'ge') and self.ge is not None: - _dict['ge'] = self.ge - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'le') and self.le is not None: - _dict['le'] = self.le - if hasattr(self, 'prefix') and self.prefix is not None: - _dict['prefix'] = self.prefix - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: + _dict['local_gateway_ip'] = self.local_gateway_ip + if hasattr(self, 'local_tunnel_ip') and self.local_tunnel_ip is not None: + _dict['local_tunnel_ip'] = self.local_tunnel_ip + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_bgp_asn') and self.remote_bgp_asn is not None: + _dict['remote_bgp_asn'] = self.remote_bgp_asn + if hasattr(self, 'remote_gateway_ip') and self.remote_gateway_ip is not None: + _dict['remote_gateway_ip'] = self.remote_gateway_ip + if hasattr(self, 'remote_tunnel_ip') and self.remote_tunnel_ip is not None: + _dict['remote_tunnel_ip'] = self.remote_tunnel_ip + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -5086,28 +6304,19 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionPrefixFilterReference object.""" + """Return a `str` version of this TransitGatewayRedundantGRETunnelTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + def __eq__(self, other: 'TransitGatewayRedundantGRETunnelTemplate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + def __ne__(self, other: 'TransitGatewayRedundantGRETunnelTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - Whether to permit or deny prefix filter. - """ - - PERMIT = 'permit' - DENY = 'deny' - - class TransitGatewayReference: """ @@ -5266,6 +6475,71 @@ def __ne__(self, other: 'ZoneReference') -> bool: return not self == other +class ZoneReferenceCollection: + """ + Collection of availability zones. + + :attr List[ZoneReference] zones: Array of valid zones for GRE tunnels. + """ + + def __init__( + self, + zones: List['ZoneReference'], + ) -> None: + """ + Initialize a ZoneReferenceCollection object. + + :param List[ZoneReference] zones: Array of valid zones for GRE tunnels. + """ + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ZoneReferenceCollection': + """Initialize a ZoneReferenceCollection object from a json dictionary.""" + args = {} + if 'zones' in _dict: + args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] + else: + raise ValueError('Required property \'zones\' not present in ZoneReferenceCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ZoneReferenceCollection 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, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ZoneReferenceCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ZoneReferenceCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ZoneReferenceCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ZoneIdentityByName(ZoneIdentity): """ Availability zone. diff --git a/ibm_cloud_networking_services/version.py b/ibm_cloud_networking_services/version.py index 5fd1ca3..603e936 100644 --- a/ibm_cloud_networking_services/version.py +++ b/ibm_cloud_networking_services/version.py @@ -1,4 +1,4 @@ """ Version of cloud_networking_services """ -__version__ = '0.24.0' +__version__ = '0.26.2' diff --git a/ibm_cloud_networking_services/zones_v1.py b/ibm_cloud_networking_services/zones_v1.py index b402bcb..88ebf19 100644 --- a/ibm_cloud_networking_services/zones_v1.py +++ b/ibm_cloud_networking_services/zones_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2020. +# (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,11 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +# IBM OpenAPI SDK Code Generator Version: 3.84.0-a4533f12-20240103-170852 + """ CIS Zones + +API Version: 1.0.1 """ -from typing import Dict, List +from typing import Dict, List, Optional import json from ibm_cloud_sdk_core import BaseService, DetailedResponse @@ -31,6 +35,7 @@ # Service ############################################################################## + class ZonesV1(BaseService): """The Zones V1 service.""" @@ -38,10 +43,11 @@ class ZonesV1(BaseService): DEFAULT_SERVICE_NAME = 'zones' @classmethod - def new_instance(cls, - crn: str, - service_name: str = DEFAULT_SERVICE_NAME, - ) -> 'ZonesV1': + def new_instance( + cls, + crn: str, + service_name: str = DEFAULT_SERVICE_NAME, + ) -> 'ZonesV1': """ Return a new client for the Zones service using the specified parameters and external configuration. @@ -59,69 +65,87 @@ def new_instance(cls, service.configure_service(service_name) return service - def __init__(self, - crn: str, - authenticator: Authenticator = None, - ) -> None: + def __init__( + self, + crn: str, + authenticator: Authenticator = None, + ) -> None: """ Construct a new client for the Zones service. :param str crn: Full url-encoded CRN of the service instance. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. - Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md + Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ if crn is None: raise ValueError('crn 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.crn = crn - ######################### # CIS Zones ######################### - - def list_zones(self, - **kwargs + def list_zones( + self, + *, + page: Optional[int] = None, + per_page: Optional[int] = None, + **kwargs, ) -> DetailedResponse: """ List all zones. List all zones for a service instance. + :param int page: (optional) Page number of paginated results. + :param int per_page: (optional) Maximum number of zones per page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ListZonesResp` object """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_zones') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_zones', + ) headers.update(sdk_headers) + params = { + 'page': page, + 'per_page': per_page, + } + if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones'.format( - *self.encode_path_vars(self.crn)) - request = self.prepare_request(method='GET', - url=url, - headers=headers) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn'] + path_param_values = self.encode_path_vars(self.crn) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) return response - - def create_zone(self, + def create_zone( + self, *, - name: str = None, - **kwargs + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs, ) -> DetailedResponse: """ Create zone. @@ -129,19 +153,23 @@ def create_zone(self, Add a new zone for a given service instance. :param str name: (optional) name. + :param str type: (optional) zone type. :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 `ZoneResp` object """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='create_zone') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_zone', + ) headers.update(sdk_headers) data = { - 'name': name + 'name': name, + 'type': type, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -149,21 +177,27 @@ def create_zone(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones'.format( - *self.encode_path_vars(self.crn)) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn'] + path_param_values = self.encode_path_vars(self.crn) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) return response - - def delete_zone(self, + def delete_zone( + self, zone_identifier: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete zone. @@ -176,30 +210,38 @@ def delete_zone(self, :rtype: DetailedResponse with `dict` result representing a `DeleteZoneResp` object """ - if zone_identifier is None: + if not zone_identifier: raise ValueError('zone_identifier must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_zone') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_zone', + ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones/{1}'.format( - *self.encode_path_vars(self.crn, zone_identifier)) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn', 'zone_identifier'] + path_param_values = self.encode_path_vars(self.crn, zone_identifier) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones/{zone_identifier}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) return response - - def get_zone(self, + def get_zone( + self, zone_identifier: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Get zone. @@ -212,32 +254,40 @@ def get_zone(self, :rtype: DetailedResponse with `dict` result representing a `ZoneResp` object """ - if zone_identifier is None: + if not zone_identifier: raise ValueError('zone_identifier must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_zone') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_zone', + ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones/{1}'.format( - *self.encode_path_vars(self.crn, zone_identifier)) - request = self.prepare_request(method='GET', - url=url, - headers=headers) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn', 'zone_identifier'] + path_param_values = self.encode_path_vars(self.crn, zone_identifier) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones/{zone_identifier}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) return response - - def update_zone(self, + def update_zone( + self, zone_identifier: str, *, - paused: bool = None, - **kwargs + paused: Optional[bool] = None, + **kwargs, ) -> DetailedResponse: """ Update zone. @@ -251,16 +301,18 @@ def update_zone(self, :rtype: DetailedResponse with `dict` result representing a `ZoneResp` object """ - if zone_identifier is None: + if not zone_identifier: raise ValueError('zone_identifier must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_zone') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_zone', + ) headers.update(sdk_headers) data = { - 'paused': paused + 'paused': paused, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -268,21 +320,27 @@ def update_zone(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones/{1}'.format( - *self.encode_path_vars(self.crn, zone_identifier)) - request = self.prepare_request(method='PATCH', - url=url, - headers=headers, - data=data) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn', 'zone_identifier'] + path_param_values = self.encode_path_vars(self.crn, zone_identifier) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones/{zone_identifier}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) return response - - def zone_activation_check(self, + def zone_activation_check( + self, zone_identifier: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Check zone. @@ -295,24 +353,32 @@ def zone_activation_check(self, :rtype: DetailedResponse with `dict` result representing a `ZoneActivationcheckResp` object """ - if zone_identifier is None: + if not zone_identifier: raise ValueError('zone_identifier must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='zone_activation_check') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='zone_activation_check', + ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) - - url = '/v1/{0}/zones/{1}/activation_check'.format( - *self.encode_path_vars(self.crn, zone_identifier)) - request = self.prepare_request(method='PUT', - url=url, - headers=headers) - - response = self.send(request) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['crn', 'zone_identifier'] + path_param_values = self.encode_path_vars(self.crn, zone_identifier) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/v1/{crn}/zones/{zone_identifier}/activation_check'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) return response @@ -321,15 +387,17 @@ def zone_activation_check(self, ############################################################################## -class DeleteZoneRespResult(): +class DeleteZoneRespResult: """ result. - :attr str id: id. + :param str id: id. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a DeleteZoneRespResult object. @@ -377,15 +445,18 @@ def __ne__(self, other: 'DeleteZoneRespResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneActivationcheckRespResult(): + +class ZoneActivationcheckRespResult: """ result. - :attr str id: id. + :param str id: id. """ - def __init__(self, - id: str) -> None: + def __init__( + self, + id: str, + ) -> None: """ Initialize a ZoneActivationcheckRespResult object. @@ -433,21 +504,24 @@ def __ne__(self, other: 'ZoneActivationcheckRespResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DeleteZoneResp(): + +class DeleteZoneResp: """ delete zone response. - :attr bool success: success. - :attr List[List[str]] errors: errors. - :attr List[List[str]] messages: messages. - :attr DeleteZoneRespResult result: result. + :param bool success: success. + :param List[List[str]] errors: errors. + :param List[List[str]] messages: messages. + :param DeleteZoneRespResult result: result. """ - def __init__(self, - success: bool, - errors: List[List[str]], - messages: List[List[str]], - result: 'DeleteZoneRespResult') -> None: + def __init__( + self, + success: bool, + errors: List[List[str]], + messages: List[List[str]], + result: 'DeleteZoneRespResult', + ) -> None: """ Initialize a DeleteZoneResp object. @@ -498,7 +572,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'messages') and self.messages is not None: _dict['messages'] = self.messages if hasattr(self, 'result') and self.result is not None: - _dict['result'] = self.result.to_dict() + if isinstance(self.result, dict): + _dict['result'] = self.result + else: + _dict['result'] = self.result.to_dict() return _dict def _to_dict(self): @@ -519,23 +596,26 @@ def __ne__(self, other: 'DeleteZoneResp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ListZonesResp(): + +class ListZonesResp: """ list zones response. - :attr bool success: success. - :attr List[List[str]] errors: errors. - :attr List[List[str]] messages: messages. - :attr List[ZoneDetails] result: zone list. - :attr ResultInfo result_info: result information. + :param bool success: success. + :param List[List[str]] errors: errors. + :param List[List[str]] messages: messages. + :param List[ZoneDetails] result: zone list. + :param ResultInfo result_info: result information. """ - def __init__(self, - success: bool, - errors: List[List[str]], - messages: List[List[str]], - result: List['ZoneDetails'], - result_info: 'ResultInfo') -> None: + def __init__( + self, + success: bool, + errors: List[List[str]], + messages: List[List[str]], + result: List['ZoneDetails'], + result_info: 'ResultInfo', + ) -> None: """ Initialize a ListZonesResp object. @@ -568,7 +648,7 @@ def from_dict(cls, _dict: Dict) -> 'ListZonesResp': else: raise ValueError('Required property \'messages\' not present in ListZonesResp JSON') if 'result' in _dict: - args['result'] = [ZoneDetails.from_dict(x) for x in _dict.get('result')] + args['result'] = [ZoneDetails.from_dict(v) for v in _dict.get('result')] else: raise ValueError('Required property \'result\' not present in ListZonesResp JSON') if 'result_info' in _dict: @@ -592,9 +672,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'messages') and self.messages is not None: _dict['messages'] = self.messages if hasattr(self, 'result') and self.result is not None: - _dict['result'] = [x.to_dict() for x in self.result] + result_list = [] + for v in self.result: + if isinstance(v, dict): + result_list.append(v) + else: + result_list.append(v.to_dict()) + _dict['result'] = result_list if hasattr(self, 'result_info') and self.result_info is not None: - _dict['result_info'] = self.result_info.to_dict() + if isinstance(self.result_info, dict): + _dict['result_info'] = self.result_info + else: + _dict['result_info'] = self.result_info.to_dict() return _dict def _to_dict(self): @@ -615,21 +704,24 @@ def __ne__(self, other: 'ListZonesResp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResultInfo(): + +class ResultInfo: """ result information. - :attr int page: page. - :attr int per_page: per page. - :attr int count: count. - :attr int total_count: total count. + :param int page: page. + :param int per_page: per page. + :param int count: count. + :param int total_count: total count. """ - def __init__(self, - page: int, - per_page: int, - count: int, - total_count: int) -> None: + def __init__( + self, + page: int, + per_page: int, + count: int, + total_count: int, + ) -> None: """ Initialize a ResultInfo object. @@ -701,21 +793,24 @@ def __ne__(self, other: 'ResultInfo') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneActivationcheckResp(): + +class ZoneActivationcheckResp: """ zone activation check response. - :attr bool success: success. - :attr List[List[str]] errors: errors. - :attr List[List[str]] messages: messages. - :attr ZoneActivationcheckRespResult result: result. + :param bool success: success. + :param List[List[str]] errors: errors. + :param List[List[str]] messages: messages. + :param ZoneActivationcheckRespResult result: result. """ - def __init__(self, - success: bool, - errors: List[List[str]], - messages: List[List[str]], - result: 'ZoneActivationcheckRespResult') -> None: + def __init__( + self, + success: bool, + errors: List[List[str]], + messages: List[List[str]], + result: 'ZoneActivationcheckRespResult', + ) -> None: """ Initialize a ZoneActivationcheckResp object. @@ -766,7 +861,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'messages') and self.messages is not None: _dict['messages'] = self.messages if hasattr(self, 'result') and self.result is not None: - _dict['result'] = self.result.to_dict() + if isinstance(self.result, dict): + _dict['result'] = self.result + else: + _dict['result'] = self.result.to_dict() return _dict def _to_dict(self): @@ -787,34 +885,43 @@ def __ne__(self, other: 'ZoneActivationcheckResp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneDetails(): + +class ZoneDetails: """ zone details. - :attr str id: (optional) id. - :attr str created_on: (optional) created date. - :attr str modified_on: (optional) modified date. - :attr str name: (optional) name. - :attr str original_registrar: (optional) original registrar. - :attr str original_dnshost: (optional) orginal dns host. - :attr str status: (optional) status. - :attr bool paused: (optional) paused. - :attr List[str] original_name_servers: (optional) orginal name servers. - :attr List[str] name_servers: (optional) name servers. + :param str id: (optional) id. + :param str created_on: (optional) created date. + :param str modified_on: (optional) modified date. + :param str name: (optional) name. + :param str original_registrar: (optional) original registrar. + :param str original_dnshost: (optional) orginal dns host. + :param str status: (optional) status. + :param bool paused: (optional) paused. + :param List[str] original_name_servers: (optional) orginal name servers. + :param List[str] name_servers: (optional) name servers. + :param str type: (optional) zone type. + :param str verification_key: (optional) verification key. + :param str cname_suffix: (optional) canme suffix. """ - def __init__(self, - *, - id: str = None, - created_on: str = None, - modified_on: str = None, - name: str = None, - original_registrar: str = None, - original_dnshost: str = None, - status: str = None, - paused: bool = None, - original_name_servers: List[str] = None, - name_servers: List[str] = None) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + created_on: Optional[str] = None, + modified_on: Optional[str] = None, + name: Optional[str] = None, + original_registrar: Optional[str] = None, + original_dnshost: Optional[str] = None, + status: Optional[str] = None, + paused: Optional[bool] = None, + original_name_servers: Optional[List[str]] = None, + name_servers: Optional[List[str]] = None, + type: Optional[str] = None, + verification_key: Optional[str] = None, + cname_suffix: Optional[str] = None, + ) -> None: """ Initialize a ZoneDetails object. @@ -828,6 +935,9 @@ def __init__(self, :param bool paused: (optional) paused. :param List[str] original_name_servers: (optional) orginal name servers. :param List[str] name_servers: (optional) name servers. + :param str type: (optional) zone type. + :param str verification_key: (optional) verification key. + :param str cname_suffix: (optional) canme suffix. """ self.id = id self.created_on = created_on @@ -839,6 +949,9 @@ def __init__(self, self.paused = paused self.original_name_servers = original_name_servers self.name_servers = name_servers + self.type = type + self.verification_key = verification_key + self.cname_suffix = cname_suffix @classmethod def from_dict(cls, _dict: Dict) -> 'ZoneDetails': @@ -864,6 +977,12 @@ def from_dict(cls, _dict: Dict) -> 'ZoneDetails': args['original_name_servers'] = _dict.get('original_name_servers') if 'name_servers' in _dict: args['name_servers'] = _dict.get('name_servers') + if 'type' in _dict: + args['type'] = _dict.get('type') + if 'verification_key' in _dict: + args['verification_key'] = _dict.get('verification_key') + if 'cname_suffix' in _dict: + args['cname_suffix'] = _dict.get('cname_suffix') return cls(**args) @classmethod @@ -894,6 +1013,12 @@ def to_dict(self) -> Dict: _dict['original_name_servers'] = self.original_name_servers if hasattr(self, 'name_servers') and self.name_servers is not None: _dict['name_servers'] = self.name_servers + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'verification_key') and self.verification_key is not None: + _dict['verification_key'] = self.verification_key + if hasattr(self, 'cname_suffix') and self.cname_suffix is not None: + _dict['cname_suffix'] = self.cname_suffix return _dict def _to_dict(self): @@ -914,21 +1039,24 @@ def __ne__(self, other: 'ZoneDetails') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ZoneResp(): + +class ZoneResp: """ zone response. - :attr bool success: success. - :attr List[List[str]] errors: errors. - :attr List[List[str]] messages: messages. - :attr ZoneDetails result: zone details. + :param bool success: success. + :param List[List[str]] errors: errors. + :param List[List[str]] messages: messages. + :param ZoneDetails result: zone details. """ - def __init__(self, - success: bool, - errors: List[List[str]], - messages: List[List[str]], - result: 'ZoneDetails') -> None: + def __init__( + self, + success: bool, + errors: List[List[str]], + messages: List[List[str]], + result: 'ZoneDetails', + ) -> None: """ Initialize a ZoneResp object. @@ -979,7 +1107,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'messages') and self.messages is not None: _dict['messages'] = self.messages if hasattr(self, 'result') and self.result is not None: - _dict['result'] = self.result.to_dict() + if isinstance(self.result, dict): + _dict['result'] = self.result + else: + _dict['result'] = self.result.to_dict() return _dict def _to_dict(self): diff --git a/package-lock.json b/package-lock.json index a9cbcb9..4455eb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,31 +13,32 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -138,9 +139,9 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", - "integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==" }, "node_modules/@octokit/plugin-paginate-rest": { "version": "6.1.2", @@ -274,6 +275,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "license": "MIT", "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -288,21 +290,21 @@ } }, "node_modules/@semantic-release/commit-analyzer": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-10.0.1.tgz", - "integrity": "sha512-9ejHzTAijYs9z246sY/dKBatmOPcd0GQ7lH4MgLCkv1q4GCiDZRkjHJkaQZXZVaK7mJybS+sH3Ng6G8i3pYMGQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.1.0.tgz", + "integrity": "sha512-cXNTbv3nXR2hlzHjAMgbuiQVtvWHTlwwISt60B+4NZv01y/QRY7p2HcJm8Eh2StzcTJoNnflvKjHH/cjFS7d5g==", "peer": true, "dependencies": { - "conventional-changelog-angular": "^6.0.0", - "conventional-commits-filter": "^3.0.0", - "conventional-commits-parser": "^4.0.0", + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", "debug": "^4.0.0", - "import-from": "^4.0.0", + "import-from-esm": "^1.0.3", "lodash-es": "^4.17.21", "micromatch": "^4.0.2" }, "engines": { - "node": ">=18" + "node": "^18.17 || >=20.6.1" }, "peerDependencies": { "semantic-release": ">=20.1.0" @@ -320,6 +322,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/@semantic-release/exec/-/exec-6.0.3.tgz", "integrity": "sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ==", + "license": "MIT", "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -339,6 +342,7 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", + "license": "MIT", "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -360,6 +364,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.1.0.tgz", "integrity": "sha512-erR9E5rpdsz0dW1I7785JtndQuMWN/iDcemcptf67tBNOmBUN0b2YNOgcjYUnBpgRpZ5ozfBHrK7Bz+2ets/Dg==", + "license": "MIT", "dependencies": { "@octokit/core": "^4.2.1", "@octokit/plugin-paginate-rest": "^6.1.2", @@ -387,27 +392,27 @@ } }, "node_modules/@semantic-release/npm": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-10.0.4.tgz", - "integrity": "sha512-6R3timIQ7VoL2QWRkc9DG8v74RQtRp7UOe/2KbNaqwJ815qOibAv65bH3RtTEhs4axEaHoZf7HDgFs5opaZ9Jw==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-11.0.3.tgz", + "integrity": "sha512-KUsozQGhRBAnoVg4UMZj9ep436VEGwT536/jwSqB7vcEfA6oncCUU7UIYTRdLx7GvTtqn0kBjnkfLVkcnBa2YQ==", "peer": true, "dependencies": { "@semantic-release/error": "^4.0.0", - "aggregate-error": "^4.0.1", - "execa": "^7.0.0", + "aggregate-error": "^5.0.0", + "execa": "^8.0.0", "fs-extra": "^11.0.0", "lodash-es": "^4.17.21", "nerf-dart": "^1.0.0", "normalize-url": "^8.0.0", - "npm": "^9.5.0", + "npm": "^10.5.0", "rc": "^1.2.8", - "read-pkg": "^8.0.0", + "read-pkg": "^9.0.0", "registry-auth-token": "^5.0.0", "semver": "^7.1.2", "tempy": "^3.0.0" }, "engines": { - "node": ">=18" + "node": "^18.17 || >=20" }, "peerDependencies": { "semantic-release": ">=20.1.0" @@ -423,31 +428,31 @@ } }, "node_modules/@semantic-release/npm/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "peer": true, "dependencies": { - "clean-stack": "^4.0.0", + "clean-stack": "^5.2.0", "indent-string": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@semantic-release/npm/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "peer": true, "dependencies": { "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -466,35 +471,47 @@ } }, "node_modules/@semantic-release/npm/node_modules/execa": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz", - "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "peer": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/@semantic-release/npm/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@semantic-release/npm/node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "peer": true, "engines": { - "node": ">=14.18.0" + "node": ">=16.17.0" } }, "node_modules/@semantic-release/npm/node_modules/indent-string": { @@ -534,9 +551,9 @@ } }, "node_modules/@semantic-release/npm/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "peer": true, "dependencies": { "path-key": "^4.0.0" @@ -575,6 +592,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@semantic-release/npm/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -588,24 +617,24 @@ } }, "node_modules/@semantic-release/release-notes-generator": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-11.0.4.tgz", - "integrity": "sha512-j0Znnwq9IdWTCGzqSlkLv4MpALTsVDZxcVESzJCNN8pK2BYQlYaKsdZ1Ea/+7RlppI3vjhEi33ZKmjSGY1FLKw==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-12.1.0.tgz", + "integrity": "sha512-g6M9AjUKAZUZnxaJZnouNBeDNTCUrJ5Ltj+VJ60gJeDaRRahcHsry9HW8yKrnKkKNkx5lbWiEP1FPMqVNQz8Kg==", "peer": true, "dependencies": { - "conventional-changelog-angular": "^6.0.0", - "conventional-changelog-writer": "^6.0.0", - "conventional-commits-filter": "^3.0.0", - "conventional-commits-parser": "^4.0.0", + "conventional-changelog-angular": "^7.0.0", + "conventional-changelog-writer": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", "debug": "^4.0.0", "get-stream": "^7.0.0", - "import-from": "^4.0.0", + "import-from-esm": "^1.0.3", "into-stream": "^7.0.0", "lodash-es": "^4.17.21", - "read-pkg-up": "^10.0.0" + "read-pkg-up": "^11.0.0" }, "engines": { - "node": ">=18" + "node": "^18.17 || >=20.6.1" }, "peerDependencies": { "semantic-release": ">=20.1.0" @@ -623,16 +652,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "peer": true + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "peer": true }, "node_modules/agent-base": { @@ -693,10 +740,10 @@ "node": ">=4" } }, - "node_modules/ansicolors": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==", + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "peer": true }, "node_modules/argparse": { @@ -725,15 +772,6 @@ "node": ">=8" } }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", @@ -745,11 +783,11 @@ "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -764,64 +802,163 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "engines": { "node": ">=6" } }, - "node_modules/camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cli-highlight/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "peer": true, "dependencies": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/cardinal": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", - "integrity": "sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==", + "node_modules/cli-highlight/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "peer": true, "dependencies": { - "ansicolors": "~0.3.2", - "redeyed": "~2.1.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, - "bin": { - "cdl": "bin/cdl.js" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cli-highlight/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" }, "engines": { - "node": ">=4" + "node": ">=7.0.0" } }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "node_modules/cli-highlight/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "peer": true + }, + "node_modules/cli-highlight/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "peer": true, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "peer": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "peer": true, + "engines": { + "node": ">=10" } }, "node_modules/cli-table3": { @@ -887,67 +1024,62 @@ } }, "node_modules/conventional-changelog-angular": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", - "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", "peer": true, "dependencies": { "compare-func": "^2.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-writer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.1.tgz", - "integrity": "sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz", + "integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==", "peer": true, "dependencies": { - "conventional-commits-filter": "^3.0.0", - "dateformat": "^3.0.3", + "conventional-commits-filter": "^4.0.0", "handlebars": "^4.7.7", "json-stringify-safe": "^5.0.1", - "meow": "^8.1.2", - "semver": "^7.0.0", - "split": "^1.0.1" + "meow": "^12.0.1", + "semver": "^7.5.2", + "split2": "^4.0.0" }, "bin": { - "conventional-changelog-writer": "cli.js" + "conventional-changelog-writer": "cli.mjs" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-commits-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", - "integrity": "sha512-1ymej8b5LouPx9Ox0Dw/qAO2dVdfpRFq28e5Y0jJEU8ZrLdy0vOSkkIInwmxErFGhg6SALro60ZrwYFVTUDo4Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz", + "integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==", "peer": true, - "dependencies": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.1" - }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-commits-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", - "integrity": "sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", "peer": true, "dependencies": { - "is-text-path": "^1.0.1", + "is-text-path": "^2.0.0", "JSONStream": "^1.3.5", - "meow": "^8.1.2", - "split2": "^3.2.2" + "meow": "^12.0.1", + "split2": "^4.0.0" }, "bin": { - "conventional-commits-parser": "cli.js" + "conventional-commits-parser": "cli.mjs" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/core-util-is": { @@ -957,21 +1089,29 @@ "peer": true }, "node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", "peer": true, "dependencies": { - "import-fresh": "^3.2.1", + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" + "parse-json": "^5.2.0" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/cross-spawn": { @@ -1014,15 +1154,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "peer": true, - "engines": { - "node": "*" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1039,40 +1170,6 @@ } } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", - "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", - "peer": true, - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -1125,49 +1222,67 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "peer": true }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "peer": true + }, "node_modules/env-ci": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-9.1.1.tgz", - "integrity": "sha512-Im2yEWeF4b2RAMAaWvGioXk6m0UNaIjD8hj28j2ij5ldnIFrDQT0+pzDvpbRkcjurhXhf/AsBKv8P2rtmGi9Aw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.0.0.tgz", + "integrity": "sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==", "peer": true, "dependencies": { - "execa": "^7.0.0", + "execa": "^8.0.0", "java-properties": "^1.0.2" }, "engines": { - "node": "^16.14 || >=18" + "node": "^18.17 || >=20.6.1" } }, "node_modules/env-ci/node_modules/execa": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz", - "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "peer": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/env-ci/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/env-ci/node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "peer": true, "engines": { - "node": ">=14.18.0" + "node": ">=16.17.0" } }, "node_modules/env-ci/node_modules/is-stream": { @@ -1195,9 +1310,9 @@ } }, "node_modules/env-ci/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "peer": true, "dependencies": { "path-key": "^4.0.0" @@ -1236,18 +1351,39 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/env-ci/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/env-ci/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "peer": true, "engines": { - "node": ">=12" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "peer": true, + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1257,9 +1393,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "peer": true, "engines": { "node": ">=6" @@ -1273,19 +1409,6 @@ "node": ">=0.8.0" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -1309,9 +1432,9 @@ } }, "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1324,45 +1447,32 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", + "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", "peer": true, "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=14" + "is-unicode-supported": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "peer": true, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1371,16 +1481,24 @@ } }, "node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "peer": true, "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" + "locate-path": "^2.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=4" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "peer": true, + "engines": { + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1412,9 +1530,9 @@ } }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1425,10 +1543,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "peer": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -1509,13 +1630,13 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "peer": true, "dependencies": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "wordwrap": "^1.0.0" }, @@ -1529,33 +1650,33 @@ "uglify-js": "^3.1.4" } }, - "node_modules/hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "peer": true, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "peer": true, "dependencies": { - "function-bind": "^1.1.1" + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "peer": true, "engines": { - "node": ">=4" + "node": "*" } }, "node_modules/hook-std": { @@ -1571,15 +1692,15 @@ } }, "node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", "peer": true, "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/http-cache-semantics": { @@ -1588,9 +1709,9 @@ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" @@ -1600,9 +1721,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz", - "integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -1620,9 +1741,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } @@ -1652,16 +1773,27 @@ "node": ">=4" } }, - "node_modules/import-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", - "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", + "node_modules/import-from-esm": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.3.tgz", + "integrity": "sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==", "peer": true, - "engines": { - "node": ">=12.2" + "dependencies": { + "debug": "^4.3.4", + "import-meta-resolve": "^4.0.0" }, + "engines": { + "node": ">=16.20" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "peer": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/indent-string": { @@ -1672,6 +1804,18 @@ "node": ">=8" } }, + "node_modules/index-to-position": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1706,12 +1850,12 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "peer": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1762,15 +1906,6 @@ "node": ">=8" } }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -1791,24 +1926,24 @@ } }, "node_modules/is-text-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", "peer": true, "dependencies": { - "text-extensions": "^1.0.0" + "text-extensions": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", + "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", "peer": true, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1919,15 +2054,6 @@ "node": "*" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -1962,18 +2088,16 @@ } }, "node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "peer": true, "dependencies": { - "p-locate": "^6.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/lodash": { @@ -1997,12 +2121,6 @@ "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==" }, - "node_modules/lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", - "peer": true - }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -2019,30 +2137,18 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==" }, "node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "peer": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "peer": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "14 || >=16.14" } }, "node_modules/marked": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-5.1.1.tgz", - "integrity": "sha512-bTmmGdEINWmOMDjnPWDxGPQ4qkDLeYorpYbEtFOXzOruTwUE671q4Guiuchn4N8h/v6NGd7916kXsm3Iz4iUSg==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", + "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", "peer": true, "bin": { "marked": "bin/marked.js" @@ -2052,23 +2158,23 @@ } }, "node_modules/marked-terminal": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.2.0.tgz", - "integrity": "sha512-Piv6yNwAQXGFjZSaiNljyNFw7jKDdGrw70FSbtxEyldLsyeuV5ZHm/1wW++kWbrOF1VPnUgYOhB2oLL0ZpnekA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.0.0.tgz", + "integrity": "sha512-sNEx8nn9Ktcm6pL0TnRz8tnXq/mSS0Q1FRSwJOAqw4lAB4l49UeDf85Gm1n9RPFm5qurCPjwi1StAQT2XExhZw==", "peer": true, "dependencies": { "ansi-escapes": "^6.2.0", - "cardinal": "^2.1.1", - "chalk": "^5.2.0", + "chalk": "^5.3.0", + "cli-highlight": "^2.1.11", "cli-table3": "^0.6.3", - "node-emoji": "^1.11.0", - "supports-hyperlinks": "^2.3.0" + "node-emoji": "^2.1.3", + "supports-hyperlinks": "^3.0.0" }, "engines": { - "node": ">=14.13.1 || >=16.0.0" + "node": ">=16.0.0" }, "peerDependencies": { - "marked": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" + "marked": ">=1 <13" } }, "node_modules/marked-terminal/node_modules/chalk": { @@ -2084,175 +2190,12 @@ } }, "node_modules/meow": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", - "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", - "peer": true, - "dependencies": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.18.0", - "yargs-parser": "^20.2.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/meow/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "peer": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "peer": true - }, - "node_modules/meow/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "peer": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "peer": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/meow/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "peer": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "peer": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "peer": true, - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "peer": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/meow/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "peer": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/meow/node_modules/type-fest": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", - "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "peer": true, "engines": { - "node": ">=10" + "node": ">=16.10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2302,15 +2245,6 @@ "node": ">=6" } }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -2320,34 +2254,22 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "peer": true, - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/modify-values": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "peer": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -2361,18 +2283,24 @@ "peer": true }, "node_modules/node-emoji": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", - "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", "peer": true, "dependencies": { - "lodash": "^4.17.21" + "@sindresorhus/is": "^4.6.0", + "char-regex": "^1.0.2", + "emojilib": "^2.4.0", + "skin-tone": "^2.0.0" + }, + "engines": { + "node": ">=18" } }, "node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -2389,42 +2317,18 @@ } }, "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "peer": true, - "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-package-data/node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "peer": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-package-data/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", "peer": true, "dependencies": { - "yallist": "^4.0.0" + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=10" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/normalize-url": { @@ -2440,16 +2344,20 @@ } }, "node_modules/npm": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-9.8.0.tgz", - "integrity": "sha512-AXeiBAdfM5K2jvBwA7EGLKeYyt0VnhmJRnlq4k2+M0Ao9v7yKJBqF8xFPzQL8kAybzwlfpTPCZwM4uTIszb3xA==", + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.5.2.tgz", + "integrity": "sha512-cHVG7QEJwJdZyOrK0dKX5uf3R5Fd0E8AcmSES1jLtO52UT1enUKZ96Onw/xwq4CbrTZEnDuu2Vf9kCQh/Sd12w==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", "@npmcli/config", + "@npmcli/fs", "@npmcli/map-workspaces", "@npmcli/package-json", + "@npmcli/promise-spawn", + "@npmcli/redact", "@npmcli/run-script", + "@sigstore/tuf", "abbrev", "archy", "cacache", @@ -2485,6 +2393,7 @@ "ms", "node-gyp", "nopt", + "normalize-package-data", "npm-audit-report", "npm-install-checks", "npm-package-arg", @@ -2500,7 +2409,7 @@ "qrcode-terminal", "read", "semver", - "sigstore", + "spdx-expression-parse", "ssri", "supports-color", "tar", @@ -2514,70 +2423,75 @@ "peer": true, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.3.0", - "@npmcli/config": "^6.2.1", - "@npmcli/map-workspaces": "^3.0.4", - "@npmcli/package-json": "^4.0.0", - "@npmcli/run-script": "^6.0.2", + "@npmcli/arborist": "^7.2.1", + "@npmcli/config": "^8.0.2", + "@npmcli/fs": "^3.1.0", + "@npmcli/map-workspaces": "^3.0.6", + "@npmcli/package-json": "^5.0.2", + "@npmcli/promise-spawn": "^7.0.1", + "@npmcli/redact": "^1.1.0", + "@npmcli/run-script": "^7.0.4", + "@sigstore/tuf": "^2.3.2", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.1.3", - "chalk": "^5.2.0", - "ci-info": "^3.8.0", + "cacache": "^18.0.2", + "chalk": "^5.3.0", + "ci-info": "^4.0.0", "cli-columns": "^4.0.0", - "cli-table3": "^0.6.3", + "cli-table3": "^0.6.4", "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", - "fs-minipass": "^3.0.2", - "glob": "^10.2.7", + "fs-minipass": "^3.0.3", + "glob": "^10.3.12", "graceful-fs": "^4.2.11", - "hosted-git-info": "^6.1.1", - "ini": "^4.1.1", - "init-package-json": "^5.0.0", - "is-cidr": "^4.0.2", - "json-parse-even-better-errors": "^3.0.0", - "libnpmaccess": "^7.0.2", - "libnpmdiff": "^5.0.19", - "libnpmexec": "^6.0.2", - "libnpmfund": "^4.0.19", - "libnpmhook": "^9.0.3", - "libnpmorg": "^5.0.4", - "libnpmpack": "^5.0.19", - "libnpmpublish": "^7.5.0", - "libnpmsearch": "^6.0.2", - "libnpmteam": "^5.0.3", - "libnpmversion": "^4.0.2", - "make-fetch-happen": "^11.1.1", - "minimatch": "^9.0.0", - "minipass": "^5.0.0", + "hosted-git-info": "^7.0.1", + "ini": "^4.1.2", + "init-package-json": "^6.0.2", + "is-cidr": "^5.0.5", + "json-parse-even-better-errors": "^3.0.1", + "libnpmaccess": "^8.0.1", + "libnpmdiff": "^6.0.3", + "libnpmexec": "^7.0.4", + "libnpmfund": "^5.0.1", + "libnpmhook": "^10.0.0", + "libnpmorg": "^6.0.1", + "libnpmpack": "^6.0.3", + "libnpmpublish": "^9.0.2", + "libnpmsearch": "^7.0.0", + "libnpmteam": "^6.0.0", + "libnpmversion": "^5.0.1", + "make-fetch-happen": "^13.0.0", + "minimatch": "^9.0.4", + "minipass": "^7.0.4", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", - "node-gyp": "^9.4.0", + "node-gyp": "^10.1.0", "nopt": "^7.2.0", + "normalize-package-data": "^6.0.0", "npm-audit-report": "^5.0.0", - "npm-install-checks": "^6.1.1", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.1", - "npm-profile": "^7.0.1", - "npm-registry-fetch": "^14.0.5", + "npm-install-checks": "^6.3.0", + "npm-package-arg": "^11.0.1", + "npm-pick-manifest": "^9.0.0", + "npm-profile": "^9.0.0", + "npm-registry-fetch": "^16.2.0", "npm-user-validate": "^2.0.0", "npmlog": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^15.2.0", + "pacote": "^17.0.6", "parse-conflict-json": "^3.0.1", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", - "read": "^2.1.0", - "semver": "^7.5.2", - "sigstore": "^1.7.0", - "ssri": "^10.0.4", - "supports-color": "^9.3.1", - "tar": "^6.1.15", + "read": "^3.0.1", + "semver": "^7.6.0", + "spdx-expression-parse": "^4.0.0", + "ssri": "^10.0.5", + "supports-color": "^9.4.0", + "tar": "^6.2.1", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^3.0.0", "validate-npm-package-name": "^5.0.0", - "which": "^3.0.1", + "which": "^4.0.0", "write-file-atomic": "^5.0.1" }, "bin": { @@ -2585,7 +2499,7 @@ "npx": "bin/npx-cli.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm-run-path": { @@ -2682,8 +2596,24 @@ "license": "ISC", "peer": true }, + "node_modules/npm/node_modules/@npmcli/agent": { + "version": "2.2.2", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "6.3.0", + "version": "7.4.2", "inBundle": true, "license": "ISC", "peer": true, @@ -2692,33 +2622,34 @@ "@npmcli/fs": "^3.1.0", "@npmcli/installed-package-contents": "^2.0.2", "@npmcli/map-workspaces": "^3.0.2", - "@npmcli/metavuln-calculator": "^5.0.0", + "@npmcli/metavuln-calculator": "^7.0.0", "@npmcli/name-from-folder": "^2.0.0", "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^4.0.0", - "@npmcli/query": "^3.0.0", - "@npmcli/run-script": "^6.0.0", + "@npmcli/package-json": "^5.0.0", + "@npmcli/query": "^3.1.0", + "@npmcli/redact": "^1.1.0", + "@npmcli/run-script": "^7.0.2", "bin-links": "^4.0.1", - "cacache": "^17.0.4", + "cacache": "^18.0.0", "common-ancestor-path": "^1.0.1", - "hosted-git-info": "^6.1.1", + "hosted-git-info": "^7.0.1", "json-parse-even-better-errors": "^3.0.0", "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", + "minimatch": "^9.0.4", "nopt": "^7.0.0", - "npm-install-checks": "^6.0.0", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.1", - "npm-registry-fetch": "^14.0.3", + "npm-install-checks": "^6.2.0", + "npm-package-arg": "^11.0.1", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.2.0", "npmlog": "^7.0.1", - "pacote": "^15.0.8", + "pacote": "^17.0.4", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.2", + "promise-call-limit": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", - "ssri": "^10.0.1", + "ssri": "^10.0.5", "treeverse": "^3.0.0", "walk-up-path": "^3.0.1" }, @@ -2726,18 +2657,18 @@ "arborist": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "6.2.1", + "version": "8.2.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "@npmcli/map-workspaces": "^3.0.2", - "ci-info": "^3.8.0", - "ini": "^4.1.0", + "ci-info": "^4.0.0", + "ini": "^4.1.2", "nopt": "^7.0.0", "proc-log": "^3.0.0", "read-package-json-fast": "^3.0.2", @@ -2745,7 +2676,7 @@ "walk-up-path": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/disparity-colors": { @@ -2760,6 +2691,21 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles": { + "version": "4.3.0", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.0", "inBundle": true, @@ -2773,22 +2719,22 @@ } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "4.1.0", + "version": "5.0.5", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", "proc-log": "^3.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { @@ -2808,7 +2754,7 @@ } }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { - "version": "3.0.4", + "version": "3.0.6", "inBundle": true, "license": "ISC", "peer": true, @@ -2823,18 +2769,18 @@ } }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "5.0.1", + "version": "7.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "cacache": "^17.0.0", + "cacache": "^18.0.0", "json-parse-even-better-errors": "^3.0.0", - "pacote": "^15.0.0", + "pacote": "^17.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { @@ -2856,36 +2802,37 @@ } }, "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "4.0.0", + "version": "5.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/git": "^4.1.0", + "@npmcli/git": "^5.0.0", "glob": "^10.2.2", + "hosted-git-info": "^7.0.0", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.1", - "proc-log": "^3.0.0" + "normalize-package-data": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.5.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", + "version": "7.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/query": { - "version": "3.0.0", + "version": "3.1.0", "inBundle": true, "license": "ISC", "peer": true, @@ -2896,20 +2843,29 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@npmcli/redact": { + "version": "1.1.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "6.0.2", + "version": "7.0.4", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@pkgjs/parseargs": { @@ -2922,104 +2878,119 @@ "node": ">=14" } }, - "node_modules/npm/node_modules/@sigstore/protobuf-specs": { - "version": "0.1.0", + "node_modules/npm/node_modules/@sigstore/bundle": { + "version": "2.3.1", "inBundle": true, "license": "Apache-2.0", "peer": true, + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.1" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "1.0.2", + "node_modules/npm/node_modules/@sigstore/core": { + "version": "1.1.0", "inBundle": true, "license": "Apache-2.0", "peer": true, - "dependencies": { - "@sigstore/protobuf-specs": "^0.1.0", - "tuf-js": "^1.1.7" - }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@tootallnate/once": { - "version": "2.0.0", + "node_modules/npm/node_modules/@sigstore/protobuf-specs": { + "version": "0.3.1", "inBundle": true, - "license": "MIT", + "license": "Apache-2.0", "peer": true, "engines": { - "node": ">= 10" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@tufjs/canonical-json": { - "version": "1.0.0", + "node_modules/npm/node_modules/@sigstore/sign": { + "version": "2.3.0", "inBundle": true, - "license": "MIT", + "license": "Apache-2.0", "peer": true, + "dependencies": { + "@sigstore/bundle": "^2.3.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.1", + "make-fetch-happen": "^13.0.0" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@tufjs/models": { - "version": "1.0.4", + "node_modules/npm/node_modules/@sigstore/tuf": { + "version": "2.3.2", "inBundle": true, - "license": "MIT", + "license": "Apache-2.0", "peer": true, "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" + "@sigstore/protobuf-specs": "^0.3.0", + "tuf-js": "^2.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/abbrev": { - "version": "2.0.0", + "node_modules/npm/node_modules/@sigstore/verify": { + "version": "1.2.0", "inBundle": true, - "license": "ISC", + "license": "Apache-2.0", "peer": true, + "dependencies": { + "@sigstore/bundle": "^2.3.1", + "@sigstore/core": "^1.1.0", + "@sigstore/protobuf-specs": "^0.3.1" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/abort-controller": { - "version": "3.0.0", + "node_modules/npm/node_modules/@tufjs/canonical-json": { + "version": "2.0.0", "inBundle": true, "license": "MIT", "peer": true, - "dependencies": { - "event-target-shim": "^5.0.0" - }, "engines": { - "node": ">=6.5" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/agent-base": { - "version": "6.0.2", + "node_modules/npm/node_modules/@tufjs/models": { + "version": "2.0.0", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "debug": "4" + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.3" }, "engines": { - "node": ">= 6.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/agentkeepalive": { - "version": "4.3.0", + "node_modules/npm/node_modules/abbrev": { + "version": "2.0.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/agent-base": { + "version": "7.1.1", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "debug": "^4.1.0", - "depd": "^2.0.0", - "humanize-ms": "^1.2.1" + "debug": "^4.3.4" }, "engines": { - "node": ">= 8.0.0" + "node": ">= 14" } }, "node_modules/npm/node_modules/aggregate-error": { @@ -3045,15 +3016,12 @@ } }, "node_modules/npm/node_modules/ansi-styles": { - "version": "4.3.0", + "version": "6.2.1", "inBundle": true, "license": "MIT", "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -3072,14 +3040,10 @@ "peer": true }, "node_modules/npm/node_modules/are-we-there-yet": { - "version": "4.0.0", + "version": "4.0.2", "inBundle": true, "license": "ISC", "peer": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^4.1.0" - }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -3090,28 +3054,8 @@ "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/base64-js": { - "version": "1.5.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT", - "peer": true - }, "node_modules/npm/node_modules/bin-links": { - "version": "4.0.1", + "version": "4.0.3", "inBundle": true, "license": "ISC", "peer": true, @@ -3126,12 +3070,15 @@ } }, "node_modules/npm/node_modules/binary-extensions": { - "version": "2.2.0", + "version": "2.3.0", "inBundle": true, "license": "MIT", "peer": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/brace-expansion": { @@ -3143,32 +3090,8 @@ "balanced-match": "^1.0.0" } }, - "node_modules/npm/node_modules/buffer": { - "version": "6.0.3", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/npm/node_modules/builtins": { - "version": "5.0.1", + "version": "5.1.0", "inBundle": true, "license": "MIT", "peer": true, @@ -3177,7 +3100,7 @@ } }, "node_modules/npm/node_modules/cacache": { - "version": "17.1.3", + "version": "18.0.2", "inBundle": true, "license": "ISC", "peer": true, @@ -3185,9 +3108,9 @@ "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", "glob": "^10.2.2", - "lru-cache": "^7.7.1", - "minipass": "^5.0.0", - "minipass-collect": "^1.0.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "p-map": "^4.0.0", @@ -3196,11 +3119,11 @@ "unique-filename": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/chalk": { - "version": "5.2.0", + "version": "5.3.0", "inBundle": true, "license": "MIT", "peer": true, @@ -3221,7 +3144,7 @@ } }, "node_modules/npm/node_modules/ci-info": { - "version": "3.8.0", + "version": "4.0.0", "funding": [ { "type": "github", @@ -3236,15 +3159,15 @@ } }, "node_modules/npm/node_modules/cidr-regex": { - "version": "3.1.1", + "version": "4.0.5", "inBundle": true, "license": "BSD-2-Clause", "peer": true, "dependencies": { - "ip-regex": "^4.1.0" + "ip-regex": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/npm/node_modules/clean-stack": { @@ -3270,7 +3193,7 @@ } }, "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.3", + "version": "0.6.4", "inBundle": true, "license": "MIT", "peer": true, @@ -3294,7 +3217,7 @@ } }, "node_modules/npm/node_modules/cmd-shim": { - "version": "6.0.1", + "version": "6.0.2", "inBundle": true, "license": "ISC", "peer": true, @@ -3348,12 +3271,6 @@ "license": "ISC", "peer": true }, - "node_modules/npm/node_modules/concat-map": { - "version": "0.0.1", - "inBundle": true, - "license": "MIT", - "peer": true - }, "node_modules/npm/node_modules/console-control-strings": { "version": "1.1.0", "inBundle": true, @@ -3436,23 +3353,8 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm/node_modules/delegates": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/depd": { - "version": "2.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/npm/node_modules/diff": { - "version": "5.1.0", + "node_modules/npm/node_modules/diff": { + "version": "5.2.0", "inBundle": true, "license": "BSD-3-Clause", "peer": true, @@ -3497,24 +3399,6 @@ "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/event-target-shim": { - "version": "5.0.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/npm/node_modules/events": { - "version": "3.3.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", "inBundle": true, @@ -3547,28 +3431,25 @@ } }, "node_modules/npm/node_modules/fs-minipass": { - "version": "3.0.2", + "version": "3.0.3", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/fs.realpath": { - "version": "1.0.0", - "inBundle": true, - "license": "ISC", - "peer": true - }, "node_modules/npm/node_modules/function-bind": { - "version": "1.1.1", + "version": "1.1.2", "inBundle": true, "license": "MIT", - "peer": true + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/npm/node_modules/gauge": { "version": "5.0.1", @@ -3590,19 +3471,19 @@ } }, "node_modules/npm/node_modules/glob": { - "version": "10.2.7", + "version": "10.3.12", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.7.0" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { - "glob": "dist/cjs/src/bin.js" + "glob": "dist/esm/bin.mjs" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -3617,34 +3498,34 @@ "license": "ISC", "peer": true }, - "node_modules/npm/node_modules/has": { - "version": "1.0.3", + "node_modules/npm/node_modules/has-unicode": { + "version": "2.0.1", + "inBundle": true, + "license": "ISC", + "peer": true + }, + "node_modules/npm/node_modules/hasown": { + "version": "2.0.2", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "function-bind": "^1.1.1" + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" } }, - "node_modules/npm/node_modules/has-unicode": { - "version": "2.0.1", - "inBundle": true, - "license": "ISC", - "peer": true - }, "node_modules/npm/node_modules/hosted-git-info": { - "version": "6.1.1", + "version": "7.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/http-cache-semantics": { @@ -3654,39 +3535,29 @@ "peer": true }, "node_modules/npm/node_modules/http-proxy-agent": { - "version": "5.0.0", + "version": "7.0.2", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/npm/node_modules/https-proxy-agent": { - "version": "5.0.1", + "version": "7.0.4", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/npm/node_modules/humanize-ms": { - "version": "1.2.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "^2.0.0" + "node": ">= 14" } }, "node_modules/npm/node_modules/iconv-lite": { @@ -3702,28 +3573,8 @@ "node": ">=0.10.0" } }, - "node_modules/npm/node_modules/ieee754": { - "version": "1.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "BSD-3-Clause", - "peer": true - }, "node_modules/npm/node_modules/ignore-walk": { - "version": "6.0.3", + "version": "6.0.4", "inBundle": true, "license": "ISC", "peer": true, @@ -3752,24 +3603,8 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/inflight": { - "version": "1.0.6", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/npm/node_modules/inherits": { - "version": "2.0.4", - "inBundle": true, - "license": "ISC", - "peer": true - }, "node_modules/npm/node_modules/ini": { - "version": "4.1.1", + "version": "4.1.2", "inBundle": true, "license": "ISC", "peer": true, @@ -3778,57 +3613,73 @@ } }, "node_modules/npm/node_modules/init-package-json": { - "version": "5.0.0", + "version": "6.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-package-arg": "^10.0.0", + "@npmcli/package-json": "^5.0.0", + "npm-package-arg": "^11.0.0", "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^6.0.0", + "read": "^3.0.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/ip": { - "version": "2.0.0", + "node_modules/npm/node_modules/ip-address": { + "version": "9.0.5", "inBundle": true, "license": "MIT", + "peer": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/npm/node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "inBundle": true, + "license": "BSD-3-Clause", "peer": true }, "node_modules/npm/node_modules/ip-regex": { - "version": "4.3.0", + "version": "5.0.0", "inBundle": true, "license": "MIT", "peer": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/is-cidr": { - "version": "4.0.2", + "version": "5.0.5", "inBundle": true, "license": "BSD-2-Clause", "peer": true, "dependencies": { - "cidr-regex": "^3.1.1" + "cidr-regex": "^4.0.4" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/npm/node_modules/is-core-module": { - "version": "2.12.1", + "version": "2.13.1", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3856,7 +3707,7 @@ "peer": true }, "node_modules/npm/node_modules/jackspeak": { - "version": "2.2.1", + "version": "2.3.6", "inBundle": true, "license": "BlueOak-1.0.0", "peer": true, @@ -3873,8 +3724,14 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/npm/node_modules/jsbn": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "peer": true + }, "node_modules/npm/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", + "version": "3.0.1", "inBundle": true, "license": "MIT", "peer": true, @@ -3913,210 +3770,206 @@ "peer": true }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "7.0.2", + "version": "8.0.3", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3" + "npm-package-arg": "^11.0.1", + "npm-registry-fetch": "^16.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "5.0.19", + "version": "6.0.9", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^6.3.0", + "@npmcli/arborist": "^7.2.1", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.2", - "binary-extensions": "^2.2.0", + "binary-extensions": "^2.3.0", "diff": "^5.1.0", - "minimatch": "^9.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8", - "tar": "^6.1.13" + "minimatch": "^9.0.4", + "npm-package-arg": "^11.0.1", + "pacote": "^17.0.4", + "tar": "^6.2.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "6.0.2", + "version": "7.0.10", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^6.3.0", - "@npmcli/run-script": "^6.0.0", - "ci-info": "^3.7.1", - "npm-package-arg": "^10.1.0", + "@npmcli/arborist": "^7.2.1", + "@npmcli/run-script": "^7.0.2", + "ci-info": "^4.0.0", + "npm-package-arg": "^11.0.1", "npmlog": "^7.0.1", - "pacote": "^15.0.8", + "pacote": "^17.0.4", "proc-log": "^3.0.0", - "read": "^2.0.0", + "read": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "walk-up-path": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "4.0.19", + "version": "5.0.7", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^6.3.0" + "@npmcli/arborist": "^7.2.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "9.0.3", + "version": "10.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "5.0.4", + "version": "6.0.3", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "5.0.19", + "version": "6.0.9", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^6.3.0", - "@npmcli/run-script": "^6.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8" + "@npmcli/arborist": "^7.2.1", + "@npmcli/run-script": "^7.0.2", + "npm-package-arg": "^11.0.1", + "pacote": "^17.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "7.5.0", + "version": "9.0.5", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "ci-info": "^3.6.1", - "normalize-package-data": "^5.0.0", - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3", + "ci-info": "^4.0.0", + "normalize-package-data": "^6.0.0", + "npm-package-arg": "^11.0.1", + "npm-registry-fetch": "^16.2.0", "proc-log": "^3.0.0", "semver": "^7.3.7", - "sigstore": "^1.4.0", - "ssri": "^10.0.1" + "sigstore": "^2.2.0", + "ssri": "^10.0.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "6.0.2", + "version": "7.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "5.0.3", + "version": "6.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "4.0.2", + "version": "5.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/git": "^4.0.1", - "@npmcli/run-script": "^6.0.0", + "@npmcli/git": "^5.0.3", + "@npmcli/run-script": "^7.0.2", "json-parse-even-better-errors": "^3.0.0", "proc-log": "^3.0.0", "semver": "^7.3.7" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/lru-cache": { - "version": "7.18.3", + "version": "10.2.0", "inBundle": true, "license": "ISC", "peer": true, "engines": { - "node": ">=12" + "node": "14 || >=16.14" } }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "11.1.1", + "version": "13.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^17.0.0", + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", "http-cache-semantics": "^4.1.1", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^5.0.0", + "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", "ssri": "^10.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/minimatch": { - "version": "9.0.1", + "version": "9.0.4", "inBundle": true, "license": "ISC", "peer": true, @@ -4131,45 +3984,33 @@ } }, "node_modules/npm/node_modules/minipass": { - "version": "5.0.0", + "version": "7.0.4", "inBundle": true, "license": "ISC", "peer": true, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/npm/node_modules/minipass-collect": { - "version": "1.0.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/minipass-collect/node_modules/minipass": { - "version": "3.3.6", + "version": "2.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "yallist": "^4.0.0" + "minipass": "^7.0.3" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "3.0.3", + "version": "3.0.4", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "minipass": "^5.0.0", + "minipass": "^7.0.3", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -4336,173 +4177,27 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "9.4.0", + "version": "10.1.0", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", - "glob": "^7.1.4", + "glob": "^10.3.10", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^11.0.3", - "nopt": "^6.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", "semver": "^7.3.5", "tar": "^6.1.2", - "which": "^2.0.2" + "which": "^4.0.0" }, "bin": { "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^12.13 || ^14.13 || >=16" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/abbrev": { - "version": "1.1.1", - "inBundle": true, - "license": "ISC", - "peer": true - }, - "node_modules/npm/node_modules/node-gyp/node_modules/are-we-there-yet": { - "version": "3.0.1", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/brace-expansion": { - "version": "1.1.11", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { - "version": "4.0.4", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/glob": { - "version": "7.2.3", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/minimatch": { - "version": "3.1.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/nopt": { - "version": "6.0.0", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "abbrev": "^1.0.0" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/npmlog": { - "version": "6.0.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/readable-stream": { - "version": "3.6.2", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/signal-exit": { - "version": "3.0.7", - "inBundle": true, - "license": "ISC", - "peer": true - }, - "node_modules/npm/node_modules/node-gyp/node_modules/which": { - "version": "2.0.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/nopt": { @@ -4521,18 +4216,18 @@ } }, "node_modules/npm/node_modules/normalize-package-data": { - "version": "5.0.0", + "version": "6.0.0", "inBundle": true, "license": "BSD-2-Clause", "peer": true, "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-audit-report": { @@ -4557,7 +4252,7 @@ } }, "node_modules/npm/node_modules/npm-install-checks": { - "version": "6.1.1", + "version": "6.3.0", "inBundle": true, "license": "BSD-2-Clause", "peer": true, @@ -4578,76 +4273,77 @@ } }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "10.1.0", + "version": "11.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "proc-log": "^3.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-packlist": { - "version": "7.0.4", + "version": "8.0.2", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "ignore-walk": "^6.0.0" + "ignore-walk": "^6.0.4" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "8.0.1", + "version": "9.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "npm-install-checks": "^6.0.0", "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-profile": { - "version": "7.0.1", + "version": "9.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-registry-fetch": "^14.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "14.0.5", + "version": "16.2.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "make-fetch-happen": "^11.0.0", - "minipass": "^5.0.0", + "@npmcli/redact": "^1.1.0", + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "proc-log": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-user-validate": { @@ -4674,15 +4370,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/once": { - "version": "1.4.0", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", "inBundle": true, @@ -4699,27 +4386,27 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "15.2.0", + "version": "17.0.6", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/git": "^4.0.0", + "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.0", + "cacache": "^18.0.0", "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", + "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", + "sigstore": "^2.2.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, @@ -4727,7 +4414,7 @@ "pacote": "lib/bin.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/parse-conflict-json": { @@ -4744,15 +4431,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/path-is-absolute": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", "inBundle": true, @@ -4763,13 +4441,13 @@ } }, "node_modules/npm/node_modules/path-scurry": { - "version": "1.9.2", + "version": "1.10.2", "inBundle": true, "license": "BlueOak-1.0.0", "peer": true, "dependencies": { - "lru-cache": "^9.1.1", - "minipass": "^5.0.0 || ^6.0.2" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -4778,17 +4456,8 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/path-scurry/node_modules/lru-cache": { - "version": "9.1.1", - "inBundle": true, - "license": "ISC", - "peer": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.0.13", + "version": "6.0.16", "inBundle": true, "license": "MIT", "peer": true, @@ -4809,15 +4478,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/process": { - "version": "0.11.10", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", "inBundle": true, @@ -4828,7 +4488,7 @@ } }, "node_modules/npm/node_modules/promise-call-limit": { - "version": "1.0.2", + "version": "3.0.1", "inBundle": true, "license": "ISC", "peer": true, @@ -4856,12 +4516,12 @@ } }, "node_modules/npm/node_modules/promzard": { - "version": "1.0.0", + "version": "1.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "read": "^2.0.0" + "read": "^3.0.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4876,12 +4536,12 @@ } }, "node_modules/npm/node_modules/read": { - "version": "2.1.0", + "version": "3.0.1", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "mute-stream": "~1.0.0" + "mute-stream": "^1.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4897,18 +4557,18 @@ } }, "node_modules/npm/node_modules/read-package-json": { - "version": "6.0.4", + "version": "7.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "glob": "^10.2.2", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", + "normalize-package-data": "^6.0.0", "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/read-package-json-fast": { @@ -4923,107 +4583,15 @@ "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } - }, - "node_modules/npm/node_modules/readable-stream": { - "version": "4.4.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/retry": { - "version": "0.12.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/npm/node_modules/rimraf": { - "version": "3.0.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/npm/node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/safe-buffer": { - "version": "5.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], + }, + "node_modules/npm/node_modules/retry": { + "version": "0.12.0", "inBundle": true, "license": "MIT", - "peer": true + "peer": true, + "engines": { + "node": ">= 4" + } }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", @@ -5033,7 +4601,7 @@ "peer": true }, "node_modules/npm/node_modules/semver": { - "version": "7.5.2", + "version": "7.6.0", "inBundle": true, "license": "ISC", "peer": true, @@ -5087,7 +4655,7 @@ } }, "node_modules/npm/node_modules/signal-exit": { - "version": "4.0.2", + "version": "4.1.0", "inBundle": true, "license": "ISC", "peer": true, @@ -5099,20 +4667,20 @@ } }, "node_modules/npm/node_modules/sigstore": { - "version": "1.7.0", + "version": "2.3.0", "inBundle": true, "license": "Apache-2.0", "peer": true, "dependencies": { - "@sigstore/protobuf-specs": "^0.1.0", - "@sigstore/tuf": "^1.0.1", - "make-fetch-happen": "^11.0.1" - }, - "bin": { - "sigstore": "bin/sigstore.js" + "@sigstore/bundle": "^2.3.1", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.1", + "@sigstore/sign": "^2.3.0", + "@sigstore/tuf": "^2.3.1", + "@sigstore/verify": "^1.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/smart-buffer": { @@ -5126,31 +4694,31 @@ } }, "node_modules/npm/node_modules/socks": { - "version": "2.7.1", + "version": "2.8.3", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, "node_modules/npm/node_modules/socks-proxy-agent": { - "version": "7.0.0", + "version": "8.0.3", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.7.1" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "node_modules/npm/node_modules/spdx-correct": { @@ -5163,14 +4731,24 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/spdx-exceptions": { - "version": "2.3.0", + "version": "2.5.0", "inBundle": true, "license": "CC-BY-3.0", "peer": true }, "node_modules/npm/node_modules/spdx-expression-parse": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "MIT", "peer": true, @@ -5180,32 +4758,23 @@ } }, "node_modules/npm/node_modules/spdx-license-ids": { - "version": "3.0.13", + "version": "3.0.17", "inBundle": true, "license": "CC0-1.0", "peer": true }, "node_modules/npm/node_modules/ssri": { - "version": "10.0.4", + "version": "10.0.5", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/string_decoder": { - "version": "1.3.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", "inBundle": true, @@ -5261,7 +4830,7 @@ } }, "node_modules/npm/node_modules/supports-color": { - "version": "9.3.1", + "version": "9.4.0", "inBundle": true, "license": "MIT", "peer": true, @@ -5273,7 +4842,7 @@ } }, "node_modules/npm/node_modules/tar": { - "version": "6.1.15", + "version": "6.2.1", "inBundle": true, "license": "ISC", "peer": true, @@ -5313,6 +4882,15 @@ "node": ">=8" } }, + "node_modules/npm/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", "inBundle": true, @@ -5335,17 +4913,17 @@ } }, "node_modules/npm/node_modules/tuf-js": { - "version": "1.1.7", + "version": "2.2.0", "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "@tufjs/models": "1.0.4", + "@tufjs/models": "2.0.0", "debug": "^4.3.4", - "make-fetch-happen": "^11.1.1" + "make-fetch-happen": "^13.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/unique-filename": { @@ -5388,6 +4966,16 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.0", "inBundle": true, @@ -5416,18 +5004,27 @@ } }, "node_modules/npm/node_modules/which": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/which/node_modules/isexe": { + "version": "3.1.1", + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=16" } }, "node_modules/npm/node_modules/wide-align": { @@ -5474,20 +5071,23 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", + "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", "inBundle": true, "license": "MIT", "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", + "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", "inBundle": true, "license": "MIT", "peer": true, @@ -5495,7 +5095,7 @@ "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { @@ -5536,12 +5136,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/npm/node_modules/wrappy": { - "version": "1.0.2", - "inBundle": true, - "license": "ISC", - "peer": true - }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", "inBundle": true, @@ -5561,6 +5155,15 @@ "license": "ISC", "peer": true }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -5616,33 +5219,27 @@ } }, "node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "peer": true, "dependencies": { - "yocto-queue": "^1.0.0" + "p-try": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "peer": true, "dependencies": { - "p-limit": "^4.0.0" + "p-limit": "^1.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/p-map": { @@ -5662,12 +5259,12 @@ } }, "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "peer": true, "engines": { - "node": ">=6" + "node": ">=4" } }, "node_modules/parent-module": { @@ -5699,13 +5296,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "peer": true + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "peer": true, + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "peer": true + }, "node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "peer": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=4" } }, "node_modules/path-key": { @@ -5716,12 +5334,6 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "peer": true - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -5763,73 +5375,6 @@ "node": ">=4" } }, - "node_modules/pkg-conf/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "peer": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "peer": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "peer": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "peer": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -5861,15 +5406,6 @@ } ] }, - "node_modules/quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -5886,85 +5422,76 @@ } }, "node_modules/read-pkg": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.0.0.tgz", - "integrity": "sha512-Ajb9oSjxXBw0YyOiwtQ2dKbAA/vMnUPnY63XcCk+mXo0BwIdQEMgZLZiMWGttQHcUhUgbK0mH85ethMPKXxziw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", "peer": true, "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^5.0.0", - "parse-json": "^7.0.0", - "type-fest": "^3.8.0" + "@types/normalize-package-data": "^2.4.3", + "normalize-package-data": "^6.0.0", + "parse-json": "^8.0.0", + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg-up": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-10.0.0.tgz", - "integrity": "sha512-jgmKiS//w2Zs+YbX039CorlkOp8FIVbSAN8r8GJHDsGlmNPXo+VeHkqAwCiQVTTx5/LwLZTcEw59z3DvcLbr0g==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz", + "integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==", + "deprecated": "Renamed to read-package-up", "peer": true, "dependencies": { - "find-up": "^6.3.0", - "read-pkg": "^8.0.0", - "type-fest": "^3.12.0" + "find-up-simple": "^1.0.0", + "read-pkg": "^9.0.0", + "type-fest": "^4.6.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", - "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", - "peer": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/read-pkg/node_modules/lines-and-columns": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", - "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "peer": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg/node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "node_modules/read-pkg/node_modules/parse-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", "peer": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" + "@babel/code-frame": "^7.22.13", + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg/node_modules/parse-json": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.0.0.tgz", - "integrity": "sha512-kP+TQYAzAiVnzOlWOe0diD6L35s9bJh0SCn95PIbZFKrOYuIRQsQkeWEYxzVDuHTt9V9YqvYCJ2Qo4z9wdfZPw==", + "node_modules/read-pkg/node_modules/type-fest": { + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "peer": true, - "dependencies": { - "@babel/code-frame": "^7.21.4", - "error-ex": "^1.3.2", - "json-parse-even-better-errors": "^3.0.0", - "lines-and-columns": "^2.0.3", - "type-fest": "^3.8.0" - }, "engines": { "node": ">=16" }, @@ -5987,28 +5514,6 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "peer": true, - "dependencies": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/redeyed": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", - "integrity": "sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==", - "peer": true, - "dependencies": { - "esprima": "~4.0.0" - } - }, "node_modules/registry-auth-token": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", @@ -6030,23 +5535,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", - "peer": true, - "dependencies": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -6094,34 +5582,35 @@ "peer": true }, "node_modules/semantic-release": { - "version": "21.0.7", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-21.0.7.tgz", - "integrity": "sha512-peRDSXN+hF8EFSKzze90ff/EnAmgITHQ/a3SZpRV3479ny0BIZWEJ33uX6/GlOSKdaSxo9hVRDyv2/u2MuF+Bw==", + "version": "23.0.2", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.0.2.tgz", + "integrity": "sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==", "peer": true, "dependencies": { - "@semantic-release/commit-analyzer": "^10.0.0", + "@semantic-release/commit-analyzer": "^11.0.0", "@semantic-release/error": "^4.0.0", "@semantic-release/github": "^9.0.0", - "@semantic-release/npm": "^10.0.2", - "@semantic-release/release-notes-generator": "^11.0.0", - "aggregate-error": "^4.0.1", - "cosmiconfig": "^8.0.0", + "@semantic-release/npm": "^11.0.0", + "@semantic-release/release-notes-generator": "^12.0.0", + "aggregate-error": "^5.0.0", + "cosmiconfig": "^9.0.0", "debug": "^4.0.0", - "env-ci": "^9.0.0", - "execa": "^7.0.0", - "figures": "^5.0.0", + "env-ci": "^11.0.0", + "execa": "^8.0.0", + "figures": "^6.0.0", "find-versions": "^5.1.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", "hook-std": "^3.0.0", - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", + "import-from-esm": "^1.3.1", "lodash-es": "^4.17.21", - "marked": "^5.0.0", - "marked-terminal": "^5.1.1", + "marked": "^12.0.0", + "marked-terminal": "^7.0.0", "micromatch": "^4.0.2", "p-each-series": "^3.0.0", "p-reduce": "^3.0.0", - "read-pkg-up": "^10.0.0", + "read-pkg-up": "^11.0.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", "semver-diff": "^4.0.0", @@ -6132,74 +5621,139 @@ "semantic-release": "bin/semantic-release.js" }, "engines": { - "node": ">=18" + "node": ">=20.8.1" } }, - "node_modules/semantic-release/node_modules/@octokit/plugin-paginate-rest": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-7.1.2.tgz", - "integrity": "sha512-Jx8KuKqEAVRsK6fMzZKv3h6UH9/NRDHsDRtUAROqqmZlCptM///Uef7A1ViZ/cbDplekz7VbDWdFLAZ/mpuDww==", + "node_modules/semantic-release/node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "peer": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/semantic-release/node_modules/@octokit/core": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", "peer": true, "dependencies": { - "@octokit/tsconfig": "^2.0.0", - "@octokit/types": "^9.3.2" + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 18" + } + }, + "node_modules/semantic-release/node_modules/@octokit/endpoint": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "peer": true, + "dependencies": { + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" }, - "peerDependencies": { - "@octokit/core": ">=4" + "engines": { + "node": ">= 18" } }, - "node_modules/semantic-release/node_modules/@octokit/plugin-retry": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-5.0.5.tgz", - "integrity": "sha512-sB1RWMhSrre02Atv95K6bhESlJ/sPdZkK/wE/w1IdSCe0yM6FxSjksLa6T7aAvxvxlLKzQEC4KIiqpqyov1Tbg==", + "node_modules/semantic-release/node_modules/@octokit/graphql": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", "peer": true, "dependencies": { - "@octokit/request-error": "^4.0.1", - "@octokit/types": "^10.0.0", - "bottleneck": "^2.15.3" + "@octokit/request": "^8.0.1", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/semantic-release/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "peer": true + }, + "node_modules/semantic-release/node_modules/@octokit/plugin-paginate-rest": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz", + "integrity": "sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==", + "peer": true, + "dependencies": { + "@octokit/types": "^12.6.0" }, "engines": { "node": ">= 18" }, "peerDependencies": { - "@octokit/core": ">=3" + "@octokit/core": "5" } }, - "node_modules/semantic-release/node_modules/@octokit/plugin-retry/node_modules/@octokit/types": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz", - "integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==", + "node_modules/semantic-release/node_modules/@octokit/plugin-retry": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", "peer": true, "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "bottleneck": "^2.15.3" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" } }, "node_modules/semantic-release/node_modules/@octokit/plugin-throttling": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-6.1.0.tgz", - "integrity": "sha512-JqMbTiPC0sUSTsLQsdq3JVx1mx8UtTo5mwR80YqPXE93+XhevvSyOR1rO2Z+NbO/r0TK4hqFJSSi/9oIZBxZTg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-8.2.0.tgz", + "integrity": "sha512-nOpWtLayKFpgqmgD0y3GqXafMFuKcA4tRPZIfu7BArd2lEZeb1988nhWhwx4aZWmjDmUfdgVf7W+Tt4AmvRmMQ==", "peer": true, "dependencies": { - "@octokit/types": "^9.0.0", + "@octokit/types": "^12.2.0", "bottleneck": "^2.15.3" }, "engines": { "node": ">= 18" }, "peerDependencies": { - "@octokit/core": "^4.0.0" + "@octokit/core": "^5.0.0" + } + }, + "node_modules/semantic-release/node_modules/@octokit/request": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "peer": true, + "dependencies": { + "@octokit/endpoint": "^9.0.0", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" } }, "node_modules/semantic-release/node_modules/@octokit/request-error": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-4.0.2.tgz", - "integrity": "sha512-uqwUEmZw3x4I9DGYq9fODVAAvcLsPQv97NRycP6syEFu5916M189VnNBW2zANNwqg3OiligNcAey7P0SET843w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", "peer": true, "dependencies": { - "@octokit/types": "^10.0.0", + "@octokit/types": "^12.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, @@ -6207,21 +5761,15 @@ "node": ">= 18" } }, - "node_modules/semantic-release/node_modules/@octokit/request-error/node_modules/@octokit/types": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz", - "integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==", + "node_modules/semantic-release/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", "peer": true, "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "@octokit/openapi-types": "^20.0.0" } }, - "node_modules/semantic-release/node_modules/@octokit/tsconfig": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-2.0.0.tgz", - "integrity": "sha512-tWnrai3quGt8+gRN2edzo9fmraWekeryXPeXDomMw2oFSpu/lH3VSWGn/q4V+rwjTRMeeXk/ci623/01Zet4VQ==", - "peer": true - }, "node_modules/semantic-release/node_modules/@semantic-release/error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", @@ -6232,26 +5780,26 @@ } }, "node_modules/semantic-release/node_modules/@semantic-release/github": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.0.3.tgz", - "integrity": "sha512-X6gq4USKVlCxPwIIyXb99jU7gwVWlnsKOevs+OyABRdoqc+OIRITbFmrrYU3eE1vGMGk+Qu/GAoLUQQQwC3YOA==", + "version": "9.2.6", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.2.6.tgz", + "integrity": "sha512-shi+Lrf6exeNZF+sBhK+P011LSbhmIAoUEgEY6SsxF8irJ+J2stwI5jkyDQ+4gzYyDImzV6LCKdYB9FXnQRWKA==", "peer": true, "dependencies": { - "@octokit/core": "^4.2.1", - "@octokit/plugin-paginate-rest": "^7.0.0", - "@octokit/plugin-retry": "^5.0.0", - "@octokit/plugin-throttling": "^6.0.0", + "@octokit/core": "^5.0.0", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-retry": "^6.0.0", + "@octokit/plugin-throttling": "^8.0.0", "@semantic-release/error": "^4.0.0", - "aggregate-error": "^4.0.1", + "aggregate-error": "^5.0.0", "debug": "^4.3.4", "dir-glob": "^3.0.1", - "globby": "^13.1.4", + "globby": "^14.0.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", "issue-parser": "^6.0.0", "lodash-es": "^4.17.21", - "mime": "^3.0.0", - "p-filter": "^3.0.0", + "mime": "^4.0.0", + "p-filter": "^4.0.0", "url-join": "^5.0.0" }, "engines": { @@ -6262,31 +5810,31 @@ } }, "node_modules/semantic-release/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "peer": true, "dependencies": { - "clean-stack": "^4.0.0", + "clean-stack": "^5.2.0", "indent-string": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semantic-release/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "peer": true, "dependencies": { "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6305,54 +5853,67 @@ } }, "node_modules/semantic-release/node_modules/execa": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz", - "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "peer": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/semantic-release/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", "peer": true, "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semantic-release/node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "peer": true, "engines": { - "node": ">=14.18.0" + "node": ">=16.17.0" } }, "node_modules/semantic-release/node_modules/indent-string": { @@ -6379,6 +5940,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semantic-release/node_modules/mime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.1.tgz", + "integrity": "sha512-5lZ5tyrIfliMXzFtkYyekWbtRXObT9OWa8IwQ5uxTBDHucNNwniRqo0yInflj+iYi5CBa6qxadGzGarDfuEOxA==", + "funding": [ + "https://github.com/sponsors/broofa" + ], + "peer": true, + "bin": { + "mime": "bin/cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/semantic-release/node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -6392,9 +5968,9 @@ } }, "node_modules/semantic-release/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "peer": true, "dependencies": { "path-key": "^4.0.0" @@ -6422,30 +5998,27 @@ } }, "node_modules/semantic-release/node_modules/p-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", - "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-4.1.0.tgz", + "integrity": "sha512-37/tPdZ3oJwHaS3gNJdenCDB3Tz26i9sjhnguBtvN0vYlRIiDNnvTWkuh+0hETV9rLPdJ3rlL3yVOYPIAnM8rw==", "peer": true, "dependencies": { - "p-map": "^5.1.0" + "p-map": "^7.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semantic-release/node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.1.tgz", + "integrity": "sha512-2wnaR0XL/FDOj+TgpDuRb2KTjLnu3Fma6b1ZUwGY7LcqenMcvP/YFpjpbPKY6WVGsbuJZRuoUz8iPrt8ORnAFw==", "peer": true, - "dependencies": { - "aggregate-error": "^4.0.0" - }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6475,10 +6048,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "node_modules/semantic-release/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "peer": true, "engines": { "node": ">=12" @@ -6487,6 +6060,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semantic-release/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/semantic-release/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/semantic-release/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -6509,9 +6106,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "peer": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6612,6 +6209,18 @@ "node": ">=4" } }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "peer": true, + "dependencies": { + "unicode-emoji-modifier-base": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -6646,9 +6255,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "peer": true }, "node_modules/spdx-expression-parse": { @@ -6662,44 +6271,18 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", "peer": true }, - "node_modules/split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "peer": true, - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, "node_modules/split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "peer": true, - "dependencies": { - "readable-stream": "^3.0.0" - } - }, - "node_modules/split2/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "peer": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, "engines": { - "node": ">= 6" + "node": ">= 10.x" } }, "node_modules/stream-combiner2": { @@ -6764,18 +6347,6 @@ "node": ">=6" } }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "peer": true, - "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -6797,16 +6368,16 @@ } }, "node_modules/supports-hyperlinks": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", - "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", "peer": true, "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/supports-hyperlinks/node_modules/has-flag": { @@ -6830,35 +6401,23 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", "peer": true, "engines": { - "node": ">=8" + "node": ">=14.16" } }, "node_modules/tempy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", - "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", "peer": true, "dependencies": { "is-stream": "^3.0.0", - "temp-dir": "^2.0.0", + "temp-dir": "^3.0.0", "type-fest": "^2.12.2", "unique-string": "^3.0.0" }, @@ -6894,12 +6453,36 @@ } }, "node_modules/text-extensions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", - "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "peer": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "peer": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, "engines": { - "node": ">=0.10" + "node": ">=0.8" } }, "node_modules/through": { @@ -6935,27 +6518,21 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/traverse": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", - "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", "peer": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/trim-newlines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/type-fest": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.0.tgz", - "integrity": "sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "peer": true, "engines": { "node": ">=14.16" @@ -6977,6 +6554,27 @@ "node": ">=0.8.0" } }, + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", @@ -6993,14 +6591,14 @@ } }, "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "engines": { "node": ">= 10.0.0" } @@ -7158,15 +6756,6 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", @@ -7174,18 +6763,6 @@ "engines": { "node": ">=12" } - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "peer": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/requirements.txt b/requirements.txt index 0d3982f..61d254f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -requests>=2.24.0,<3.0 +requests>=2.30.0,<3.0 python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.14.0,<4.0.0 +ibm_cloud_sdk_core>=3.20.1,<4.0.0 diff --git a/setup.py b/setup.py index 0b8652f..b386f20 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import sys import pkg_resources -__version__ = '0.24.0' +__version__ = '0.26.2' PACKAGE_NAME = 'ibm_cloud_networking_services' PACKAGE_DESC = 'Python client library for IBM Cloud Networking Services' 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/integration/test_zones_v1.py b/test/integration/test_zones_v1.py index 7807790..9a2c361 100644 --- a/test/integration/test_zones_v1.py +++ b/test/integration/test_zones_v1.py @@ -16,14 +16,14 @@ # load the .env file containing your environment variables try: - load_dotenv(find_dotenv(filename="cis.env")) + load_dotenv(find_dotenv(filename=configFile)) except: print('warning: no cis.env file loaded') class TestZonesV1(unittest.TestCase): """ Sample function to call zones sdk functions """ - + @unittest.skip("Authentication failing") def setUp(self): @@ -131,6 +131,48 @@ def test_2_zones(self): zone_identifier=None).get_result() self.assertEqual(val.exception.msg, 'zone_identifier must be provided') + + ################## partial zone integration test ################### + def test_3_zones(self): + """ create a partial zone """ + self.zone_name = "uuid-" + \ + str(uuid.uuid1())[1:6] + ".ibm.com" + response = self.zones.create_zone( + name=self.zone_name, type="partial").get_result() + assert response is not None and response.get('success') is True + result = response.get('result') + self.zone_id = result.get('id') + self.paused = result.get('paused') + + """ list all zones """ + response = self.zones.list_zones().get_result() + assert response is not None and response.get('success') is True + + """ zone activation check """ + try: + response = self.zones.zone_activation_check( + zone_identifier=self.zone_id).get_result() + assert response is not None and response.get('success') is True + except ApiException as e: + print("Exception:", e) + + """ update a zone """ + self.paused = not self.paused + response = self.zones.update_zone( + zone_identifier=self.zone_id, paused=self.paused).get_result() + assert response is not None and response.get('success') is True + + self.paused = not self.paused + response = self.zones.update_zone( + zone_identifier=self.zone_id, paused=self.paused).get_result() + assert response is not None and response.get('success') is True + + """ delete a zone """ + response = self.zones.delete_zone( + zone_identifier=self.zone_id).get_result() + assert response is not None and response.get('success') is True + + if __name__ == '__main__': diff --git a/test/unit/test_direct_link_provider_v2.py b/test/unit/test_direct_link_provider_v2.py index 0ce6a8d..6c96391 100644 --- a/test/unit/test_direct_link_provider_v2.py +++ b/test/unit/test_direct_link_provider_v2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2021. +# (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. @@ -34,18 +34,46 @@ _service = DirectLinkProviderV2( authenticator=NoAuthAuthenticator(), - version=version + version=version, ) _base_url = 'https://directlink.cloud.ibm.com/provider/v2' _service.set_service_url(_base_url) + +def preprocess_url(operation_path: str): + """ + Returns the request url associated with the specified operation path. + This will be base_url concatenated with a quoted version of operation_path. + The returned request URL is used to register the mock response so it needs + to match the request URL that is formed by the requests library. + """ + # First, unquote the path since it might have some quoted/escaped characters in it + # due to how the generator inserts the operation paths into the unit test code. + operation_path = urllib.parse.unquote(operation_path) + + # Next, quote the path using urllib so that we approximate what will + # happen during request processing. + operation_path = urllib.parse.quote(operation_path, safe='/') + + # Finally, form the request URL from the base URL and operation path. + request_url = _base_url + operation_path + + # If the request url does NOT end with a /, then just return it as-is. + # Otherwise, return a regular expression that matches one or more trailing /. + if re.fullmatch('.*/+', request_url) is None: + return request_url + else: + return re.compile(request_url.rstrip('/') + '/+') + + ############################################################################## # Start of Service: ProviderAPIs ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -71,6 +99,7 @@ def test_new_instance_without_authenticator(self): with pytest.raises(ValueError, match='authenticator must be provided'): service = DirectLinkProviderV2.new_instance( version=version, + service_name='TEST_SERVICE_NOT_FOUND', ) def test_new_instance_without_required_params(self): @@ -88,52 +117,45 @@ def test_new_instance_required_param_none(self): service = DirectLinkProviderV2.new_instance( version=None, ) -class TestListProviderGateways(): + + +class TestListProviderGateways: """ Test Class for list_provider_gateways """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_list_provider_gateways_all_params(self): """ list_provider_gateways() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?start=8c4a91a3e2cbd233b5a5b33436855fc2&limit=100", "start": "8c4a91a3e2cbd233b5a5b33436855fc2"}, "total_count": 132, "gateways": [{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}]}' - 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 # Invoke method response = _service.list_provider_gateways( start=start, limit=limit, - 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 @@ -153,18 +175,19 @@ def test_list_provider_gateways_required_params(self): test_list_provider_gateways_required_params() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?start=8c4a91a3e2cbd233b5a5b33436855fc2&limit=100", "start": "8c4a91a3e2cbd233b5a5b33436855fc2"}, "total_count": 132, "gateways": [{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}]}' - 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_provider_gateways() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -184,23 +207,24 @@ def test_list_provider_gateways_value_error(self): test_list_provider_gateways_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/gateways?start=8c4a91a3e2cbd233b5a5b33436855fc2&limit=100", "start": "8c4a91a3e2cbd233b5a5b33436855fc2"}, "total_count": 132, "gateways": [{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}]}' - 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_provider_gateways(**req_copy) - def test_list_provider_gateways_value_error_with_retries(self): # Enable retries and run test_list_provider_gateways_value_error. _service.enable_retries() @@ -210,35 +234,96 @@ def test_list_provider_gateways_value_error_with_retries(self): _service.disable_retries() self.test_list_provider_gateways_value_error() -class TestCreateProviderGateway(): + @responses.activate + def test_list_provider_gateways_with_pager_get_next(self): + """ + test_list_provider_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/gateways') + mock_response1 = '{"next":{"start":"1"},"gateways":[{"bgp_asn":64999,"bgp_cer_cidr":"10.254.30.78/30","bgp_ibm_asn":13884,"bgp_ibm_cidr":"10.254.30.77/30","bgp_status":"active","change_request":{"type":"create_gateway"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","customer_account_id":"4111d05f36894e3cb9b46a43556d9000","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"myGateway","operational_status":"configuring","port":{"id":"fffdcb1a-fee4-41c7-9e11-9cd99e65c777"},"provider_api_managed":true,"speed_mbps":1000,"type":"connect","vlan":10}],"total_count":2,"limit":1}' + mock_response2 = '{"gateways":[{"bgp_asn":64999,"bgp_cer_cidr":"10.254.30.78/30","bgp_ibm_asn":13884,"bgp_ibm_cidr":"10.254.30.77/30","bgp_status":"active","change_request":{"type":"create_gateway"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","customer_account_id":"4111d05f36894e3cb9b46a43556d9000","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"myGateway","operational_status":"configuring","port":{"id":"fffdcb1a-fee4-41c7-9e11-9cd99e65c777"},"provider_api_managed":true,"speed_mbps":1000,"type":"connect","vlan":10}],"total_count":2,"limit":1}' + 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 = [] + pager = ProviderGatewaysPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_provider_gateways_with_pager_get_all(self): + """ + test_list_provider_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/gateways') + mock_response1 = '{"next":{"start":"1"},"gateways":[{"bgp_asn":64999,"bgp_cer_cidr":"10.254.30.78/30","bgp_ibm_asn":13884,"bgp_ibm_cidr":"10.254.30.77/30","bgp_status":"active","change_request":{"type":"create_gateway"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","customer_account_id":"4111d05f36894e3cb9b46a43556d9000","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"myGateway","operational_status":"configuring","port":{"id":"fffdcb1a-fee4-41c7-9e11-9cd99e65c777"},"provider_api_managed":true,"speed_mbps":1000,"type":"connect","vlan":10}],"total_count":2,"limit":1}' + mock_response2 = '{"gateways":[{"bgp_asn":64999,"bgp_cer_cidr":"10.254.30.78/30","bgp_ibm_asn":13884,"bgp_ibm_cidr":"10.254.30.77/30","bgp_status":"active","change_request":{"type":"create_gateway"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","customer_account_id":"4111d05f36894e3cb9b46a43556d9000","id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"myGateway","operational_status":"configuring","port":{"id":"fffdcb1a-fee4-41c7-9e11-9cd99e65c777"},"provider_api_managed":true,"speed_mbps":1000,"type":"connect","vlan":10}],"total_count":2,"limit":1}' + 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 = ProviderGatewaysPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateProviderGateway: """ Test Class for create_provider_gateway """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_create_provider_gateway_all_params(self): """ create_provider_gateway() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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, + ) # Construct a dict representation of a ProviderGatewayPortIdentity model provider_gateway_port_identity_model = {} @@ -266,14 +351,14 @@ def test_create_provider_gateway_all_params(self): bgp_ibm_cidr=bgp_ibm_cidr, vlan=vlan, check_only=check_only, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # 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 'check_only={}'.format(check_only) in query_string # Validate body params @@ -302,13 +387,15 @@ def test_create_provider_gateway_required_params(self): test_create_provider_gateway_required_params() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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, + ) # Construct a dict representation of a ProviderGatewayPortIdentity model provider_gateway_port_identity_model = {} @@ -334,7 +421,7 @@ def test_create_provider_gateway_required_params(self): bgp_cer_cidr=bgp_cer_cidr, bgp_ibm_cidr=bgp_ibm_cidr, vlan=vlan, - headers={} + headers={}, ) # Check for correct operation @@ -366,13 +453,15 @@ def test_create_provider_gateway_value_error(self): test_create_provider_gateway_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways') + url = preprocess_url('/gateways') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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, + ) # Construct a dict representation of a ProviderGatewayPortIdentity model provider_gateway_port_identity_model = {} @@ -397,11 +486,10 @@ def test_create_provider_gateway_value_error(self): "speed_mbps": speed_mbps, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_provider_gateway(**req_copy) - def test_create_provider_gateway_value_error_with_retries(self): # Enable retries and run test_create_provider_gateway_value_error. _service.enable_retries() @@ -411,35 +499,27 @@ def test_create_provider_gateway_value_error_with_retries(self): _service.disable_retries() self.test_create_provider_gateway_value_error() -class TestDeleteProviderGateway(): + +class TestDeleteProviderGateway: """ Test Class for delete_provider_gateway """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_delete_provider_gateway_all_params(self): """ delete_provider_gateway() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=202) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) # Set up parameter values id = 'testString' @@ -447,7 +527,7 @@ def test_delete_provider_gateway_all_params(self): # Invoke method response = _service.delete_provider_gateway( id, - headers={} + headers={}, ) # Check for correct operation @@ -469,13 +549,15 @@ def test_delete_provider_gateway_value_error(self): test_delete_provider_gateway_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=202) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) # Set up parameter values id = 'testString' @@ -485,11 +567,10 @@ def test_delete_provider_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_provider_gateway(**req_copy) - def test_delete_provider_gateway_value_error_with_retries(self): # Enable retries and run test_delete_provider_gateway_value_error. _service.enable_retries() @@ -499,35 +580,27 @@ def test_delete_provider_gateway_value_error_with_retries(self): _service.disable_retries() self.test_delete_provider_gateway_value_error() -class TestGetProviderGateway(): + +class TestGetProviderGateway: """ Test Class for get_provider_gateway """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_get_provider_gateway_all_params(self): """ get_provider_gateway() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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 = 'testString' @@ -535,7 +608,7 @@ def test_get_provider_gateway_all_params(self): # Invoke method response = _service.get_provider_gateway( id, - headers={} + headers={}, ) # Check for correct operation @@ -557,13 +630,15 @@ def test_get_provider_gateway_value_error(self): test_get_provider_gateway_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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 = 'testString' @@ -573,11 +648,10 @@ def test_get_provider_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_provider_gateway(**req_copy) - def test_get_provider_gateway_value_error_with_retries(self): # Enable retries and run test_get_provider_gateway_value_error. _service.enable_retries() @@ -587,35 +661,27 @@ def test_get_provider_gateway_value_error_with_retries(self): _service.disable_retries() self.test_get_provider_gateway_value_error() -class TestUpdateProviderGateway(): + +class TestUpdateProviderGateway: """ Test Class for update_provider_gateway """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_update_provider_gateway_all_params(self): """ update_provider_gateway() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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 id = 'testString' @@ -635,7 +701,7 @@ def test_update_provider_gateway_all_params(self): name=name, speed_mbps=speed_mbps, vlan=vlan, - headers={} + headers={}, ) # Check for correct operation @@ -665,13 +731,15 @@ def test_update_provider_gateway_value_error(self): test_update_provider_gateway_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/gateways/testString') + url = preprocess_url('/gateways/testString') mock_response = '{"bgp_asn": 64999, "bgp_cer_cidr": "10.254.30.78/30", "bgp_ibm_asn": 13884, "bgp_ibm_cidr": "10.254.30.77/30", "bgp_status": "active", "change_request": {"type": "create_gateway"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "customer_account_id": "4111d05f36894e3cb9b46a43556d9000", "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "myGateway", "operational_status": "configuring", "port": {"id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"}, "provider_api_managed": true, "speed_mbps": 1000, "type": "connect", "vlan": 10}' - 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 id = 'testString' @@ -687,11 +755,10 @@ def test_update_provider_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.update_provider_gateway(**req_copy) - def test_update_provider_gateway_value_error_with_retries(self): # Enable retries and run test_update_provider_gateway_value_error. _service.enable_retries() @@ -701,52 +768,44 @@ def test_update_provider_gateway_value_error_with_retries(self): _service.disable_retries() self.test_update_provider_gateway_value_error() -class TestListProviderPorts(): + +class TestListProviderPorts: """ Test Class for list_provider_ports """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_list_provider_ports_all_params(self): """ list_provider_ports() """ # Set up mock - url = self.preprocess_url(_base_url + '/ports') + url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"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 # Invoke method response = _service.list_provider_ports( start=start, limit=limit, - 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 @@ -766,18 +825,19 @@ def test_list_provider_ports_required_params(self): test_list_provider_ports_required_params() """ # Set up mock - url = self.preprocess_url(_base_url + '/ports') + url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"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_provider_ports() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -797,23 +857,24 @@ def test_list_provider_ports_value_error(self): test_list_provider_ports_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/ports') + url = preprocess_url('/ports') mock_response = '{"first": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?limit=100"}, "limit": 100, "next": {"href": "https://directlink.cloud.ibm.com/provider/v2/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100", "start": "9d5a91a3e2cbd233b5a5b33436855ed1"}, "total_count": 132, "ports": [{"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_provider_ports(**req_copy) - def test_list_provider_ports_value_error_with_retries(self): # Enable retries and run test_list_provider_ports_value_error. _service.enable_retries() @@ -823,35 +884,96 @@ def test_list_provider_ports_value_error_with_retries(self): _service.disable_retries() self.test_list_provider_ports_value_error() -class TestGetProviderPort(): + @responses.activate + def test_list_provider_ports_with_pager_get_next(self): + """ + test_list_provider_ports_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/ports') + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"ports":[{"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":[{"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, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = ProviderPortsPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_provider_ports_with_pager_get_all(self): + """ + test_list_provider_ports_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/ports') + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"ports":[{"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":[{"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, + ) + + # Exercise the pager class for this operation + pager = ProviderPortsPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestGetProviderPort: """ Test Class for get_provider_port """ - def preprocess_url(self, request_url: str): - """ - Preprocess the request URL to ensure the mock response will be found. - """ - request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded - request_url = urllib.parse.quote(request_url, safe=':/') - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - @responses.activate def test_get_provider_port_all_params(self): """ get_provider_port() """ # Set up mock - url = self.preprocess_url(_base_url + '/ports/testString') + url = preprocess_url('/ports/testString') mock_response = '{"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 = 'testString' @@ -859,7 +981,7 @@ def test_get_provider_port_all_params(self): # Invoke method response = _service.get_provider_port( id, - headers={} + headers={}, ) # Check for correct operation @@ -881,13 +1003,15 @@ def test_get_provider_port_value_error(self): test_get_provider_port_value_error() """ # Set up mock - url = self.preprocess_url(_base_url + '/ports/testString') + url = preprocess_url('/ports/testString') mock_response = '{"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 = 'testString' @@ -897,11 +1021,10 @@ def test_get_provider_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_provider_port(**req_copy) - def test_get_provider_port_value_error_with_retries(self): # Enable retries and run test_get_provider_port_value_error. _service.enable_retries() @@ -911,6 +1034,7 @@ def test_get_provider_port_value_error_with_retries(self): _service.disable_retries() self.test_get_provider_port_value_error() + # endregion ############################################################################## # End of Service: ProviderAPIs @@ -921,7 +1045,9 @@ def test_get_provider_port_value_error_with_retries(self): # Start of Model Tests ############################################################################## # region -class TestModel_ProviderGateway(): + + +class TestModel_ProviderGateway: """ Test Class for ProviderGateway """ @@ -933,10 +1059,10 @@ def test_provider_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - provider_gateway_change_request_model = {} # ProviderGatewayChangeRequestProviderGatewayCreate + provider_gateway_change_request_model = {} # ProviderGatewayChangeRequestProviderGatewayCreate provider_gateway_change_request_model['type'] = 'create_gateway' - provider_gateway_port_reference_model = {} # ProviderGatewayPortReference + provider_gateway_port_reference_model = {} # ProviderGatewayPortReference provider_gateway_port_reference_model['id'] = 'fffdcb1a-fee4-41c7-9e11-9cd99e65c777' # Construct a json representation of a ProviderGateway model @@ -947,7 +1073,7 @@ def test_provider_gateway_serialization(self): provider_gateway_model_json['bgp_ibm_cidr'] = '10.254.30.77/30' provider_gateway_model_json['bgp_status'] = 'active' provider_gateway_model_json['change_request'] = provider_gateway_change_request_model - provider_gateway_model_json['created_at'] = "2019-01-01T12:00:00Z" + provider_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' provider_gateway_model_json['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' provider_gateway_model_json['customer_account_id'] = '4111d05f36894e3cb9b46a43556d9000' provider_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' @@ -974,7 +1100,8 @@ def test_provider_gateway_serialization(self): provider_gateway_model_json2 = provider_gateway_model.to_dict() assert provider_gateway_model_json2 == provider_gateway_model_json -class TestModel_ProviderGatewayCollection(): + +class TestModel_ProviderGatewayCollection: """ Test Class for ProviderGatewayCollection """ @@ -986,27 +1113,27 @@ def test_provider_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - provider_gateway_collection_first_model = {} # ProviderGatewayCollectionFirst + provider_gateway_collection_first_model = {} # ProviderGatewayCollectionFirst provider_gateway_collection_first_model['href'] = 'https://directlink.cloud.ibm.com/provider/v2/gateways?limit=100' - provider_gateway_collection_next_model = {} # ProviderGatewayCollectionNext + provider_gateway_collection_next_model = {} # ProviderGatewayCollectionNext provider_gateway_collection_next_model['href'] = 'https://directlink.cloud.ibm.com/provider/v2/gateways?start=8c4a91a3e2cbd233b5a5b33436855fc2&limit=100' provider_gateway_collection_next_model['start'] = '8c4a91a3e2cbd233b5a5b33436855fc2' - provider_gateway_change_request_model = {} # ProviderGatewayChangeRequestProviderGatewayCreate + provider_gateway_change_request_model = {} # ProviderGatewayChangeRequestProviderGatewayCreate provider_gateway_change_request_model['type'] = 'create_gateway' - provider_gateway_port_reference_model = {} # ProviderGatewayPortReference + provider_gateway_port_reference_model = {} # ProviderGatewayPortReference provider_gateway_port_reference_model['id'] = 'fffdcb1a-fee4-41c7-9e11-9cd99e65c777' - provider_gateway_model = {} # ProviderGateway + provider_gateway_model = {} # ProviderGateway provider_gateway_model['bgp_asn'] = 64999 provider_gateway_model['bgp_cer_cidr'] = '10.254.30.78/30' provider_gateway_model['bgp_ibm_asn'] = 13884 provider_gateway_model['bgp_ibm_cidr'] = '10.254.30.77/30' provider_gateway_model['bgp_status'] = 'active' provider_gateway_model['change_request'] = provider_gateway_change_request_model - provider_gateway_model['created_at'] = "2019-01-01T12:00:00Z" + provider_gateway_model['created_at'] = '2019-01-01T12:00:00Z' provider_gateway_model['crn'] = 'crn:v1:bluemix:public:directlink:dal03:a/4111d05f36894e3cb9b46a43556d9000::connect:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' provider_gateway_model['customer_account_id'] = '4111d05f36894e3cb9b46a43556d9000' provider_gateway_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' @@ -1041,7 +1168,8 @@ def test_provider_gateway_collection_serialization(self): provider_gateway_collection_model_json2 = provider_gateway_collection_model.to_dict() assert provider_gateway_collection_model_json2 == provider_gateway_collection_model_json -class TestModel_ProviderGatewayCollectionFirst(): + +class TestModel_ProviderGatewayCollectionFirst: """ Test Class for ProviderGatewayCollectionFirst """ @@ -1070,7 +1198,8 @@ def test_provider_gateway_collection_first_serialization(self): provider_gateway_collection_first_model_json2 = provider_gateway_collection_first_model.to_dict() assert provider_gateway_collection_first_model_json2 == provider_gateway_collection_first_model_json -class TestModel_ProviderGatewayCollectionNext(): + +class TestModel_ProviderGatewayCollectionNext: """ Test Class for ProviderGatewayCollectionNext """ @@ -1100,7 +1229,8 @@ def test_provider_gateway_collection_next_serialization(self): provider_gateway_collection_next_model_json2 = provider_gateway_collection_next_model.to_dict() assert provider_gateway_collection_next_model_json2 == provider_gateway_collection_next_model_json -class TestModel_ProviderGatewayPortIdentity(): + +class TestModel_ProviderGatewayPortIdentity: """ Test Class for ProviderGatewayPortIdentity """ @@ -1129,7 +1259,8 @@ def test_provider_gateway_port_identity_serialization(self): provider_gateway_port_identity_model_json2 = provider_gateway_port_identity_model.to_dict() assert provider_gateway_port_identity_model_json2 == provider_gateway_port_identity_model_json -class TestModel_ProviderGatewayPortReference(): + +class TestModel_ProviderGatewayPortReference: """ Test Class for ProviderGatewayPortReference """ @@ -1158,7 +1289,8 @@ def test_provider_gateway_port_reference_serialization(self): provider_gateway_port_reference_model_json2 = provider_gateway_port_reference_model.to_dict() assert provider_gateway_port_reference_model_json2 == provider_gateway_port_reference_model_json -class TestModel_ProviderPort(): + +class TestModel_ProviderPort: """ Test Class for ProviderPort """ @@ -1192,7 +1324,8 @@ def test_provider_port_serialization(self): provider_port_model_json2 = provider_port_model.to_dict() assert provider_port_model_json2 == provider_port_model_json -class TestModel_ProviderPortCollection(): + +class TestModel_ProviderPortCollection: """ Test Class for ProviderPortCollection """ @@ -1204,14 +1337,14 @@ def test_provider_port_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - provider_port_collection_first_model = {} # ProviderPortCollectionFirst + provider_port_collection_first_model = {} # ProviderPortCollectionFirst provider_port_collection_first_model['href'] = 'https://directlink.cloud.ibm.com/provider/v2/ports?limit=100' - provider_port_collection_next_model = {} # ProviderPortCollectionNext + provider_port_collection_next_model = {} # ProviderPortCollectionNext provider_port_collection_next_model['href'] = 'https://directlink.cloud.ibm.com/provider/v2/ports?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=100' provider_port_collection_next_model['start'] = '9d5a91a3e2cbd233b5a5b33436855ed1' - provider_port_model = {} # ProviderPort + provider_port_model = {} # ProviderPort provider_port_model['id'] = '01122b9b-820f-4c44-8a31-77f1f0806765' provider_port_model['label'] = 'XCR-FRK-CS-SEC-01' provider_port_model['location_display_name'] = 'Dallas 03' @@ -1242,7 +1375,8 @@ def test_provider_port_collection_serialization(self): provider_port_collection_model_json2 = provider_port_collection_model.to_dict() assert provider_port_collection_model_json2 == provider_port_collection_model_json -class TestModel_ProviderPortCollectionFirst(): + +class TestModel_ProviderPortCollectionFirst: """ Test Class for ProviderPortCollectionFirst """ @@ -1271,7 +1405,8 @@ def test_provider_port_collection_first_serialization(self): provider_port_collection_first_model_json2 = provider_port_collection_first_model.to_dict() assert provider_port_collection_first_model_json2 == provider_port_collection_first_model_json -class TestModel_ProviderPortCollectionNext(): + +class TestModel_ProviderPortCollectionNext: """ Test Class for ProviderPortCollectionNext """ @@ -1301,7 +1436,8 @@ def test_provider_port_collection_next_serialization(self): provider_port_collection_next_model_json2 = provider_port_collection_next_model.to_dict() assert provider_port_collection_next_model_json2 == provider_port_collection_next_model_json -class TestModel_ProviderGatewayChangeRequestProviderGatewayCreate(): + +class TestModel_ProviderGatewayChangeRequestProviderGatewayCreate: """ Test Class for ProviderGatewayChangeRequestProviderGatewayCreate """ @@ -1330,7 +1466,8 @@ def test_provider_gateway_change_request_provider_gateway_create_serialization(s provider_gateway_change_request_provider_gateway_create_model_json2 = provider_gateway_change_request_provider_gateway_create_model.to_dict() assert provider_gateway_change_request_provider_gateway_create_model_json2 == provider_gateway_change_request_provider_gateway_create_model_json -class TestModel_ProviderGatewayChangeRequestProviderGatewayDelete(): + +class TestModel_ProviderGatewayChangeRequestProviderGatewayDelete: """ Test Class for ProviderGatewayChangeRequestProviderGatewayDelete """ @@ -1359,7 +1496,8 @@ def test_provider_gateway_change_request_provider_gateway_delete_serialization(s provider_gateway_change_request_provider_gateway_delete_model_json2 = provider_gateway_change_request_provider_gateway_delete_model.to_dict() assert provider_gateway_change_request_provider_gateway_delete_model_json2 == provider_gateway_change_request_provider_gateway_delete_model_json -class TestModel_ProviderGatewayChangeRequestProviderGatewayUpdateAttributes(): + +class TestModel_ProviderGatewayChangeRequestProviderGatewayUpdateAttributes: """ Test Class for ProviderGatewayChangeRequestProviderGatewayUpdateAttributes """ @@ -1371,7 +1509,7 @@ def test_provider_gateway_change_request_provider_gateway_update_attributes_seri # Construct dict forms of any model objects needed in order to build this model. - provider_gateway_update_attributes_updates_item_model = {} # ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate + provider_gateway_update_attributes_updates_item_model = {} # ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate provider_gateway_update_attributes_updates_item_model['speed_mbps'] = 500 # Construct a json representation of a ProviderGatewayChangeRequestProviderGatewayUpdateAttributes model @@ -1394,7 +1532,8 @@ def test_provider_gateway_change_request_provider_gateway_update_attributes_seri provider_gateway_change_request_provider_gateway_update_attributes_model_json2 = provider_gateway_change_request_provider_gateway_update_attributes_model.to_dict() assert provider_gateway_change_request_provider_gateway_update_attributes_model_json2 == provider_gateway_change_request_provider_gateway_update_attributes_model_json -class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate(): + +class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate: """ Test Class for ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate """ @@ -1423,7 +1562,8 @@ def test_provider_gateway_update_attributes_updates_item_provider_gateway_bgpasn provider_gateway_update_attributes_updates_item_provider_gateway_bgpasn_update_model_json2 = provider_gateway_update_attributes_updates_item_provider_gateway_bgpasn_update_model.to_dict() assert provider_gateway_update_attributes_updates_item_provider_gateway_bgpasn_update_model_json2 == provider_gateway_update_attributes_updates_item_provider_gateway_bgpasn_update_model_json -class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate(): + +class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate: """ Test Class for ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate """ @@ -1453,7 +1593,8 @@ def test_provider_gateway_update_attributes_updates_item_provider_gateway_bgpip_ provider_gateway_update_attributes_updates_item_provider_gateway_bgpip_update_model_json2 = provider_gateway_update_attributes_updates_item_provider_gateway_bgpip_update_model.to_dict() assert provider_gateway_update_attributes_updates_item_provider_gateway_bgpip_update_model_json2 == provider_gateway_update_attributes_updates_item_provider_gateway_bgpip_update_model_json -class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate(): + +class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate: """ Test Class for ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate """ @@ -1482,7 +1623,8 @@ def test_provider_gateway_update_attributes_updates_item_provider_gateway_speed_ provider_gateway_update_attributes_updates_item_provider_gateway_speed_update_model_json2 = provider_gateway_update_attributes_updates_item_provider_gateway_speed_update_model.to_dict() assert provider_gateway_update_attributes_updates_item_provider_gateway_speed_update_model_json2 == provider_gateway_update_attributes_updates_item_provider_gateway_speed_update_model_json -class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN(): + +class TestModel_ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN: """ Test Class for ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN """ 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 """ diff --git a/test/unit/test_transit_gateway_apis_v1.py b/test/unit/test_transit_gateway_apis_v1.py index 8f5b6a8..0fe4446 100644 --- a/test/unit/test_transit_gateway_apis_v1.py +++ b/test/unit/test_transit_gateway_apis_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. @@ -131,7 +131,7 @@ def test_list_transit_gateways_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -176,7 +176,7 @@ def test_list_transit_gateways_required_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -208,7 +208,7 @@ def test_list_transit_gateways_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -241,8 +241,8 @@ def test_list_transit_gateways_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways') - mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' - mock_response2 = '{"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response2 = '{"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -277,8 +277,8 @@ def test_list_transit_gateways_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways') - mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' - mock_response2 = '{"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response2 = '{"transit_gateways":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -316,7 +316,7 @@ def test_create_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.POST, url, @@ -370,7 +370,7 @@ def test_create_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.POST, url, @@ -496,7 +496,7 @@ def test_get_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -534,7 +534,7 @@ def test_get_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -577,7 +577,7 @@ def test_update_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -623,7 +623,7 @@ def test_update_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -725,7 +725,7 @@ def test_list_connections_all_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -773,7 +773,7 @@ def test_list_connections_required_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -805,7 +805,7 @@ def test_list_connections_value_error(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -838,8 +838,8 @@ def test_list_connections_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -875,8 +875,8 @@ def test_list_connections_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -972,7 +972,7 @@ def test_list_transit_gateway_connections_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1022,7 +1022,7 @@ def test_list_transit_gateway_connections_required_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1060,7 +1060,7 @@ def test_list_transit_gateway_connections_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1097,8 +1097,8 @@ def test_list_transit_gateway_connections_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways/testString/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"28e4d90ac7504be694471ee66e70d0d5","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"28e4d90ac7504be694471ee66e70d0d5","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -1135,8 +1135,8 @@ def test_list_transit_gateway_connections_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways/testString/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"28e4d90ac7504be694471ee66e70d0d5","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"28e4d90ac7504be694471ee66e70d0d5","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -1176,7 +1176,7 @@ def test_create_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -1196,6 +1196,16 @@ def test_create_transit_gateway_connection_all_params(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a TransitGatewayRedundantGRETunnelTemplate model + transit_gateway_redundant_gre_tunnel_template_model = {} + transit_gateway_redundant_gre_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_template_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_template_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_template_model['zone'] = zone_identity_model + # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' @@ -1204,13 +1214,14 @@ def test_create_transit_gateway_connection_all_params(self): local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' - network_account_id = '28e4d90ac7504be694471ee66e70d0d5' + network_account_id = 'testString' network_id = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' prefix_filters = [transit_gateway_connection_prefix_filter_model] prefix_filters_default = 'permit' remote_bgp_asn = 65010 remote_gateway_ip = '10.242.63.12' remote_tunnel_ip = '192.168.129.1' + tunnels = [transit_gateway_redundant_gre_tunnel_template_model] zone = zone_identity_model # Invoke method @@ -1229,6 +1240,7 @@ def test_create_transit_gateway_connection_all_params(self): remote_bgp_asn=remote_bgp_asn, remote_gateway_ip=remote_gateway_ip, remote_tunnel_ip=remote_tunnel_ip, + tunnels=tunnels, zone=zone, headers={}, ) @@ -1244,13 +1256,14 @@ def test_create_transit_gateway_connection_all_params(self): assert req_body['local_gateway_ip'] == '192.168.100.1' assert req_body['local_tunnel_ip'] == '192.168.129.2' assert req_body['name'] == 'Transit_Service_BWTN_SJ_DL' - assert req_body['network_account_id'] == '28e4d90ac7504be694471ee66e70d0d5' + assert req_body['network_account_id'] == 'testString' assert req_body['network_id'] == 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' assert req_body['prefix_filters'] == [transit_gateway_connection_prefix_filter_model] assert req_body['prefix_filters_default'] == 'permit' assert req_body['remote_bgp_asn'] == 65010 assert req_body['remote_gateway_ip'] == '10.242.63.12' assert req_body['remote_tunnel_ip'] == '192.168.129.1' + assert req_body['tunnels'] == [transit_gateway_redundant_gre_tunnel_template_model] assert req_body['zone'] == zone_identity_model def test_create_transit_gateway_connection_all_params_with_retries(self): @@ -1269,7 +1282,7 @@ def test_create_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -1289,6 +1302,16 @@ def test_create_transit_gateway_connection_value_error(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a TransitGatewayRedundantGRETunnelTemplate model + transit_gateway_redundant_gre_tunnel_template_model = {} + transit_gateway_redundant_gre_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_template_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_template_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_template_model['zone'] = zone_identity_model + # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' @@ -1297,13 +1320,14 @@ def test_create_transit_gateway_connection_value_error(self): local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' - network_account_id = '28e4d90ac7504be694471ee66e70d0d5' + network_account_id = 'testString' network_id = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' prefix_filters = [transit_gateway_connection_prefix_filter_model] prefix_filters_default = 'permit' remote_bgp_asn = 65010 remote_gateway_ip = '10.242.63.12' remote_tunnel_ip = '192.168.129.1' + tunnels = [transit_gateway_redundant_gre_tunnel_template_model] zone = zone_identity_model # Pass in all but one required param and check for a ValueError @@ -1417,7 +1441,7 @@ def test_get_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -1457,7 +1481,7 @@ def test_get_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -1502,7 +1526,7 @@ def test_update_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -1550,7 +1574,7 @@ def test_update_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -1671,6 +1695,487 @@ def test_create_transit_gateway_connection_actions_value_error_with_retries(self self.test_create_transit_gateway_connection_actions_value_error() +class TestGetTransitGatewayGreTunnel: + """ + Test Class for get_transit_gateway_gre_tunnel + """ + + @responses.activate + def test_get_transit_gateway_gre_tunnel_all_params(self): + """ + get_transit_gateway_gre_tunnel() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_transit_gateway_gre_tunnel( + transit_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_transit_gateway_gre_tunnel_all_params_with_retries(self): + # Enable retries and run test_get_transit_gateway_gre_tunnel_all_params. + _service.enable_retries() + self.test_get_transit_gateway_gre_tunnel_all_params() + + # Disable retries and run test_get_transit_gateway_gre_tunnel_all_params. + _service.disable_retries() + self.test_get_transit_gateway_gre_tunnel_all_params() + + @responses.activate + def test_get_transit_gateway_gre_tunnel_value_error(self): + """ + test_get_transit_gateway_gre_tunnel_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_transit_gateway_gre_tunnel(**req_copy) + + def test_get_transit_gateway_gre_tunnel_value_error_with_retries(self): + # Enable retries and run test_get_transit_gateway_gre_tunnel_value_error. + _service.enable_retries() + self.test_get_transit_gateway_gre_tunnel_value_error() + + # Disable retries and run test_get_transit_gateway_gre_tunnel_value_error. + _service.disable_retries() + self.test_get_transit_gateway_gre_tunnel_value_error() + + +class TestCreateTransitGatewayGreTunnel: + """ + Test Class for create_transit_gateway_gre_tunnel + """ + + @responses.activate + def test_create_transit_gateway_gre_tunnel_all_params(self): + """ + create_transit_gateway_gre_tunnel() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + local_gateway_ip = '10.242.63.12' + local_tunnel_ip = '192.168.100.20' + name = 'gre1' + remote_gateway_ip = '10.242.33.22' + remote_tunnel_ip = '192.168.129.1' + zone = zone_identity_model + remote_bgp_asn = 65010 + + # Invoke method + response = _service.create_transit_gateway_gre_tunnel( + transit_gateway_id, + id, + local_gateway_ip, + local_tunnel_ip, + name, + remote_gateway_ip, + remote_tunnel_ip, + zone, + remote_bgp_asn=remote_bgp_asn, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['local_gateway_ip'] == '10.242.63.12' + assert req_body['local_tunnel_ip'] == '192.168.100.20' + assert req_body['name'] == 'gre1' + assert req_body['remote_gateway_ip'] == '10.242.33.22' + assert req_body['remote_tunnel_ip'] == '192.168.129.1' + assert req_body['zone'] == zone_identity_model + assert req_body['remote_bgp_asn'] == 65010 + + def test_create_transit_gateway_gre_tunnel_all_params_with_retries(self): + # Enable retries and run test_create_transit_gateway_gre_tunnel_all_params. + _service.enable_retries() + self.test_create_transit_gateway_gre_tunnel_all_params() + + # Disable retries and run test_create_transit_gateway_gre_tunnel_all_params. + _service.disable_retries() + self.test_create_transit_gateway_gre_tunnel_all_params() + + @responses.activate + def test_create_transit_gateway_gre_tunnel_value_error(self): + """ + test_create_transit_gateway_gre_tunnel_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + local_gateway_ip = '10.242.63.12' + local_tunnel_ip = '192.168.100.20' + name = 'gre1' + remote_gateway_ip = '10.242.33.22' + remote_tunnel_ip = '192.168.129.1' + zone = zone_identity_model + remote_bgp_asn = 65010 + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + "local_gateway_ip": local_gateway_ip, + "local_tunnel_ip": local_tunnel_ip, + "name": name, + "remote_gateway_ip": remote_gateway_ip, + "remote_tunnel_ip": remote_tunnel_ip, + "zone": zone, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_transit_gateway_gre_tunnel(**req_copy) + + def test_create_transit_gateway_gre_tunnel_value_error_with_retries(self): + # Enable retries and run test_create_transit_gateway_gre_tunnel_value_error. + _service.enable_retries() + self.test_create_transit_gateway_gre_tunnel_value_error() + + # Disable retries and run test_create_transit_gateway_gre_tunnel_value_error. + _service.disable_retries() + self.test_create_transit_gateway_gre_tunnel_value_error() + + +class TestDeleteTransitGatewayConnectionTunnels: + """ + Test Class for delete_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_delete_transit_gateway_connection_tunnels_all_params(self): + """ + delete_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Invoke method + response = _service.delete_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_delete_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_delete_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_delete_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_delete_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_delete_transit_gateway_connection_tunnels_value_error(self): + """ + test_delete_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + "gre_tunnel_id": gre_tunnel_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_transit_gateway_connection_tunnels(**req_copy) + + def test_delete_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_delete_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_delete_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_delete_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_delete_transit_gateway_connection_tunnels_value_error() + + +class TestGetTransitGatewayConnectionTunnels: + """ + Test Class for get_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_get_transit_gateway_connection_tunnels_all_params(self): + """ + get_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Invoke method + response = _service.get_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_get_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_get_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_get_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_get_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_get_transit_gateway_connection_tunnels_value_error(self): + """ + test_get_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + "gre_tunnel_id": gre_tunnel_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_transit_gateway_connection_tunnels(**req_copy) + + def test_get_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_get_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_get_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_get_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_get_transit_gateway_connection_tunnels_value_error() + + +class TestUpdateTransitGatewayConnectionTunnels: + """ + Test Class for update_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_update_transit_gateway_connection_tunnels_all_params(self): + """ + update_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + name = 'gre2' + + # Invoke method + response = _service.update_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + name=name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['name'] == 'gre2' + + def test_update_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_update_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_update_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_update_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_update_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_update_transit_gateway_connection_tunnels_value_error(self): + """ + test_update_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + name = 'gre2' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + "gre_tunnel_id": gre_tunnel_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_transit_gateway_connection_tunnels(**req_copy) + + def test_update_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_update_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_update_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_update_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_update_transit_gateway_connection_tunnels_value_error() + + # endregion ############################################################################## # End of Service: TransitGatewaysNetworkConnections @@ -1811,7 +2316,7 @@ def test_get_gateway_location_all_params(self): """ # Set up mock url = preprocess_url('/locations/testString') - mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}]}' + mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"zones": [{"name": "us-south-1"}]}]}' responses.add( responses.GET, url, @@ -1849,7 +2354,7 @@ def test_get_gateway_location_value_error(self): """ # Set up mock url = preprocess_url('/locations/testString') - mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}]}' + mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"zones": [{"name": "us-south-1"}]}]}' responses.add( responses.GET, url, @@ -2915,6 +3420,36 @@ def test_get_transit_gateway_route_report_value_error_with_retries(self): # region +class TestModel_GreTunnelZoneReference: + """ + Test Class for GreTunnelZoneReference + """ + + def test_gre_tunnel_zone_reference_serialization(self): + """ + Test serialization/deserialization for GreTunnelZoneReference + """ + + # Construct a json representation of a GreTunnelZoneReference model + gre_tunnel_zone_reference_model_json = {} + gre_tunnel_zone_reference_model_json['name'] = 'us-south-1' + + # Construct a model instance of GreTunnelZoneReference by calling from_dict on the json representation + gre_tunnel_zone_reference_model = GreTunnelZoneReference.from_dict(gre_tunnel_zone_reference_model_json) + assert gre_tunnel_zone_reference_model != False + + # Construct a model instance of GreTunnelZoneReference by calling from_dict on the json representation + gre_tunnel_zone_reference_model_dict = GreTunnelZoneReference.from_dict(gre_tunnel_zone_reference_model_json).__dict__ + gre_tunnel_zone_reference_model2 = GreTunnelZoneReference(**gre_tunnel_zone_reference_model_dict) + + # Verify the model instances are equivalent + assert gre_tunnel_zone_reference_model == gre_tunnel_zone_reference_model2 + + # Convert model instance back to dict and verify no loss of data + gre_tunnel_zone_reference_model_json2 = gre_tunnel_zone_reference_model.to_dict() + assert gre_tunnel_zone_reference_model_json2 == gre_tunnel_zone_reference_model_json + + class TestModel_PaginationFirstConnection: """ Test Class for PaginationFirstConnection @@ -3210,6 +3745,109 @@ def test_prefix_filter_put_serialization(self): assert prefix_filter_put_model_json2 == prefix_filter_put_model_json +class TestModel_RedundantGRETunnelCollection: + """ + Test Class for RedundantGRETunnelCollection + """ + + def test_redundant_gre_tunnel_collection_serialization(self): + """ + Test serialization/deserialization for RedundantGRETunnelCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + redundant_gre_tunnel_reference_model = {} # RedundantGRETunnelReference + redundant_gre_tunnel_reference_model['base_network_type'] = 'classic' + redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' + redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 + redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' + redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' + redundant_gre_tunnel_reference_model['mtu'] = 9000 + redundant_gre_tunnel_reference_model['name'] = 'gre1' + redundant_gre_tunnel_reference_model['network_account_id'] = 'testString' + redundant_gre_tunnel_reference_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 + redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' + redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' + redundant_gre_tunnel_reference_model['status'] = 'attached' + redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' + redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model + + # Construct a json representation of a RedundantGRETunnelCollection model + redundant_gre_tunnel_collection_model_json = {} + redundant_gre_tunnel_collection_model_json['tunnels'] = [redundant_gre_tunnel_reference_model] + + # Construct a model instance of RedundantGRETunnelCollection by calling from_dict on the json representation + redundant_gre_tunnel_collection_model = RedundantGRETunnelCollection.from_dict(redundant_gre_tunnel_collection_model_json) + assert redundant_gre_tunnel_collection_model != False + + # Construct a model instance of RedundantGRETunnelCollection by calling from_dict on the json representation + redundant_gre_tunnel_collection_model_dict = RedundantGRETunnelCollection.from_dict(redundant_gre_tunnel_collection_model_json).__dict__ + redundant_gre_tunnel_collection_model2 = RedundantGRETunnelCollection(**redundant_gre_tunnel_collection_model_dict) + + # Verify the model instances are equivalent + assert redundant_gre_tunnel_collection_model == redundant_gre_tunnel_collection_model2 + + # Convert model instance back to dict and verify no loss of data + redundant_gre_tunnel_collection_model_json2 = redundant_gre_tunnel_collection_model.to_dict() + assert redundant_gre_tunnel_collection_model_json2 == redundant_gre_tunnel_collection_model_json + + +class TestModel_RedundantGRETunnelReference: + """ + Test Class for RedundantGRETunnelReference + """ + + def test_redundant_gre_tunnel_reference_serialization(self): + """ + Test serialization/deserialization for RedundantGRETunnelReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a RedundantGRETunnelReference model + redundant_gre_tunnel_reference_model_json = {} + redundant_gre_tunnel_reference_model_json['base_network_type'] = 'classic' + redundant_gre_tunnel_reference_model_json['created_at'] = '2019-01-01T12:00:00Z' + redundant_gre_tunnel_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + redundant_gre_tunnel_reference_model_json['local_bgp_asn'] = 38 + redundant_gre_tunnel_reference_model_json['local_gateway_ip'] = '10.242.63.12' + redundant_gre_tunnel_reference_model_json['local_tunnel_ip'] = '192.168.100.20' + redundant_gre_tunnel_reference_model_json['mtu'] = 9000 + redundant_gre_tunnel_reference_model_json['name'] = 'gre1' + redundant_gre_tunnel_reference_model_json['network_account_id'] = 'testString' + redundant_gre_tunnel_reference_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + redundant_gre_tunnel_reference_model_json['remote_bgp_asn'] = 65010 + redundant_gre_tunnel_reference_model_json['remote_gateway_ip'] = '10.242.33.22' + redundant_gre_tunnel_reference_model_json['remote_tunnel_ip'] = '192.168.129.1' + redundant_gre_tunnel_reference_model_json['status'] = 'attached' + redundant_gre_tunnel_reference_model_json['updated_at'] = '2019-01-01T12:00:00Z' + redundant_gre_tunnel_reference_model_json['zone'] = rgre_tunnel_zone_reference_model + + # Construct a model instance of RedundantGRETunnelReference by calling from_dict on the json representation + redundant_gre_tunnel_reference_model = RedundantGRETunnelReference.from_dict(redundant_gre_tunnel_reference_model_json) + assert redundant_gre_tunnel_reference_model != False + + # Construct a model instance of RedundantGRETunnelReference by calling from_dict on the json representation + redundant_gre_tunnel_reference_model_dict = RedundantGRETunnelReference.from_dict(redundant_gre_tunnel_reference_model_json).__dict__ + redundant_gre_tunnel_reference_model2 = RedundantGRETunnelReference(**redundant_gre_tunnel_reference_model_dict) + + # Verify the model instances are equivalent + assert redundant_gre_tunnel_reference_model == redundant_gre_tunnel_reference_model2 + + # Convert model instance back to dict and verify no loss of data + redundant_gre_tunnel_reference_model_json2 = redundant_gre_tunnel_reference_model.to_dict() + assert redundant_gre_tunnel_reference_model_json2 == redundant_gre_tunnel_reference_model_json + + class TestModel_ResourceGroupIdentity: """ Test Class for ResourceGroupIdentity @@ -3252,8 +3890,8 @@ def test_resource_group_reference_serialization(self): # Construct a json representation of a ResourceGroupReference model resource_group_reference_model_json = {} - resource_group_reference_model_json['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model_json['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model_json['id'] = '56969d6043e9465c883cb9f7363e78e8' # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation resource_group_reference_model = ResourceGroupReference.from_dict(resource_group_reference_model_json) @@ -3271,6 +3909,36 @@ def test_resource_group_reference_serialization(self): assert resource_group_reference_model_json2 == resource_group_reference_model_json +class TestModel_RgreTunnelZoneReference: + """ + Test Class for RgreTunnelZoneReference + """ + + def test_rgre_tunnel_zone_reference_serialization(self): + """ + Test serialization/deserialization for RgreTunnelZoneReference + """ + + # Construct a json representation of a RgreTunnelZoneReference model + rgre_tunnel_zone_reference_model_json = {} + rgre_tunnel_zone_reference_model_json['name'] = 'us-south-1' + + # Construct a model instance of RgreTunnelZoneReference by calling from_dict on the json representation + rgre_tunnel_zone_reference_model = RgreTunnelZoneReference.from_dict(rgre_tunnel_zone_reference_model_json) + assert rgre_tunnel_zone_reference_model != False + + # Construct a model instance of RgreTunnelZoneReference by calling from_dict on the json representation + rgre_tunnel_zone_reference_model_dict = RgreTunnelZoneReference.from_dict(rgre_tunnel_zone_reference_model_json).__dict__ + rgre_tunnel_zone_reference_model2 = RgreTunnelZoneReference(**rgre_tunnel_zone_reference_model_dict) + + # Verify the model instances are equivalent + assert rgre_tunnel_zone_reference_model == rgre_tunnel_zone_reference_model2 + + # Convert model instance back to dict and verify no loss of data + rgre_tunnel_zone_reference_model_json2 = rgre_tunnel_zone_reference_model.to_dict() + assert rgre_tunnel_zone_reference_model_json2 == rgre_tunnel_zone_reference_model_json + + class TestModel_RouteReport: """ Test Class for RouteReport @@ -3657,12 +4325,19 @@ def test_ts_location_serialization(self): ts_local_location_model['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel'] ts_local_location_model['type'] = 'region' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + zone_reference_collection_model = {} # ZoneReferenceCollection + zone_reference_collection_model['zones'] = [zone_reference_model] + # Construct a json representation of a TSLocation model ts_location_model_json = {} ts_location_model_json['billing_location'] = 'us' ts_location_model_json['name'] = 'us-south' ts_location_model_json['type'] = 'region' ts_location_model_json['local_connection_locations'] = [ts_local_location_model] + ts_location_model_json['zones'] = [zone_reference_collection_model] # Construct a model instance of TSLocation by calling from_dict on the json representation ts_location_model = TSLocation.from_dict(ts_location_model_json) @@ -3739,22 +4414,41 @@ def test_transit_connection_serialization(self): transit_gateway_reference_model['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' transit_gateway_reference_model['name'] = 'my-transit-gw100' - zone_reference_model = {} # ZoneReference - zone_reference_model['name'] = 'us-south-1' + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference + transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 + transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 + transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' + transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model + + gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference + gre_tunnel_zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a TransitConnection model transit_connection_model_json = {} + transit_connection_model_json['base_network_type'] = 'classic' + transit_connection_model_json['name'] = 'Transit_Service_BWTN_SJ_DL' + transit_connection_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_connection_model_json['network_type'] = 'vpc' + transit_connection_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model_json['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_connection_model_json['created_at'] = '2019-01-01T12:00:00Z' - transit_connection_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model_json['local_bgp_asn'] = 64490 transit_connection_model_json['local_gateway_ip'] = '192.168.100.1' transit_connection_model_json['local_tunnel_ip'] = '192.168.129.2' transit_connection_model_json['mtu'] = 9000 - transit_connection_model_json['name'] = 'Transit_Service_SJ_DL' - transit_connection_model_json['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' - transit_connection_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_connection_model_json['network_type'] = 'vpc' + transit_connection_model_json['network_account_id'] = 'testString' transit_connection_model_json['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_connection_model_json['prefix_filters_default'] = 'permit' transit_connection_model_json['remote_bgp_asn'] = 65010 @@ -3763,8 +4457,9 @@ def test_transit_connection_serialization(self): transit_connection_model_json['request_status'] = 'pending' transit_connection_model_json['status'] = 'attached' transit_connection_model_json['transit_gateway'] = transit_gateway_reference_model + transit_connection_model_json['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] transit_connection_model_json['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model_json['zone'] = zone_reference_model + transit_connection_model_json['zone'] = gre_tunnel_zone_reference_model # Construct a model instance of TransitConnection by calling from_dict on the json representation transit_connection_model = TransitConnection.from_dict(transit_connection_model_json) @@ -3809,21 +4504,40 @@ def test_transit_connection_collection_serialization(self): transit_gateway_reference_model['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' transit_gateway_reference_model['name'] = 'my-transit-gw100' - zone_reference_model = {} # ZoneReference - zone_reference_model['name'] = 'us-south-1' + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference + transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 + transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 + transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' + transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model + + gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference + gre_tunnel_zone_reference_model['name'] = 'us-south-1' transit_connection_model = {} # TransitConnection + transit_connection_model['base_network_type'] = 'classic' + transit_connection_model['name'] = 'Transit_Service_BWTN_SJ_DL' + transit_connection_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_connection_model['network_type'] = 'vpc' + transit_connection_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_connection_model['created_at'] = '2019-01-01T12:00:00Z' - transit_connection_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model['local_bgp_asn'] = 64490 transit_connection_model['local_gateway_ip'] = '192.168.100.1' transit_connection_model['local_tunnel_ip'] = '192.168.129.2' transit_connection_model['mtu'] = 9000 - transit_connection_model['name'] = 'Transit_Service_SJ_DL' - transit_connection_model['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' - transit_connection_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_connection_model['network_type'] = 'vpc' + transit_connection_model['network_account_id'] = 'testString' transit_connection_model['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_connection_model['prefix_filters_default'] = 'permit' transit_connection_model['remote_bgp_asn'] = 65010 @@ -3832,8 +4546,9 @@ def test_transit_connection_collection_serialization(self): transit_connection_model['request_status'] = 'pending' transit_connection_model['status'] = 'attached' transit_connection_model['transit_gateway'] = transit_gateway_reference_model + transit_connection_model['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] transit_connection_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model['zone'] = zone_reference_model + transit_connection_model['zone'] = gre_tunnel_zone_reference_model pagination_first_connection_model = {} # PaginationFirstConnection pagination_first_connection_model['href'] = 'https://transit.cloud.ibm.com/v1/connections?limit=50' @@ -3878,8 +4593,8 @@ def test_transit_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' # Construct a json representation of a TransitGateway model transit_gateway_model_json = {} @@ -3929,8 +4644,8 @@ def test_transit_gateway_collection_serialization(self): pagination_next_tg_model['start'] = 'MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' transit_gateway_model = {} # TransitGateway transit_gateway_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' @@ -3988,8 +4703,26 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_prefix_filter_reference_model['prefix'] = '192.168.100.0/24' transit_gateway_connection_prefix_filter_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_zone_model = {} # TransitGatewayConnectionCustZone - transit_gateway_connection_cust_zone_model['name'] = 'us-south-1' + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference + transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 + transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 + transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' + transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model + + gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference + gre_tunnel_zone_reference_model['name'] = 'us-south-1' transit_gateway_connection_cust_model = {} # TransitGatewayConnectionCust transit_gateway_connection_cust_model['base_network_type'] = 'classic' @@ -4003,7 +4736,7 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_cust_model['local_gateway_ip'] = '192.168.100.1' transit_gateway_connection_cust_model['local_tunnel_ip'] = '192.168.129.2' transit_gateway_connection_cust_model['mtu'] = 9000 - transit_gateway_connection_cust_model['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' + transit_gateway_connection_cust_model['network_account_id'] = 'testString' transit_gateway_connection_cust_model['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_gateway_connection_cust_model['prefix_filters_default'] = 'permit' transit_gateway_connection_cust_model['remote_bgp_asn'] = 65010 @@ -4011,8 +4744,9 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_cust_model['remote_tunnel_ip'] = '192.168.129.1' transit_gateway_connection_cust_model['request_status'] = 'pending' transit_gateway_connection_cust_model['status'] = 'attached' + transit_gateway_connection_cust_model['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] transit_gateway_connection_cust_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model['zone'] = transit_gateway_connection_cust_zone_model + transit_gateway_connection_cust_model['zone'] = gre_tunnel_zone_reference_model pagination_first_tgw_connection_model = {} # PaginationFirstTGWConnection pagination_first_tgw_connection_model['href'] = 'https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50' @@ -4067,8 +4801,26 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_prefix_filter_reference_model['prefix'] = '192.168.100.0/24' transit_gateway_connection_prefix_filter_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_zone_model = {} # TransitGatewayConnectionCustZone - transit_gateway_connection_cust_zone_model['name'] = 'us-south-1' + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference + transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 + transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 + transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' + transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model + + gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference + gre_tunnel_zone_reference_model['name'] = 'us-south-1' # Construct a json representation of a TransitGatewayConnectionCust model transit_gateway_connection_cust_model_json = {} @@ -4083,7 +4835,7 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_cust_model_json['local_gateway_ip'] = '192.168.100.1' transit_gateway_connection_cust_model_json['local_tunnel_ip'] = '192.168.129.2' transit_gateway_connection_cust_model_json['mtu'] = 9000 - transit_gateway_connection_cust_model_json['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' + transit_gateway_connection_cust_model_json['network_account_id'] = 'testString' transit_gateway_connection_cust_model_json['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_gateway_connection_cust_model_json['prefix_filters_default'] = 'permit' transit_gateway_connection_cust_model_json['remote_bgp_asn'] = 65010 @@ -4091,8 +4843,9 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_cust_model_json['remote_tunnel_ip'] = '192.168.129.1' transit_gateway_connection_cust_model_json['request_status'] = 'pending' transit_gateway_connection_cust_model_json['status'] = 'attached' + transit_gateway_connection_cust_model_json['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] transit_gateway_connection_cust_model_json['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model_json['zone'] = transit_gateway_connection_cust_zone_model + transit_gateway_connection_cust_model_json['zone'] = gre_tunnel_zone_reference_model # Construct a model instance of TransitGatewayConnectionCust by calling from_dict on the json representation transit_gateway_connection_cust_model = TransitGatewayConnectionCust.from_dict(transit_gateway_connection_cust_model_json) @@ -4110,36 +4863,6 @@ def test_transit_gateway_connection_cust_serialization(self): assert transit_gateway_connection_cust_model_json2 == transit_gateway_connection_cust_model_json -class TestModel_TransitGatewayConnectionCustZone: - """ - Test Class for TransitGatewayConnectionCustZone - """ - - def test_transit_gateway_connection_cust_zone_serialization(self): - """ - Test serialization/deserialization for TransitGatewayConnectionCustZone - """ - - # Construct a json representation of a TransitGatewayConnectionCustZone model - transit_gateway_connection_cust_zone_model_json = {} - transit_gateway_connection_cust_zone_model_json['name'] = 'us-south-1' - - # Construct a model instance of TransitGatewayConnectionCustZone by calling from_dict on the json representation - transit_gateway_connection_cust_zone_model = TransitGatewayConnectionCustZone.from_dict(transit_gateway_connection_cust_zone_model_json) - assert transit_gateway_connection_cust_zone_model != False - - # Construct a model instance of TransitGatewayConnectionCustZone by calling from_dict on the json representation - transit_gateway_connection_cust_zone_model_dict = TransitGatewayConnectionCustZone.from_dict(transit_gateway_connection_cust_zone_model_json).__dict__ - transit_gateway_connection_cust_zone_model2 = TransitGatewayConnectionCustZone(**transit_gateway_connection_cust_zone_model_dict) - - # Verify the model instances are equivalent - assert transit_gateway_connection_cust_zone_model == transit_gateway_connection_cust_zone_model2 - - # Convert model instance back to dict and verify no loss of data - transit_gateway_connection_cust_zone_model_json2 = transit_gateway_connection_cust_zone_model.to_dict() - assert transit_gateway_connection_cust_zone_model_json2 == transit_gateway_connection_cust_zone_model_json - - class TestModel_TransitGatewayConnectionPrefixFilter: """ Test Class for TransitGatewayConnectionPrefixFilter @@ -4210,6 +4933,94 @@ def test_transit_gateway_connection_prefix_filter_reference_serialization(self): assert transit_gateway_connection_prefix_filter_reference_model_json2 == transit_gateway_connection_prefix_filter_reference_model_json +class TestModel_TransitGatewayRedundantGRETunnelReference: + """ + Test Class for TransitGatewayRedundantGRETunnelReference + """ + + def test_transit_gateway_redundant_gre_tunnel_reference_serialization(self): + """ + Test serialization/deserialization for TransitGatewayRedundantGRETunnelReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference + rgre_tunnel_zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a TransitGatewayRedundantGRETunnelReference model + transit_gateway_redundant_gre_tunnel_reference_model_json = {} + transit_gateway_redundant_gre_tunnel_reference_model_json['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + transit_gateway_redundant_gre_tunnel_reference_model_json['local_bgp_asn'] = 38 + transit_gateway_redundant_gre_tunnel_reference_model_json['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_reference_model_json['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_reference_model_json['mtu'] = 9000 + transit_gateway_redundant_gre_tunnel_reference_model_json['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_reference_model_json['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_reference_model_json['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_reference_model_json['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_reference_model_json['status'] = 'attached' + transit_gateway_redundant_gre_tunnel_reference_model_json['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_redundant_gre_tunnel_reference_model_json['zone'] = rgre_tunnel_zone_reference_model + + # Construct a model instance of TransitGatewayRedundantGRETunnelReference by calling from_dict on the json representation + transit_gateway_redundant_gre_tunnel_reference_model = TransitGatewayRedundantGRETunnelReference.from_dict(transit_gateway_redundant_gre_tunnel_reference_model_json) + assert transit_gateway_redundant_gre_tunnel_reference_model != False + + # Construct a model instance of TransitGatewayRedundantGRETunnelReference by calling from_dict on the json representation + transit_gateway_redundant_gre_tunnel_reference_model_dict = TransitGatewayRedundantGRETunnelReference.from_dict(transit_gateway_redundant_gre_tunnel_reference_model_json).__dict__ + transit_gateway_redundant_gre_tunnel_reference_model2 = TransitGatewayRedundantGRETunnelReference(**transit_gateway_redundant_gre_tunnel_reference_model_dict) + + # Verify the model instances are equivalent + assert transit_gateway_redundant_gre_tunnel_reference_model == transit_gateway_redundant_gre_tunnel_reference_model2 + + # Convert model instance back to dict and verify no loss of data + transit_gateway_redundant_gre_tunnel_reference_model_json2 = transit_gateway_redundant_gre_tunnel_reference_model.to_dict() + assert transit_gateway_redundant_gre_tunnel_reference_model_json2 == transit_gateway_redundant_gre_tunnel_reference_model_json + + +class TestModel_TransitGatewayRedundantGRETunnelTemplate: + """ + Test Class for TransitGatewayRedundantGRETunnelTemplate + """ + + def test_transit_gateway_redundant_gre_tunnel_template_serialization(self): + """ + Test serialization/deserialization for TransitGatewayRedundantGRETunnelTemplate + """ + + # Construct dict forms of any model objects needed in order to build this model. + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + # Construct a json representation of a TransitGatewayRedundantGRETunnelTemplate model + transit_gateway_redundant_gre_tunnel_template_model_json = {} + transit_gateway_redundant_gre_tunnel_template_model_json['local_gateway_ip'] = '10.242.63.12' + transit_gateway_redundant_gre_tunnel_template_model_json['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_redundant_gre_tunnel_template_model_json['name'] = 'gre1' + transit_gateway_redundant_gre_tunnel_template_model_json['remote_bgp_asn'] = 65010 + transit_gateway_redundant_gre_tunnel_template_model_json['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_redundant_gre_tunnel_template_model_json['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_redundant_gre_tunnel_template_model_json['zone'] = zone_identity_model + + # Construct a model instance of TransitGatewayRedundantGRETunnelTemplate by calling from_dict on the json representation + transit_gateway_redundant_gre_tunnel_template_model = TransitGatewayRedundantGRETunnelTemplate.from_dict(transit_gateway_redundant_gre_tunnel_template_model_json) + assert transit_gateway_redundant_gre_tunnel_template_model != False + + # Construct a model instance of TransitGatewayRedundantGRETunnelTemplate by calling from_dict on the json representation + transit_gateway_redundant_gre_tunnel_template_model_dict = TransitGatewayRedundantGRETunnelTemplate.from_dict(transit_gateway_redundant_gre_tunnel_template_model_json).__dict__ + transit_gateway_redundant_gre_tunnel_template_model2 = TransitGatewayRedundantGRETunnelTemplate(**transit_gateway_redundant_gre_tunnel_template_model_dict) + + # Verify the model instances are equivalent + assert transit_gateway_redundant_gre_tunnel_template_model == transit_gateway_redundant_gre_tunnel_template_model2 + + # Convert model instance back to dict and verify no loss of data + transit_gateway_redundant_gre_tunnel_template_model_json2 = transit_gateway_redundant_gre_tunnel_template_model.to_dict() + assert transit_gateway_redundant_gre_tunnel_template_model_json2 == transit_gateway_redundant_gre_tunnel_template_model_json + + class TestModel_TransitGatewayReference: """ Test Class for TransitGatewayReference @@ -4272,6 +5083,41 @@ def test_zone_reference_serialization(self): assert zone_reference_model_json2 == zone_reference_model_json +class TestModel_ZoneReferenceCollection: + """ + Test Class for ZoneReferenceCollection + """ + + def test_zone_reference_collection_serialization(self): + """ + Test serialization/deserialization for ZoneReferenceCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a ZoneReferenceCollection model + zone_reference_collection_model_json = {} + zone_reference_collection_model_json['zones'] = [zone_reference_model] + + # Construct a model instance of ZoneReferenceCollection by calling from_dict on the json representation + zone_reference_collection_model = ZoneReferenceCollection.from_dict(zone_reference_collection_model_json) + assert zone_reference_collection_model != False + + # Construct a model instance of ZoneReferenceCollection by calling from_dict on the json representation + zone_reference_collection_model_dict = ZoneReferenceCollection.from_dict(zone_reference_collection_model_json).__dict__ + zone_reference_collection_model2 = ZoneReferenceCollection(**zone_reference_collection_model_dict) + + # Verify the model instances are equivalent + assert zone_reference_collection_model == zone_reference_collection_model2 + + # Convert model instance back to dict and verify no loss of data + zone_reference_collection_model_json2 = zone_reference_collection_model.to_dict() + assert zone_reference_collection_model_json2 == zone_reference_collection_model_json + + class TestModel_ZoneIdentityByName: """ Test Class for ZoneIdentityByName diff --git a/test/unit/test_zones_v1.py b/test/unit/test_zones_v1.py index 70814c2..81133e7 100644 --- a/test/unit/test_zones_v1.py +++ b/test/unit/test_zones_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2020. +# (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. @@ -13,121 +13,255 @@ # See the License for the specific language governing permissions and # limitations under the License. +""" +Unit Tests for ZonesV1 +""" + from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator import inspect import json +import os import pytest import re +import requests import responses +import urllib from ibm_cloud_networking_services.zones_v1 import * crn = 'testString' -service = ZonesV1( +_service = ZonesV1( authenticator=NoAuthAuthenticator(), - crn=crn - ) + crn=crn, +) + +_base_url = 'https://api.cis.cloud.ibm.com' +_service.set_service_url(_base_url) + + +def preprocess_url(operation_path: str): + """ + Returns the request url associated with the specified operation path. + This will be base_url concatenated with a quoted version of operation_path. + The returned request URL is used to register the mock response so it needs + to match the request URL that is formed by the requests library. + """ + # First, unquote the path since it might have some quoted/escaped characters in it + # due to how the generator inserts the operation paths into the unit test code. + operation_path = urllib.parse.unquote(operation_path) + + # Next, quote the path using urllib so that we approximate what will + # happen during request processing. + operation_path = urllib.parse.quote(operation_path, safe='/') + + # Finally, form the request URL from the base URL and operation path. + request_url = _base_url + operation_path + + # If the request url does NOT end with a /, then just return it as-is. + # Otherwise, return a regular expression that matches one or more trailing /. + if re.fullmatch('.*/+', request_url) is None: + return request_url + return re.compile(request_url.rstrip('/') + '/+') -base_url = 'https://api.cis.cloud.ibm.com' -service.set_service_url(base_url) ############################################################################## # Start of Service: CISZones ############################################################################## # region -#----------------------------------------------------------------------------- -# Test Class for list_zones -#----------------------------------------------------------------------------- -class TestListZones(): - - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') - - #-------------------------------------------------------- - # list_zones() - #-------------------------------------------------------- + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = ZonesV1.new_instance( + crn=crn, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, ZonesV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = ZonesV1.new_instance( + crn=crn, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = ZonesV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='crn must be provided'): + service = ZonesV1.new_instance( + crn=None, + ) + + +class TestListZones: + """ + Test Class for list_zones + """ + @responses.activate def test_list_zones_all_params(self): + """ + list_zones() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + page = 1 + per_page = 20 # Invoke method - response = service.list_zones() + response = _service.list_zones( + page=page, + per_page=per_page, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'page={}'.format(page) in query_string + assert 'per_page={}'.format(per_page) in query_string + + def test_list_zones_all_params_with_retries(self): + # Enable retries and run test_list_zones_all_params. + _service.enable_retries() + self.test_list_zones_all_params() + + # Disable retries and run test_list_zones_all_params. + _service.disable_retries() + self.test_list_zones_all_params() + + @responses.activate + def test_list_zones_required_params(self): + """ + test_list_zones_required_params() + """ + # Set up mock + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + # Invoke method + response = _service.list_zones() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_list_zones_required_params_with_retries(self): + # Enable retries and run test_list_zones_required_params. + _service.enable_retries() + self.test_list_zones_required_params() + + # Disable retries and run test_list_zones_required_params. + _service.disable_retries() + self.test_list_zones_required_params() - #-------------------------------------------------------- - # test_list_zones_value_error() - #-------------------------------------------------------- @responses.activate def test_list_zones_value_error(self): + """ + test_list_zones_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}' + 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_zones(**req_copy) + _service.list_zones(**req_copy) + def test_list_zones_value_error_with_retries(self): + # Enable retries and run test_list_zones_value_error. + _service.enable_retries() + self.test_list_zones_value_error() + # Disable retries and run test_list_zones_value_error. + _service.disable_retries() + self.test_list_zones_value_error() -#----------------------------------------------------------------------------- -# Test Class for create_zone -#----------------------------------------------------------------------------- -class TestCreateZone(): - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') +class TestCreateZone: + """ + Test Class for create_zone + """ - #-------------------------------------------------------- - # create_zone() - #-------------------------------------------------------- @responses.activate def test_create_zone_all_params(self): + """ + create_zone() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values name = 'test-example.com' + type = 'full' # Invoke method - response = service.create_zone( + response = _service.create_zone( name=name, - headers={} + type=type, + headers={}, ) # Check for correct operation @@ -136,108 +270,141 @@ def test_create_zone_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['name'] == 'test-example.com' + assert req_body['type'] == 'full' + + def test_create_zone_all_params_with_retries(self): + # Enable retries and run test_create_zone_all_params. + _service.enable_retries() + self.test_create_zone_all_params() + # Disable retries and run test_create_zone_all_params. + _service.disable_retries() + self.test_create_zone_all_params() - #-------------------------------------------------------- - # test_create_zone_required_params() - #-------------------------------------------------------- @responses.activate def test_create_zone_required_params(self): + """ + test_create_zone_required_params() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method - response = service.create_zone() - + response = _service.create_zone() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_create_zone_required_params_with_retries(self): + # Enable retries and run test_create_zone_required_params. + _service.enable_retries() + self.test_create_zone_required_params() + + # Disable retries and run test_create_zone_required_params. + _service.disable_retries() + self.test_create_zone_required_params() - #-------------------------------------------------------- - # test_create_zone_value_error() - #-------------------------------------------------------- @responses.activate def test_create_zone_value_error(self): + """ + test_create_zone_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.POST, + 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.create_zone(**req_copy) + _service.create_zone(**req_copy) + def test_create_zone_value_error_with_retries(self): + # Enable retries and run test_create_zone_value_error. + _service.enable_retries() + self.test_create_zone_value_error() + # Disable retries and run test_create_zone_value_error. + _service.disable_retries() + self.test_create_zone_value_error() -#----------------------------------------------------------------------------- -# Test Class for delete_zone -#----------------------------------------------------------------------------- -class TestDeleteZone(): - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') +class TestDeleteZone: + """ + Test Class for delete_zone + """ - #-------------------------------------------------------- - # delete_zone() - #-------------------------------------------------------- @responses.activate def test_delete_zone_all_params(self): + """ + delete_zone() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') + url = preprocess_url('/v1/testString/zones/testString') mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc"}}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' # Invoke method - response = service.delete_zone( + response = _service.delete_zone( zone_identifier, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_delete_zone_all_params_with_retries(self): + # Enable retries and run test_delete_zone_all_params. + _service.enable_retries() + self.test_delete_zone_all_params() + + # Disable retries and run test_delete_zone_all_params. + _service.disable_retries() + self.test_delete_zone_all_params() - #-------------------------------------------------------- - # test_delete_zone_value_error() - #-------------------------------------------------------- @responses.activate def test_delete_zone_value_error(self): + """ + test_delete_zone_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') + url = preprocess_url('/v1/testString/zones/testString') mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc"}}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' @@ -247,65 +414,78 @@ def test_delete_zone_value_error(self): "zone_identifier": zone_identifier, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_zone(**req_copy) + _service.delete_zone(**req_copy) + def test_delete_zone_value_error_with_retries(self): + # Enable retries and run test_delete_zone_value_error. + _service.enable_retries() + self.test_delete_zone_value_error() + # Disable retries and run test_delete_zone_value_error. + _service.disable_retries() + self.test_delete_zone_value_error() -#----------------------------------------------------------------------------- -# Test Class for get_zone -#----------------------------------------------------------------------------- -class TestGetZone(): - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') +class TestGetZone: + """ + Test Class for get_zone + """ - #-------------------------------------------------------- - # get_zone() - #-------------------------------------------------------- @responses.activate def test_get_zone_all_params(self): + """ + get_zone() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones/testString') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' # Invoke method - response = service.get_zone( + response = _service.get_zone( zone_identifier, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_get_zone_all_params_with_retries(self): + # Enable retries and run test_get_zone_all_params. + _service.enable_retries() + self.test_get_zone_all_params() + + # Disable retries and run test_get_zone_all_params. + _service.disable_retries() + self.test_get_zone_all_params() - #-------------------------------------------------------- - # test_get_zone_value_error() - #-------------------------------------------------------- @responses.activate def test_get_zone_value_error(self): + """ + test_get_zone_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones/testString') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' @@ -315,47 +495,50 @@ def test_get_zone_value_error(self): "zone_identifier": zone_identifier, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_zone(**req_copy) + _service.get_zone(**req_copy) + def test_get_zone_value_error_with_retries(self): + # Enable retries and run test_get_zone_value_error. + _service.enable_retries() + self.test_get_zone_value_error() + # Disable retries and run test_get_zone_value_error. + _service.disable_retries() + self.test_get_zone_value_error() -#----------------------------------------------------------------------------- -# Test Class for update_zone -#----------------------------------------------------------------------------- -class TestUpdateZone(): - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') +class TestUpdateZone: + """ + Test Class for update_zone + """ - #-------------------------------------------------------- - # update_zone() - #-------------------------------------------------------- @responses.activate def test_update_zone_all_params(self): + """ + update_zone() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones/testString') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' paused = False # Invoke method - response = service.update_zone( + response = _service.update_zone( zone_identifier, paused=paused, - headers={} + headers={}, ) # Check for correct operation @@ -365,48 +548,68 @@ def test_update_zone_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['paused'] == False + def test_update_zone_all_params_with_retries(self): + # Enable retries and run test_update_zone_all_params. + _service.enable_retries() + self.test_update_zone_all_params() + + # Disable retries and run test_update_zone_all_params. + _service.disable_retries() + self.test_update_zone_all_params() - #-------------------------------------------------------- - # test_update_zone_required_params() - #-------------------------------------------------------- @responses.activate def test_update_zone_required_params(self): + """ + test_update_zone_required_params() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones/testString') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' # Invoke method - response = service.update_zone( + response = _service.update_zone( zone_identifier, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_update_zone_required_params_with_retries(self): + # Enable retries and run test_update_zone_required_params. + _service.enable_retries() + self.test_update_zone_required_params() + + # Disable retries and run test_update_zone_required_params. + _service.disable_retries() + self.test_update_zone_required_params() - #-------------------------------------------------------- - # test_update_zone_value_error() - #-------------------------------------------------------- @responses.activate def test_update_zone_value_error(self): + """ + test_update_zone_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString') - mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"]}}' - responses.add(responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200) + url = preprocess_url('/v1/testString/zones/testString') + mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "test-example.com", "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "status": "active", "paused": false, "original_name_servers": ["ns1.originaldnshost.com"], "name_servers": ["ns001.name.cloud.ibm.com"], "type": "full", "verification_key": "476754457-428595283", "cname_suffix": "cdn.cloudflare.net"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' @@ -416,65 +619,78 @@ def test_update_zone_value_error(self): "zone_identifier": zone_identifier, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + 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_zone(**req_copy) + _service.update_zone(**req_copy) + def test_update_zone_value_error_with_retries(self): + # Enable retries and run test_update_zone_value_error. + _service.enable_retries() + self.test_update_zone_value_error() + # Disable retries and run test_update_zone_value_error. + _service.disable_retries() + self.test_update_zone_value_error() -#----------------------------------------------------------------------------- -# Test Class for zone_activation_check -#----------------------------------------------------------------------------- -class TestZoneActivationCheck(): - # Preprocess the request URL to ensure the mock response will be found. - def preprocess_url(self, request_url: str): - if re.fullmatch('.*/+', request_url) is None: - return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') +class TestZoneActivationCheck: + """ + Test Class for zone_activation_check + """ - #-------------------------------------------------------- - # zone_activation_check() - #-------------------------------------------------------- @responses.activate def test_zone_activation_check_all_params(self): + """ + zone_activation_check() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString/activation_check') + url = preprocess_url('/v1/testString/zones/testString/activation_check') mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc"}}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' # Invoke method - response = service.zone_activation_check( + response = _service.zone_activation_check( zone_identifier, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + def test_zone_activation_check_all_params_with_retries(self): + # Enable retries and run test_zone_activation_check_all_params. + _service.enable_retries() + self.test_zone_activation_check_all_params() + + # Disable retries and run test_zone_activation_check_all_params. + _service.disable_retries() + self.test_zone_activation_check_all_params() - #-------------------------------------------------------- - # test_zone_activation_check_value_error() - #-------------------------------------------------------- @responses.activate def test_zone_activation_check_value_error(self): + """ + test_zone_activation_check_value_error() + """ # Set up mock - url = self.preprocess_url(base_url + '/v1/testString/zones/testString/activation_check') + url = preprocess_url('/v1/testString/zones/testString/activation_check') mock_response = '{"success": true, "errors": [["errors"]], "messages": [["messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc"}}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values zone_identifier = 'testString' @@ -484,10 +700,18 @@ def test_zone_activation_check_value_error(self): "zone_identifier": zone_identifier, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - service.zone_activation_check(**req_copy) + _service.zone_activation_check(**req_copy) + def test_zone_activation_check_value_error_with_retries(self): + # Enable retries and run test_zone_activation_check_value_error. + _service.enable_retries() + self.test_zone_activation_check_value_error() + + # Disable retries and run test_zone_activation_check_value_error. + _service.disable_retries() + self.test_zone_activation_check_value_error() # endregion @@ -500,15 +724,17 @@ def test_zone_activation_check_value_error(self): # Start of Model Tests ############################################################################## # region -#----------------------------------------------------------------------------- -# Test Class for DeleteZoneRespResult -#----------------------------------------------------------------------------- -class TestDeleteZoneRespResult(): - - #-------------------------------------------------------- - # Test serialization/deserialization for DeleteZoneRespResult - #-------------------------------------------------------- + + +class TestModel_DeleteZoneRespResult: + """ + Test Class for DeleteZoneRespResult + """ + def test_delete_zone_resp_result_serialization(self): + """ + Test serialization/deserialization for DeleteZoneRespResult + """ # Construct a json representation of a DeleteZoneRespResult model delete_zone_resp_result_model_json = {} @@ -529,15 +755,16 @@ def test_delete_zone_resp_result_serialization(self): delete_zone_resp_result_model_json2 = delete_zone_resp_result_model.to_dict() assert delete_zone_resp_result_model_json2 == delete_zone_resp_result_model_json -#----------------------------------------------------------------------------- -# Test Class for ZoneActivationcheckRespResult -#----------------------------------------------------------------------------- -class TestZoneActivationcheckRespResult(): - #-------------------------------------------------------- - # Test serialization/deserialization for ZoneActivationcheckRespResult - #-------------------------------------------------------- +class TestModel_ZoneActivationcheckRespResult: + """ + Test Class for ZoneActivationcheckRespResult + """ + def test_zone_activationcheck_resp_result_serialization(self): + """ + Test serialization/deserialization for ZoneActivationcheckRespResult + """ # Construct a json representation of a ZoneActivationcheckRespResult model zone_activationcheck_resp_result_model_json = {} @@ -558,19 +785,20 @@ def test_zone_activationcheck_resp_result_serialization(self): zone_activationcheck_resp_result_model_json2 = zone_activationcheck_resp_result_model.to_dict() assert zone_activationcheck_resp_result_model_json2 == zone_activationcheck_resp_result_model_json -#----------------------------------------------------------------------------- -# Test Class for DeleteZoneResp -#----------------------------------------------------------------------------- -class TestDeleteZoneResp(): - #-------------------------------------------------------- - # Test serialization/deserialization for DeleteZoneResp - #-------------------------------------------------------- +class TestModel_DeleteZoneResp: + """ + Test Class for DeleteZoneResp + """ + def test_delete_zone_resp_serialization(self): + """ + Test serialization/deserialization for DeleteZoneResp + """ # Construct dict forms of any model objects needed in order to build this model. - delete_zone_resp_result_model = {} # DeleteZoneRespResult + delete_zone_resp_result_model = {} # DeleteZoneRespResult delete_zone_resp_result_model['id'] = 'f1aba936b94213e5b8dca0c0dbf1f9cc' # Construct a json representation of a DeleteZoneResp model @@ -595,25 +823,20 @@ def test_delete_zone_resp_serialization(self): delete_zone_resp_model_json2 = delete_zone_resp_model.to_dict() assert delete_zone_resp_model_json2 == delete_zone_resp_model_json -#----------------------------------------------------------------------------- -# Test Class for ListZonesResp -#----------------------------------------------------------------------------- -class TestListZonesResp(): - #-------------------------------------------------------- - # Test serialization/deserialization for ListZonesResp - #-------------------------------------------------------- +class TestModel_ListZonesResp: + """ + Test Class for ListZonesResp + """ + def test_list_zones_resp_serialization(self): + """ + Test serialization/deserialization for ListZonesResp + """ # Construct dict forms of any model objects needed in order to build this model. - result_info_model = {} # ResultInfo - result_info_model['page'] = 1 - result_info_model['per_page'] = 20 - result_info_model['count'] = 1 - result_info_model['total_count'] = 2000 - - zone_details_model = {} # ZoneDetails + zone_details_model = {} # ZoneDetails zone_details_model['id'] = 'f1aba936b94213e5b8dca0c0dbf1f9cc' zone_details_model['created_on'] = '2014-01-01T05:20:00.12345Z' zone_details_model['modified_on'] = '2014-01-01T05:20:00.12345Z' @@ -624,6 +847,15 @@ def test_list_zones_resp_serialization(self): zone_details_model['paused'] = False zone_details_model['original_name_servers'] = ['ns1.originaldnshost.com'] zone_details_model['name_servers'] = ['ns001.name.cloud.ibm.com'] + zone_details_model['type'] = 'full' + zone_details_model['verification_key'] = '476754457-428595283' + zone_details_model['cname_suffix'] = 'cdn.cloudflare.net' + + result_info_model = {} # ResultInfo + result_info_model['page'] = 1 + result_info_model['per_page'] = 20 + result_info_model['count'] = 1 + result_info_model['total_count'] = 2000 # Construct a json representation of a ListZonesResp model list_zones_resp_model_json = {} @@ -648,15 +880,16 @@ def test_list_zones_resp_serialization(self): list_zones_resp_model_json2 = list_zones_resp_model.to_dict() assert list_zones_resp_model_json2 == list_zones_resp_model_json -#----------------------------------------------------------------------------- -# Test Class for ResultInfo -#----------------------------------------------------------------------------- -class TestResultInfo(): - #-------------------------------------------------------- - # Test serialization/deserialization for ResultInfo - #-------------------------------------------------------- +class TestModel_ResultInfo: + """ + Test Class for ResultInfo + """ + def test_result_info_serialization(self): + """ + Test serialization/deserialization for ResultInfo + """ # Construct a json representation of a ResultInfo model result_info_model_json = {} @@ -680,19 +913,20 @@ def test_result_info_serialization(self): result_info_model_json2 = result_info_model.to_dict() assert result_info_model_json2 == result_info_model_json -#----------------------------------------------------------------------------- -# Test Class for ZoneActivationcheckResp -#----------------------------------------------------------------------------- -class TestZoneActivationcheckResp(): - #-------------------------------------------------------- - # Test serialization/deserialization for ZoneActivationcheckResp - #-------------------------------------------------------- +class TestModel_ZoneActivationcheckResp: + """ + Test Class for ZoneActivationcheckResp + """ + def test_zone_activationcheck_resp_serialization(self): + """ + Test serialization/deserialization for ZoneActivationcheckResp + """ # Construct dict forms of any model objects needed in order to build this model. - zone_activationcheck_resp_result_model = {} # ZoneActivationcheckRespResult + zone_activationcheck_resp_result_model = {} # ZoneActivationcheckRespResult zone_activationcheck_resp_result_model['id'] = 'f1aba936b94213e5b8dca0c0dbf1f9cc' # Construct a json representation of a ZoneActivationcheckResp model @@ -717,15 +951,16 @@ def test_zone_activationcheck_resp_serialization(self): zone_activationcheck_resp_model_json2 = zone_activationcheck_resp_model.to_dict() assert zone_activationcheck_resp_model_json2 == zone_activationcheck_resp_model_json -#----------------------------------------------------------------------------- -# Test Class for ZoneDetails -#----------------------------------------------------------------------------- -class TestZoneDetails(): - #-------------------------------------------------------- - # Test serialization/deserialization for ZoneDetails - #-------------------------------------------------------- +class TestModel_ZoneDetails: + """ + Test Class for ZoneDetails + """ + def test_zone_details_serialization(self): + """ + Test serialization/deserialization for ZoneDetails + """ # Construct a json representation of a ZoneDetails model zone_details_model_json = {} @@ -739,6 +974,9 @@ def test_zone_details_serialization(self): zone_details_model_json['paused'] = False zone_details_model_json['original_name_servers'] = ['ns1.originaldnshost.com'] zone_details_model_json['name_servers'] = ['ns001.name.cloud.ibm.com'] + zone_details_model_json['type'] = 'full' + zone_details_model_json['verification_key'] = '476754457-428595283' + zone_details_model_json['cname_suffix'] = 'cdn.cloudflare.net' # Construct a model instance of ZoneDetails by calling from_dict on the json representation zone_details_model = ZoneDetails.from_dict(zone_details_model_json) @@ -755,19 +993,20 @@ def test_zone_details_serialization(self): zone_details_model_json2 = zone_details_model.to_dict() assert zone_details_model_json2 == zone_details_model_json -#----------------------------------------------------------------------------- -# Test Class for ZoneResp -#----------------------------------------------------------------------------- -class TestZoneResp(): - #-------------------------------------------------------- - # Test serialization/deserialization for ZoneResp - #-------------------------------------------------------- +class TestModel_ZoneResp: + """ + Test Class for ZoneResp + """ + def test_zone_resp_serialization(self): + """ + Test serialization/deserialization for ZoneResp + """ # Construct dict forms of any model objects needed in order to build this model. - zone_details_model = {} # ZoneDetails + zone_details_model = {} # ZoneDetails zone_details_model['id'] = 'f1aba936b94213e5b8dca0c0dbf1f9cc' zone_details_model['created_on'] = '2014-01-01T05:20:00.12345Z' zone_details_model['modified_on'] = '2014-01-01T05:20:00.12345Z' @@ -778,6 +1017,9 @@ def test_zone_resp_serialization(self): zone_details_model['paused'] = False zone_details_model['original_name_servers'] = ['ns1.originaldnshost.com'] zone_details_model['name_servers'] = ['ns001.name.cloud.ibm.com'] + zone_details_model['type'] = 'full' + zone_details_model['verification_key'] = '476754457-428595283' + zone_details_model['cname_suffix'] = 'cdn.cloudflare.net' # Construct a json representation of a ZoneResp model zone_resp_model_json = {}