From 707a32074f21d69106476bf1bbc97aa9e2dfeeb6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:25:23 -0600 Subject: [PATCH 01/19] chore(python): configure release-please on previous major versions (#116) Source-Link: https://github.com/googleapis/synthtool/commit/c1dd87e9287f8de99930d3046dd555c4d03384c6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7..8807627 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e..6def37a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,8 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v0 + handleGHRelease: true + releaseType: python From f28c7dbb12657cb7eaeba0c85d594bc3fb989f1b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 23:56:10 +0000 Subject: [PATCH 02/19] chore(python): use black==22.3.0 (#117) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 5 +- .../api_gateway_service/async_client.py | 147 ++- .../services/api_gateway_service/client.py | 211 +++- .../api_gateway_service/transports/base.py | 57 +- .../api_gateway_service/transports/grpc.py | 3 +- .../cloud/apigateway_v1/types/apigateway.py | 459 +++++-- .../apigateway_v1/types/apigateway_service.py | 5 +- noxfile.py | 9 +- .../apigateway_v1/test_api_gateway_service.py | 1071 +++++++++++++---- 10 files changed, 1530 insertions(+), 439 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8807627..87dd006 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index 0f44f74..58f89d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -361,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index e4448c5..5c806e8 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -312,12 +312,20 @@ def sample_list_gateways(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListGatewaysAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -412,7 +420,12 @@ def sample_get_gateway(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -530,7 +543,8 @@ def sample_create_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -545,7 +559,12 @@ def sample_create_gateway(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -660,7 +679,8 @@ def sample_update_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -677,7 +697,12 @@ def sample_update_gateway(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -786,7 +811,8 @@ def sample_delete_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -801,7 +827,12 @@ def sample_delete_gateway(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -903,12 +934,20 @@ def sample_list_apis(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListApisAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -999,7 +1038,12 @@ def sample_get_api(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1110,7 +1154,8 @@ def sample_create_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1125,7 +1170,12 @@ def sample_create_api(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1235,7 +1285,8 @@ def sample_update_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1250,7 +1301,12 @@ def sample_update_api(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1359,7 +1415,8 @@ def sample_delete_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1374,7 +1431,12 @@ def sample_delete_api(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1476,12 +1538,20 @@ def sample_list_api_configs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListApiConfigsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1573,7 +1643,12 @@ def sample_get_api_config(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1685,7 +1760,8 @@ def sample_create_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1700,7 +1776,12 @@ def sample_create_api_config(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1809,7 +1890,8 @@ def sample_update_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1826,7 +1908,12 @@ def sample_update_api_config(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1935,7 +2022,8 @@ def sample_delete_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1950,7 +2038,12 @@ def sample_delete_api_config(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/client.py b/google/cloud/apigateway_v1/services/api_gateway_service/client.py index 35f7eb1..d605d83 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/client.py @@ -61,7 +61,8 @@ class ApiGatewayServiceClientMeta(type): _transport_registry["grpc_asyncio"] = ApiGatewayServiceGrpcAsyncIOTransport def get_transport_class( - cls, label: str = None, + cls, + label: str = None, ) -> Type[ApiGatewayServiceTransport]: """Returns an appropriate transport class. @@ -169,10 +170,14 @@ def transport(self) -> ApiGatewayServiceTransport: return self._transport @staticmethod - def api_path(project: str, api: str,) -> str: + def api_path( + project: str, + api: str, + ) -> str: """Returns a fully-qualified api string.""" return "projects/{project}/locations/global/apis/{api}".format( - project=project, api=api, + project=project, + api=api, ) @staticmethod @@ -184,10 +189,16 @@ def parse_api_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def api_config_path(project: str, api: str, api_config: str,) -> str: + def api_config_path( + project: str, + api: str, + api_config: str, + ) -> str: """Returns a fully-qualified api_config string.""" return "projects/{project}/locations/global/apis/{api}/configs/{api_config}".format( - project=project, api=api, api_config=api_config, + project=project, + api=api, + api_config=api_config, ) @staticmethod @@ -200,10 +211,16 @@ def parse_api_config_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def gateway_path(project: str, location: str, gateway: str,) -> str: + def gateway_path( + project: str, + location: str, + gateway: str, + ) -> str: """Returns a fully-qualified gateway string.""" return "projects/{project}/locations/{location}/gateways/{gateway}".format( - project=project, location=location, gateway=gateway, + project=project, + location=location, + gateway=gateway, ) @staticmethod @@ -216,9 +233,13 @@ def parse_gateway_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def managed_service_path(service: str,) -> str: + def managed_service_path( + service: str, + ) -> str: """Returns a fully-qualified managed_service string.""" - return "services/{service}".format(service=service,) + return "services/{service}".format( + service=service, + ) @staticmethod def parse_managed_service_path(path: str) -> Dict[str, str]: @@ -227,10 +248,14 @@ def parse_managed_service_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def service_path(service: str, config: str,) -> str: + def service_path( + service: str, + config: str, + ) -> str: """Returns a fully-qualified service string.""" return "services/{service}/configs/{config}".format( - service=service, config=config, + service=service, + config=config, ) @staticmethod @@ -240,10 +265,14 @@ def parse_service_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def service_account_path(project: str, service_account: str,) -> str: + def service_account_path( + project: str, + service_account: str, + ) -> str: """Returns a fully-qualified service_account string.""" return "projects/{project}/serviceAccounts/{service_account}".format( - project=project, service_account=service_account, + project=project, + service_account=service_account, ) @staticmethod @@ -256,7 +285,9 @@ def parse_service_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -269,9 +300,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -280,9 +315,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -291,9 +330,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -302,10 +345,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -568,12 +615,20 @@ def sample_list_gateways(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListGatewaysPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -668,7 +723,12 @@ def sample_get_gateway(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -792,7 +852,12 @@ def sample_create_gateway(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -915,7 +980,12 @@ def sample_update_gateway(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1030,7 +1100,12 @@ def sample_delete_gateway(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1132,12 +1207,20 @@ def sample_list_apis(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListApisPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1228,7 +1311,12 @@ def sample_get_api(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1345,7 +1433,12 @@ def sample_create_api(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1461,7 +1554,12 @@ def sample_update_api(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1576,7 +1674,12 @@ def sample_delete_api(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1678,12 +1781,20 @@ def sample_list_api_configs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListApiConfigsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1775,7 +1886,12 @@ def sample_get_api_config(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1893,7 +2009,12 @@ def sample_create_api_config(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2010,7 +2131,12 @@ def sample_update_api_config(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2125,7 +2251,12 @@ def sample_delete_api_config(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py index 92f629d..b04f2d7 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py @@ -123,10 +123,14 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.list_gateways: gapic_v1.method.wrap_method( - self.list_gateways, default_timeout=None, client_info=client_info, + self.list_gateways, + default_timeout=None, + client_info=client_info, ), self.get_gateway: gapic_v1.method.wrap_method( - self.get_gateway, default_timeout=None, client_info=client_info, + self.get_gateway, + default_timeout=None, + client_info=client_info, ), self.create_gateway: gapic_v1.method.wrap_method( self.create_gateway, @@ -135,7 +139,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -149,7 +154,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -163,7 +169,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -171,10 +178,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.list_apis: gapic_v1.method.wrap_method( - self.list_apis, default_timeout=None, client_info=client_info, + self.list_apis, + default_timeout=None, + client_info=client_info, ), self.get_api: gapic_v1.method.wrap_method( - self.get_api, default_timeout=None, client_info=client_info, + self.get_api, + default_timeout=None, + client_info=client_info, ), self.create_api: gapic_v1.method.wrap_method( self.create_api, @@ -183,7 +194,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -197,7 +209,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -211,7 +224,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -219,10 +233,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.list_api_configs: gapic_v1.method.wrap_method( - self.list_api_configs, default_timeout=None, client_info=client_info, + self.list_api_configs, + default_timeout=None, + client_info=client_info, ), self.get_api_config: gapic_v1.method.wrap_method( - self.get_api_config, default_timeout=None, client_info=client_info, + self.get_api_config, + default_timeout=None, + client_info=client_info, ), self.create_api_config: gapic_v1.method.wrap_method( self.create_api_config, @@ -231,7 +249,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -245,7 +264,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -259,7 +279,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, core_exceptions.Unknown, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -271,9 +292,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py index 63bb66b..1a90a9d 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/apigateway_v1/types/apigateway.py b/google/cloud/apigateway_v1/types/apigateway.py index 35aaa08..203956a 100644 --- a/google/cloud/apigateway_v1/types/apigateway.py +++ b/google/cloud/apigateway_v1/types/apigateway.py @@ -87,13 +87,38 @@ class State(proto.Enum): DELETING = 4 UPDATING = 5 - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - managed_service = proto.Field(proto.STRING, number=7,) - state = proto.Field(proto.ENUM, number=12, enum=State,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + managed_service = proto.Field( + proto.STRING, + number=7, + ) + state = proto.Field( + proto.ENUM, + number=12, + enum=State, + ) class ApiConfig(proto.Message): @@ -175,8 +200,14 @@ class File(proto.Message): The bytes that constitute the file. """ - path = proto.Field(proto.STRING, number=1,) - contents = proto.Field(proto.BYTES, number=2,) + path = proto.Field( + proto.STRING, + number=1, + ) + contents = proto.Field( + proto.BYTES, + number=2, + ) class OpenApiDocument(proto.Message): r"""An OpenAPI Specification Document describing an API. @@ -186,7 +217,11 @@ class OpenApiDocument(proto.Message): The OpenAPI Specification document file. """ - document = proto.Field(proto.MESSAGE, number=1, message="ApiConfig.File",) + document = proto.Field( + proto.MESSAGE, + number=1, + message="ApiConfig.File", + ) class GrpcServiceDefinition(proto.Message): r"""A gRPC service definition. @@ -209,26 +244,66 @@ class GrpcServiceDefinition(proto.Message): """ file_descriptor_set = proto.Field( - proto.MESSAGE, number=1, message="ApiConfig.File", + proto.MESSAGE, + number=1, + message="ApiConfig.File", + ) + source = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ApiConfig.File", ) - source = proto.RepeatedField(proto.MESSAGE, number=2, message="ApiConfig.File",) - - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - gateway_service_account = proto.Field(proto.STRING, number=14,) - service_config_id = proto.Field(proto.STRING, number=12,) - state = proto.Field(proto.ENUM, number=8, enum=State,) + + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + gateway_service_account = proto.Field( + proto.STRING, + number=14, + ) + service_config_id = proto.Field( + proto.STRING, + number=12, + ) + state = proto.Field( + proto.ENUM, + number=8, + enum=State, + ) openapi_documents = proto.RepeatedField( - proto.MESSAGE, number=9, message=OpenApiDocument, + proto.MESSAGE, + number=9, + message=OpenApiDocument, ) grpc_services = proto.RepeatedField( - proto.MESSAGE, number=10, message=GrpcServiceDefinition, + proto.MESSAGE, + number=10, + message=GrpcServiceDefinition, ) managed_service_configs = proto.RepeatedField( - proto.MESSAGE, number=11, message=File, + proto.MESSAGE, + number=11, + message=File, ) @@ -274,14 +349,42 @@ class State(proto.Enum): DELETING = 4 UPDATING = 5 - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - api_config = proto.Field(proto.STRING, number=6,) - state = proto.Field(proto.ENUM, number=7, enum=State,) - default_hostname = proto.Field(proto.STRING, number=9,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + api_config = proto.Field( + proto.STRING, + number=6, + ) + state = proto.Field( + proto.ENUM, + number=7, + enum=State, + ) + default_hostname = proto.Field( + proto.STRING, + number=9, + ) class ListGatewaysRequest(proto.Message): @@ -301,11 +404,26 @@ class ListGatewaysRequest(proto.Message): Order by parameters. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListGatewaysResponse(proto.Message): @@ -324,9 +442,19 @@ class ListGatewaysResponse(proto.Message): def raw_page(self): return self - gateways = proto.RepeatedField(proto.MESSAGE, number=1, message="Gateway",) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable_locations = proto.RepeatedField(proto.STRING, number=3,) + gateways = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Gateway", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable_locations = proto.RepeatedField( + proto.STRING, + number=3, + ) class GetGatewayRequest(proto.Message): @@ -338,7 +466,10 @@ class GetGatewayRequest(proto.Message): ``projects/*/locations/*/gateways/*`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateGatewayRequest(proto.Message): @@ -356,9 +487,19 @@ class CreateGatewayRequest(proto.Message): Required. Gateway resource. """ - parent = proto.Field(proto.STRING, number=1,) - gateway_id = proto.Field(proto.STRING, number=2,) - gateway = proto.Field(proto.MESSAGE, number=3, message="Gateway",) + parent = proto.Field( + proto.STRING, + number=1, + ) + gateway_id = proto.Field( + proto.STRING, + number=2, + ) + gateway = proto.Field( + proto.MESSAGE, + number=3, + message="Gateway", + ) class UpdateGatewayRequest(proto.Message): @@ -377,9 +518,15 @@ class UpdateGatewayRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + gateway = proto.Field( + proto.MESSAGE, + number=2, + message="Gateway", ) - gateway = proto.Field(proto.MESSAGE, number=2, message="Gateway",) class DeleteGatewayRequest(proto.Message): @@ -391,7 +538,10 @@ class DeleteGatewayRequest(proto.Message): ``projects/*/locations/*/gateways/*`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListApisRequest(proto.Message): @@ -411,11 +561,26 @@ class ListApisRequest(proto.Message): Order by parameters. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListApisResponse(proto.Message): @@ -434,9 +599,19 @@ class ListApisResponse(proto.Message): def raw_page(self): return self - apis = proto.RepeatedField(proto.MESSAGE, number=1, message="Api",) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable_locations = proto.RepeatedField(proto.STRING, number=3,) + apis = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Api", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable_locations = proto.RepeatedField( + proto.STRING, + number=3, + ) class GetApiRequest(proto.Message): @@ -448,7 +623,10 @@ class GetApiRequest(proto.Message): ``projects/*/locations/global/apis/*`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateApiRequest(proto.Message): @@ -466,9 +644,19 @@ class CreateApiRequest(proto.Message): Required. API resource. """ - parent = proto.Field(proto.STRING, number=1,) - api_id = proto.Field(proto.STRING, number=2,) - api = proto.Field(proto.MESSAGE, number=3, message="Api",) + parent = proto.Field( + proto.STRING, + number=1, + ) + api_id = proto.Field( + proto.STRING, + number=2, + ) + api = proto.Field( + proto.MESSAGE, + number=3, + message="Api", + ) class UpdateApiRequest(proto.Message): @@ -487,9 +675,15 @@ class UpdateApiRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + api = proto.Field( + proto.MESSAGE, + number=2, + message="Api", ) - api = proto.Field(proto.MESSAGE, number=2, message="Api",) class DeleteApiRequest(proto.Message): @@ -501,7 +695,10 @@ class DeleteApiRequest(proto.Message): ``projects/*/locations/global/apis/*`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListApiConfigsRequest(proto.Message): @@ -521,11 +718,26 @@ class ListApiConfigsRequest(proto.Message): Order by parameters. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListApiConfigsResponse(proto.Message): @@ -544,9 +756,19 @@ class ListApiConfigsResponse(proto.Message): def raw_page(self): return self - api_configs = proto.RepeatedField(proto.MESSAGE, number=1, message="ApiConfig",) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable_locations = proto.RepeatedField(proto.STRING, number=3,) + api_configs = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="ApiConfig", + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable_locations = proto.RepeatedField( + proto.STRING, + number=3, + ) class GetApiConfigRequest(proto.Message): @@ -569,8 +791,15 @@ class ConfigView(proto.Enum): BASIC = 1 FULL = 2 - name = proto.Field(proto.STRING, number=1,) - view = proto.Field(proto.ENUM, number=3, enum=ConfigView,) + name = proto.Field( + proto.STRING, + number=1, + ) + view = proto.Field( + proto.ENUM, + number=3, + enum=ConfigView, + ) class CreateApiConfigRequest(proto.Message): @@ -588,9 +817,19 @@ class CreateApiConfigRequest(proto.Message): Required. API resource. """ - parent = proto.Field(proto.STRING, number=1,) - api_config_id = proto.Field(proto.STRING, number=2,) - api_config = proto.Field(proto.MESSAGE, number=3, message="ApiConfig",) + parent = proto.Field( + proto.STRING, + number=1, + ) + api_config_id = proto.Field( + proto.STRING, + number=2, + ) + api_config = proto.Field( + proto.MESSAGE, + number=3, + message="ApiConfig", + ) class UpdateApiConfigRequest(proto.Message): @@ -609,9 +848,15 @@ class UpdateApiConfigRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + api_config = proto.Field( + proto.MESSAGE, + number=2, + message="ApiConfig", ) - api_config = proto.Field(proto.MESSAGE, number=2, message="ApiConfig",) class DeleteApiConfigRequest(proto.Message): @@ -623,7 +868,10 @@ class DeleteApiConfigRequest(proto.Message): ``projects/*/locations/global/apis/*/configs/*`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class OperationMetadata(proto.Message): @@ -669,17 +917,50 @@ class Diagnostic(proto.Message): The diagnostic message. """ - location = proto.Field(proto.STRING, number=1,) - message = proto.Field(proto.STRING, number=2,) - - create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - target = proto.Field(proto.STRING, number=3,) - verb = proto.Field(proto.STRING, number=4,) - status_message = proto.Field(proto.STRING, number=5,) - requested_cancellation = proto.Field(proto.BOOL, number=6,) - api_version = proto.Field(proto.STRING, number=7,) - diagnostics = proto.RepeatedField(proto.MESSAGE, number=8, message=Diagnostic,) + location = proto.Field( + proto.STRING, + number=1, + ) + message = proto.Field( + proto.STRING, + number=2, + ) + + create_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + target = proto.Field( + proto.STRING, + number=3, + ) + verb = proto.Field( + proto.STRING, + number=4, + ) + status_message = proto.Field( + proto.STRING, + number=5, + ) + requested_cancellation = proto.Field( + proto.BOOL, + number=6, + ) + api_version = proto.Field( + proto.STRING, + number=7, + ) + diagnostics = proto.RepeatedField( + proto.MESSAGE, + number=8, + message=Diagnostic, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/apigateway_v1/types/apigateway_service.py b/google/cloud/apigateway_v1/types/apigateway_service.py index df16cc1..626a495 100644 --- a/google/cloud/apigateway_v1/types/apigateway_service.py +++ b/google/cloud/apigateway_v1/types/apigateway_service.py @@ -15,7 +15,10 @@ # -__protobuf__ = proto.module(package="google.cloud.apigateway.v1", manifest={},) +__protobuf__ = proto.module( + package="google.cloud.apigateway.v1", + manifest={}, +) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index 2a2001c..3addb4e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) diff --git a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index ee3553c..92fbc49 100644 --- a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -97,7 +97,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ApiGatewayServiceClient, ApiGatewayServiceAsyncClient,] + "client_class", + [ + ApiGatewayServiceClient, + ApiGatewayServiceAsyncClient, + ], ) def test_api_gateway_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -139,7 +143,11 @@ def test_api_gateway_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [ApiGatewayServiceClient, ApiGatewayServiceAsyncClient,] + "client_class", + [ + ApiGatewayServiceClient, + ApiGatewayServiceAsyncClient, + ], ) def test_api_gateway_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -513,7 +521,9 @@ def test_api_gateway_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -653,10 +663,17 @@ def test_api_gateway_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [apigateway.ListGatewaysRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.ListGatewaysRequest, + dict, + ], +) def test_list_gateways(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -687,7 +704,8 @@ def test_list_gateways_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -703,7 +721,8 @@ async def test_list_gateways_async( transport: str = "grpc_asyncio", request_type=apigateway.ListGatewaysRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -738,7 +757,9 @@ async def test_list_gateways_async_from_dict(): def test_list_gateways_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -758,7 +779,10 @@ def test_list_gateways_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -787,11 +811,16 @@ async def test_list_gateways_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_gateways_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_gateways), "__call__") as call: @@ -799,7 +828,9 @@ def test_list_gateways_flattened(): call.return_value = apigateway.ListGatewaysResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_gateways(parent="parent_value",) + client.list_gateways( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -811,13 +842,16 @@ def test_list_gateways_flattened(): def test_list_gateways_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_gateways( - apigateway.ListGatewaysRequest(), parent="parent_value", + apigateway.ListGatewaysRequest(), + parent="parent_value", ) @@ -837,7 +871,9 @@ async def test_list_gateways_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_gateways(parent="parent_value",) + response = await client.list_gateways( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -858,13 +894,15 @@ async def test_list_gateways_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_gateways( - apigateway.ListGatewaysRequest(), parent="parent_value", + apigateway.ListGatewaysRequest(), + parent="parent_value", ) def test_list_gateways_pager(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -879,12 +917,21 @@ def test_list_gateways_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - apigateway.ListGatewaysResponse(gateways=[], next_page_token="def",), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(),], next_page_token="ghi", + gateways=[], + next_page_token="def", ), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(), apigateway.Gateway(),], + gateways=[ + apigateway.Gateway(), + ], + next_page_token="ghi", + ), + apigateway.ListGatewaysResponse( + gateways=[ + apigateway.Gateway(), + apigateway.Gateway(), + ], ), RuntimeError, ) @@ -904,7 +951,8 @@ def test_list_gateways_pager(transport_name: str = "grpc"): def test_list_gateways_pages(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -919,12 +967,21 @@ def test_list_gateways_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - apigateway.ListGatewaysResponse(gateways=[], next_page_token="def",), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(),], next_page_token="ghi", + gateways=[], + next_page_token="def", + ), + apigateway.ListGatewaysResponse( + gateways=[ + apigateway.Gateway(), + ], + next_page_token="ghi", ), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(), apigateway.Gateway(),], + gateways=[ + apigateway.Gateway(), + apigateway.Gateway(), + ], ), RuntimeError, ) @@ -953,16 +1010,27 @@ async def test_list_gateways_async_pager(): ], next_page_token="abc", ), - apigateway.ListGatewaysResponse(gateways=[], next_page_token="def",), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(),], next_page_token="ghi", + gateways=[], + next_page_token="def", ), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(), apigateway.Gateway(),], + gateways=[ + apigateway.Gateway(), + ], + next_page_token="ghi", + ), + apigateway.ListGatewaysResponse( + gateways=[ + apigateway.Gateway(), + apigateway.Gateway(), + ], ), RuntimeError, ) - async_pager = await client.list_gateways(request={},) + async_pager = await client.list_gateways( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -992,12 +1060,21 @@ async def test_list_gateways_async_pages(): ], next_page_token="abc", ), - apigateway.ListGatewaysResponse(gateways=[], next_page_token="def",), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(),], next_page_token="ghi", + gateways=[], + next_page_token="def", ), apigateway.ListGatewaysResponse( - gateways=[apigateway.Gateway(), apigateway.Gateway(),], + gateways=[ + apigateway.Gateway(), + ], + next_page_token="ghi", + ), + apigateway.ListGatewaysResponse( + gateways=[ + apigateway.Gateway(), + apigateway.Gateway(), + ], ), RuntimeError, ) @@ -1008,10 +1085,17 @@ async def test_list_gateways_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [apigateway.GetGatewayRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.GetGatewayRequest, + dict, + ], +) def test_get_gateway(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1048,7 +1132,8 @@ def test_get_gateway_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1064,7 +1149,8 @@ async def test_get_gateway_async( transport: str = "grpc_asyncio", request_type=apigateway.GetGatewayRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1105,7 +1191,9 @@ async def test_get_gateway_async_from_dict(): def test_get_gateway_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1125,7 +1213,10 @@ def test_get_gateway_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1152,11 +1243,16 @@ async def test_get_gateway_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_gateway_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_gateway), "__call__") as call: @@ -1164,7 +1260,9 @@ def test_get_gateway_flattened(): call.return_value = apigateway.Gateway() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_gateway(name="name_value",) + client.get_gateway( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1176,13 +1274,16 @@ def test_get_gateway_flattened(): def test_get_gateway_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_gateway( - apigateway.GetGatewayRequest(), name="name_value", + apigateway.GetGatewayRequest(), + name="name_value", ) @@ -1200,7 +1301,9 @@ async def test_get_gateway_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(apigateway.Gateway()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_gateway(name="name_value",) + response = await client.get_gateway( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1221,14 +1324,22 @@ async def test_get_gateway_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_gateway( - apigateway.GetGatewayRequest(), name="name_value", + apigateway.GetGatewayRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [apigateway.CreateGatewayRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.CreateGatewayRequest, + dict, + ], +) def test_create_gateway(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1254,7 +1365,8 @@ def test_create_gateway_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1270,7 +1382,8 @@ async def test_create_gateway_async( transport: str = "grpc_asyncio", request_type=apigateway.CreateGatewayRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1300,7 +1413,9 @@ async def test_create_gateway_async_from_dict(): def test_create_gateway_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1320,7 +1435,10 @@ def test_create_gateway_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1349,11 +1467,16 @@ async def test_create_gateway_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_gateway_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_gateway), "__call__") as call: @@ -1383,7 +1506,9 @@ def test_create_gateway_flattened(): def test_create_gateway_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1450,10 +1575,17 @@ async def test_create_gateway_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.UpdateGatewayRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.UpdateGatewayRequest, + dict, + ], +) def test_update_gateway(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1479,7 +1611,8 @@ def test_update_gateway_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1495,7 +1628,8 @@ async def test_update_gateway_async( transport: str = "grpc_asyncio", request_type=apigateway.UpdateGatewayRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1525,7 +1659,9 @@ async def test_update_gateway_async_from_dict(): def test_update_gateway_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1545,9 +1681,10 @@ def test_update_gateway_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "gateway.name=gateway.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "gateway.name=gateway.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1576,13 +1713,16 @@ async def test_update_gateway_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "gateway.name=gateway.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "gateway.name=gateway.name/value", + ) in kw["metadata"] def test_update_gateway_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_gateway), "__call__") as call: @@ -1608,7 +1748,9 @@ def test_update_gateway_flattened(): def test_update_gateway_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1669,10 +1811,17 @@ async def test_update_gateway_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.DeleteGatewayRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.DeleteGatewayRequest, + dict, + ], +) def test_delete_gateway(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1698,7 +1847,8 @@ def test_delete_gateway_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1714,7 +1864,8 @@ async def test_delete_gateway_async( transport: str = "grpc_asyncio", request_type=apigateway.DeleteGatewayRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1744,7 +1895,9 @@ async def test_delete_gateway_async_from_dict(): def test_delete_gateway_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1764,7 +1917,10 @@ def test_delete_gateway_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1793,11 +1949,16 @@ async def test_delete_gateway_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_gateway_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_gateway), "__call__") as call: @@ -1805,7 +1966,9 @@ def test_delete_gateway_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_gateway(name="name_value",) + client.delete_gateway( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1817,13 +1980,16 @@ def test_delete_gateway_flattened(): def test_delete_gateway_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_gateway( - apigateway.DeleteGatewayRequest(), name="name_value", + apigateway.DeleteGatewayRequest(), + name="name_value", ) @@ -1843,7 +2009,9 @@ async def test_delete_gateway_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_gateway(name="name_value",) + response = await client.delete_gateway( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1864,14 +2032,22 @@ async def test_delete_gateway_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_gateway( - apigateway.DeleteGatewayRequest(), name="name_value", + apigateway.DeleteGatewayRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [apigateway.ListApisRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.ListApisRequest, + dict, + ], +) def test_list_apis(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1902,7 +2078,8 @@ def test_list_apis_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1918,7 +2095,8 @@ async def test_list_apis_async( transport: str = "grpc_asyncio", request_type=apigateway.ListApisRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1953,7 +2131,9 @@ async def test_list_apis_async_from_dict(): def test_list_apis_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1973,7 +2153,10 @@ def test_list_apis_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2002,11 +2185,16 @@ async def test_list_apis_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_apis_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_apis), "__call__") as call: @@ -2014,7 +2202,9 @@ def test_list_apis_flattened(): call.return_value = apigateway.ListApisResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_apis(parent="parent_value",) + client.list_apis( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2026,13 +2216,16 @@ def test_list_apis_flattened(): def test_list_apis_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_apis( - apigateway.ListApisRequest(), parent="parent_value", + apigateway.ListApisRequest(), + parent="parent_value", ) @@ -2052,7 +2245,9 @@ async def test_list_apis_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_apis(parent="parent_value",) + response = await client.list_apis( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2073,13 +2268,15 @@ async def test_list_apis_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_apis( - apigateway.ListApisRequest(), parent="parent_value", + apigateway.ListApisRequest(), + parent="parent_value", ) def test_list_apis_pager(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2087,14 +2284,29 @@ def test_list_apis_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( apigateway.ListApisResponse( - apis=[apigateway.Api(), apigateway.Api(), apigateway.Api(),], + apis=[ + apigateway.Api(), + apigateway.Api(), + apigateway.Api(), + ], next_page_token="abc", ), - apigateway.ListApisResponse(apis=[], next_page_token="def",), apigateway.ListApisResponse( - apis=[apigateway.Api(),], next_page_token="ghi", + apis=[], + next_page_token="def", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + ], + next_page_token="ghi", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + apigateway.Api(), + ], ), - apigateway.ListApisResponse(apis=[apigateway.Api(), apigateway.Api(),],), RuntimeError, ) @@ -2113,7 +2325,8 @@ def test_list_apis_pager(transport_name: str = "grpc"): def test_list_apis_pages(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2121,14 +2334,29 @@ def test_list_apis_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( apigateway.ListApisResponse( - apis=[apigateway.Api(), apigateway.Api(), apigateway.Api(),], + apis=[ + apigateway.Api(), + apigateway.Api(), + apigateway.Api(), + ], next_page_token="abc", ), - apigateway.ListApisResponse(apis=[], next_page_token="def",), apigateway.ListApisResponse( - apis=[apigateway.Api(),], next_page_token="ghi", + apis=[], + next_page_token="def", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + ], + next_page_token="ghi", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + apigateway.Api(), + ], ), - apigateway.ListApisResponse(apis=[apigateway.Api(), apigateway.Api(),],), RuntimeError, ) pages = list(client.list_apis(request={}).pages) @@ -2149,17 +2377,34 @@ async def test_list_apis_async_pager(): # Set the response to a series of pages. call.side_effect = ( apigateway.ListApisResponse( - apis=[apigateway.Api(), apigateway.Api(), apigateway.Api(),], + apis=[ + apigateway.Api(), + apigateway.Api(), + apigateway.Api(), + ], next_page_token="abc", ), - apigateway.ListApisResponse(apis=[], next_page_token="def",), apigateway.ListApisResponse( - apis=[apigateway.Api(),], next_page_token="ghi", + apis=[], + next_page_token="def", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + ], + next_page_token="ghi", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + apigateway.Api(), + ], ), - apigateway.ListApisResponse(apis=[apigateway.Api(), apigateway.Api(),],), RuntimeError, ) - async_pager = await client.list_apis(request={},) + async_pager = await client.list_apis( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2182,14 +2427,29 @@ async def test_list_apis_async_pages(): # Set the response to a series of pages. call.side_effect = ( apigateway.ListApisResponse( - apis=[apigateway.Api(), apigateway.Api(), apigateway.Api(),], + apis=[ + apigateway.Api(), + apigateway.Api(), + apigateway.Api(), + ], next_page_token="abc", ), - apigateway.ListApisResponse(apis=[], next_page_token="def",), apigateway.ListApisResponse( - apis=[apigateway.Api(),], next_page_token="ghi", + apis=[], + next_page_token="def", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + ], + next_page_token="ghi", + ), + apigateway.ListApisResponse( + apis=[ + apigateway.Api(), + apigateway.Api(), + ], ), - apigateway.ListApisResponse(apis=[apigateway.Api(), apigateway.Api(),],), RuntimeError, ) pages = [] @@ -2199,10 +2459,17 @@ async def test_list_apis_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [apigateway.GetApiRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.GetApiRequest, + dict, + ], +) def test_get_api(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2237,7 +2504,8 @@ def test_get_api_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2253,7 +2521,8 @@ async def test_get_api_async( transport: str = "grpc_asyncio", request_type=apigateway.GetApiRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2292,7 +2561,9 @@ async def test_get_api_async_from_dict(): def test_get_api_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2312,7 +2583,10 @@ def test_get_api_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2339,11 +2613,16 @@ async def test_get_api_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_api_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api), "__call__") as call: @@ -2351,7 +2630,9 @@ def test_get_api_flattened(): call.return_value = apigateway.Api() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_api(name="name_value",) + client.get_api( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2363,13 +2644,16 @@ def test_get_api_flattened(): def test_get_api_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_api( - apigateway.GetApiRequest(), name="name_value", + apigateway.GetApiRequest(), + name="name_value", ) @@ -2387,7 +2671,9 @@ async def test_get_api_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(apigateway.Api()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_api(name="name_value",) + response = await client.get_api( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2408,14 +2694,22 @@ async def test_get_api_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_api( - apigateway.GetApiRequest(), name="name_value", + apigateway.GetApiRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [apigateway.CreateApiRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.CreateApiRequest, + dict, + ], +) def test_create_api(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2441,7 +2735,8 @@ def test_create_api_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2457,7 +2752,8 @@ async def test_create_api_async( transport: str = "grpc_asyncio", request_type=apigateway.CreateApiRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2487,7 +2783,9 @@ async def test_create_api_async_from_dict(): def test_create_api_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2507,7 +2805,10 @@ def test_create_api_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2536,11 +2837,16 @@ async def test_create_api_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_api_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_api), "__call__") as call: @@ -2570,7 +2876,9 @@ def test_create_api_flattened(): def test_create_api_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2637,10 +2945,17 @@ async def test_create_api_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.UpdateApiRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.UpdateApiRequest, + dict, + ], +) def test_update_api(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2666,7 +2981,8 @@ def test_update_api_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2682,7 +2998,8 @@ async def test_update_api_async( transport: str = "grpc_asyncio", request_type=apigateway.UpdateApiRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2712,7 +3029,9 @@ async def test_update_api_async_from_dict(): def test_update_api_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2732,7 +3051,10 @@ def test_update_api_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "api.name=api.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "api.name=api.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2761,11 +3083,16 @@ async def test_update_api_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "api.name=api.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "api.name=api.name/value", + ) in kw["metadata"] def test_update_api_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_api), "__call__") as call: @@ -2791,7 +3118,9 @@ def test_update_api_flattened(): def test_update_api_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2852,10 +3181,17 @@ async def test_update_api_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.DeleteApiRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.DeleteApiRequest, + dict, + ], +) def test_delete_api(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2881,7 +3217,8 @@ def test_delete_api_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2897,7 +3234,8 @@ async def test_delete_api_async( transport: str = "grpc_asyncio", request_type=apigateway.DeleteApiRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2927,7 +3265,9 @@ async def test_delete_api_async_from_dict(): def test_delete_api_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2947,7 +3287,10 @@ def test_delete_api_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2976,11 +3319,16 @@ async def test_delete_api_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_api_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_api), "__call__") as call: @@ -2988,7 +3336,9 @@ def test_delete_api_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_api(name="name_value",) + client.delete_api( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3000,13 +3350,16 @@ def test_delete_api_flattened(): def test_delete_api_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_api( - apigateway.DeleteApiRequest(), name="name_value", + apigateway.DeleteApiRequest(), + name="name_value", ) @@ -3026,7 +3379,9 @@ async def test_delete_api_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_api(name="name_value",) + response = await client.delete_api( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3047,14 +3402,22 @@ async def test_delete_api_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_api( - apigateway.DeleteApiRequest(), name="name_value", + apigateway.DeleteApiRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [apigateway.ListApiConfigsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.ListApiConfigsRequest, + dict, + ], +) def test_list_api_configs(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3085,7 +3448,8 @@ def test_list_api_configs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3101,7 +3465,8 @@ async def test_list_api_configs_async( transport: str = "grpc_asyncio", request_type=apigateway.ListApiConfigsRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3136,7 +3501,9 @@ async def test_list_api_configs_async_from_dict(): def test_list_api_configs_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3156,7 +3523,10 @@ def test_list_api_configs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3185,11 +3555,16 @@ async def test_list_api_configs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_api_configs_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_api_configs), "__call__") as call: @@ -3197,7 +3572,9 @@ def test_list_api_configs_flattened(): call.return_value = apigateway.ListApiConfigsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_api_configs(parent="parent_value",) + client.list_api_configs( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3209,13 +3586,16 @@ def test_list_api_configs_flattened(): def test_list_api_configs_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_api_configs( - apigateway.ListApiConfigsRequest(), parent="parent_value", + apigateway.ListApiConfigsRequest(), + parent="parent_value", ) @@ -3235,7 +3615,9 @@ async def test_list_api_configs_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_api_configs(parent="parent_value",) + response = await client.list_api_configs( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3256,13 +3638,15 @@ async def test_list_api_configs_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_api_configs( - apigateway.ListApiConfigsRequest(), parent="parent_value", + apigateway.ListApiConfigsRequest(), + parent="parent_value", ) def test_list_api_configs_pager(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3277,12 +3661,21 @@ def test_list_api_configs_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - apigateway.ListApiConfigsResponse(api_configs=[], next_page_token="def",), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(),], next_page_token="ghi", + api_configs=[], + next_page_token="def", ), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(), apigateway.ApiConfig(),], + api_configs=[ + apigateway.ApiConfig(), + ], + next_page_token="ghi", + ), + apigateway.ListApiConfigsResponse( + api_configs=[ + apigateway.ApiConfig(), + apigateway.ApiConfig(), + ], ), RuntimeError, ) @@ -3302,7 +3695,8 @@ def test_list_api_configs_pager(transport_name: str = "grpc"): def test_list_api_configs_pages(transport_name: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3317,12 +3711,21 @@ def test_list_api_configs_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - apigateway.ListApiConfigsResponse(api_configs=[], next_page_token="def",), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(),], next_page_token="ghi", + api_configs=[], + next_page_token="def", ), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(), apigateway.ApiConfig(),], + api_configs=[ + apigateway.ApiConfig(), + ], + next_page_token="ghi", + ), + apigateway.ListApiConfigsResponse( + api_configs=[ + apigateway.ApiConfig(), + apigateway.ApiConfig(), + ], ), RuntimeError, ) @@ -3351,16 +3754,27 @@ async def test_list_api_configs_async_pager(): ], next_page_token="abc", ), - apigateway.ListApiConfigsResponse(api_configs=[], next_page_token="def",), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(),], next_page_token="ghi", + api_configs=[], + next_page_token="def", ), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(), apigateway.ApiConfig(),], + api_configs=[ + apigateway.ApiConfig(), + ], + next_page_token="ghi", + ), + apigateway.ListApiConfigsResponse( + api_configs=[ + apigateway.ApiConfig(), + apigateway.ApiConfig(), + ], ), RuntimeError, ) - async_pager = await client.list_api_configs(request={},) + async_pager = await client.list_api_configs( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3390,12 +3804,21 @@ async def test_list_api_configs_async_pages(): ], next_page_token="abc", ), - apigateway.ListApiConfigsResponse(api_configs=[], next_page_token="def",), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(),], next_page_token="ghi", + api_configs=[], + next_page_token="def", + ), + apigateway.ListApiConfigsResponse( + api_configs=[ + apigateway.ApiConfig(), + ], + next_page_token="ghi", ), apigateway.ListApiConfigsResponse( - api_configs=[apigateway.ApiConfig(), apigateway.ApiConfig(),], + api_configs=[ + apigateway.ApiConfig(), + apigateway.ApiConfig(), + ], ), RuntimeError, ) @@ -3406,10 +3829,17 @@ async def test_list_api_configs_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [apigateway.GetApiConfigRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.GetApiConfigRequest, + dict, + ], +) def test_get_api_config(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3446,7 +3876,8 @@ def test_get_api_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3462,7 +3893,8 @@ async def test_get_api_config_async( transport: str = "grpc_asyncio", request_type=apigateway.GetApiConfigRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3503,7 +3935,9 @@ async def test_get_api_config_async_from_dict(): def test_get_api_config_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3523,7 +3957,10 @@ def test_get_api_config_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3552,11 +3989,16 @@ async def test_get_api_config_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_api_config_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api_config), "__call__") as call: @@ -3564,7 +4006,9 @@ def test_get_api_config_flattened(): call.return_value = apigateway.ApiConfig() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_api_config(name="name_value",) + client.get_api_config( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3576,13 +4020,16 @@ def test_get_api_config_flattened(): def test_get_api_config_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_api_config( - apigateway.GetApiConfigRequest(), name="name_value", + apigateway.GetApiConfigRequest(), + name="name_value", ) @@ -3602,7 +4049,9 @@ async def test_get_api_config_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_api_config(name="name_value",) + response = await client.get_api_config( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3623,14 +4072,22 @@ async def test_get_api_config_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_api_config( - apigateway.GetApiConfigRequest(), name="name_value", + apigateway.GetApiConfigRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [apigateway.CreateApiConfigRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.CreateApiConfigRequest, + dict, + ], +) def test_create_api_config(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3658,7 +4115,8 @@ def test_create_api_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3676,7 +4134,8 @@ async def test_create_api_config_async( transport: str = "grpc_asyncio", request_type=apigateway.CreateApiConfigRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3708,7 +4167,9 @@ async def test_create_api_config_async_from_dict(): def test_create_api_config_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3730,7 +4191,10 @@ def test_create_api_config_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -3761,11 +4225,16 @@ async def test_create_api_config_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_api_config_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3797,7 +4266,9 @@ def test_create_api_config_flattened(): def test_create_api_config_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3866,10 +4337,17 @@ async def test_create_api_config_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.UpdateApiConfigRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.UpdateApiConfigRequest, + dict, + ], +) def test_update_api_config(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3897,7 +4375,8 @@ def test_update_api_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3915,7 +4394,8 @@ async def test_update_api_config_async( transport: str = "grpc_asyncio", request_type=apigateway.UpdateApiConfigRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3947,7 +4427,9 @@ async def test_update_api_config_async_from_dict(): def test_update_api_config_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3969,9 +4451,10 @@ def test_update_api_config_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "api_config.name=api_config.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "api_config.name=api_config.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4002,13 +4485,16 @@ async def test_update_api_config_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "api_config.name=api_config.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "api_config.name=api_config.name/value", + ) in kw["metadata"] def test_update_api_config_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4036,7 +4522,9 @@ def test_update_api_config_flattened(): def test_update_api_config_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4099,10 +4587,17 @@ async def test_update_api_config_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [apigateway.DeleteApiConfigRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + apigateway.DeleteApiConfigRequest, + dict, + ], +) def test_delete_api_config(request_type, transport: str = "grpc"): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4130,7 +4625,8 @@ def test_delete_api_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4148,7 +4644,8 @@ async def test_delete_api_config_async( transport: str = "grpc_asyncio", request_type=apigateway.DeleteApiConfigRequest ): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4180,7 +4677,9 @@ async def test_delete_api_config_async_from_dict(): def test_delete_api_config_field_headers(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4202,7 +4701,10 @@ def test_delete_api_config_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -4233,11 +4735,16 @@ async def test_delete_api_config_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_api_config_flattened(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4247,7 +4754,9 @@ def test_delete_api_config_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_api_config(name="name_value",) + client.delete_api_config( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4259,13 +4768,16 @@ def test_delete_api_config_flattened(): def test_delete_api_config_flattened_error(): - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_api_config( - apigateway.DeleteApiConfigRequest(), name="name_value", + apigateway.DeleteApiConfigRequest(), + name="name_value", ) @@ -4287,7 +4799,9 @@ async def test_delete_api_config_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_api_config(name="name_value",) + response = await client.delete_api_config( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4308,7 +4822,8 @@ async def test_delete_api_config_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_api_config( - apigateway.DeleteApiConfigRequest(), name="name_value", + apigateway.DeleteApiConfigRequest(), + name="name_value", ) @@ -4319,7 +4834,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -4339,7 +4855,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = ApiGatewayServiceClient(client_options=options, transport=transport,) + client = ApiGatewayServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -4355,7 +4874,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ApiGatewayServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -4400,8 +4920,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = ApiGatewayServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.ApiGatewayServiceGrpcTransport,) + client = ApiGatewayServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.ApiGatewayServiceGrpcTransport, + ) def test_api_gateway_service_base_transport_error(): @@ -4465,7 +4990,8 @@ def test_api_gateway_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ApiGatewayServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -4625,7 +5151,8 @@ def test_api_gateway_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.ApiGatewayServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4637,7 +5164,8 @@ def test_api_gateway_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.ApiGatewayServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4746,12 +5274,16 @@ def test_api_gateway_service_transport_channel_mtls_with_adc(transport_class): def test_api_gateway_service_grpc_lro_client(): client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -4759,12 +5291,16 @@ def test_api_gateway_service_grpc_lro_client(): def test_api_gateway_service_grpc_lro_async_client(): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -4774,7 +5310,8 @@ def test_api_path(): project = "squid" api = "clam" expected = "projects/{project}/locations/global/apis/{api}".format( - project=project, api=api, + project=project, + api=api, ) actual = ApiGatewayServiceClient.api_path(project, api) assert expected == actual @@ -4796,8 +5333,12 @@ def test_api_config_path(): project = "oyster" api = "nudibranch" api_config = "cuttlefish" - expected = "projects/{project}/locations/global/apis/{api}/configs/{api_config}".format( - project=project, api=api, api_config=api_config, + expected = ( + "projects/{project}/locations/global/apis/{api}/configs/{api_config}".format( + project=project, + api=api, + api_config=api_config, + ) ) actual = ApiGatewayServiceClient.api_config_path(project, api, api_config) assert expected == actual @@ -4821,7 +5362,9 @@ def test_gateway_path(): location = "abalone" gateway = "squid" expected = "projects/{project}/locations/{location}/gateways/{gateway}".format( - project=project, location=location, gateway=gateway, + project=project, + location=location, + gateway=gateway, ) actual = ApiGatewayServiceClient.gateway_path(project, location, gateway) assert expected == actual @@ -4842,7 +5385,9 @@ def test_parse_gateway_path(): def test_managed_service_path(): service = "oyster" - expected = "services/{service}".format(service=service,) + expected = "services/{service}".format( + service=service, + ) actual = ApiGatewayServiceClient.managed_service_path(service) assert expected == actual @@ -4862,7 +5407,8 @@ def test_service_path(): service = "cuttlefish" config = "mussel" expected = "services/{service}/configs/{config}".format( - service=service, config=config, + service=service, + config=config, ) actual = ApiGatewayServiceClient.service_path(service, config) assert expected == actual @@ -4884,7 +5430,8 @@ def test_service_account_path(): project = "scallop" service_account = "abalone" expected = "projects/{project}/serviceAccounts/{service_account}".format( - project=project, service_account=service_account, + project=project, + service_account=service_account, ) actual = ApiGatewayServiceClient.service_account_path(project, service_account) assert expected == actual @@ -4924,7 +5471,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = ApiGatewayServiceClient.common_folder_path(folder) assert expected == actual @@ -4942,7 +5491,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = ApiGatewayServiceClient.common_organization_path(organization) assert expected == actual @@ -4960,7 +5511,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = ApiGatewayServiceClient.common_project_path(project) assert expected == actual @@ -4980,7 +5533,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = ApiGatewayServiceClient.common_location_path(project, location) assert expected == actual @@ -5005,7 +5559,8 @@ def test_client_with_default_client_info(): transports.ApiGatewayServiceTransport, "_prep_wrapped_messages" ) as prep: client = ApiGatewayServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5014,7 +5569,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ApiGatewayServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5022,7 +5578,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ApiGatewayServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" From 70ccd52344ee48313ebc9726e787beb0b3741842 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:50:28 +0000 Subject: [PATCH 03/19] chore(python): add E231 to .flake8 ignore list (#118) Source-Link: https://github.com/googleapis/synthtool/commit/7ff4aad2ec5af0380e8bd6da1fa06eaadf24ec81 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 --- .flake8 | 2 +- .github/.OwlBot.lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 29227d4..2e43874 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 87dd006..9e0a935 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe + digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 From e5ccc1f748e6a25ecd0d471f77905278889ddeef Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 00:12:18 +0000 Subject: [PATCH 04/19] chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#119) Source-Link: https://github.com/googleapis/synthtool/commit/7804ade3daae0d66649bee8df6c55484c6580b8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d --- .github/.OwlBot.lock.yaml | 3 ++- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9e0a935..22cc254 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 + digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d +# created: 2022-03-30T23:44:26.560599165Z diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a7..46d2371 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 From 197db6c94ceac5e10df448bd96da25173000e3c6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:16:33 +0000 Subject: [PATCH 05/19] chore(python): Enable size-label bot (#120) Source-Link: https://github.com/googleapis/synthtool/commit/06e82790dd719a165ad32b8a06f8f6ec3e3cae0f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .github/auto-label.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 22cc254..58a0b15 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d -# created: 2022-03-30T23:44:26.560599165Z + digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce +# created: 2022-04-01T01:42:03.609279246Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 0000000..09c8d73 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,2 @@ +requestsize: + enabled: true From 697f9e66bbe4cd6e8c6cb74878e94553df40f6b8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 19:48:22 +0000 Subject: [PATCH 06/19] chore(python): refactor unit / system test dependency install (#121) Source-Link: https://github.com/googleapis/synthtool/commit/993985f0fc4b37152e588f0549bcbdaf34666023 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd --- .github/.OwlBot.lock.yaml | 4 +- noxfile.py | 105 ++++++++++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 58a0b15..fa57622 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce -# created: 2022-04-01T01:42:03.609279246Z + digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd +# created: 2022-04-01T15:48:07.524222836Z diff --git a/noxfile.py b/noxfile.py index 3addb4e..6ee5e8a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,16 +20,40 @@ import os import pathlib import shutil +import warnings import nox - BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -81,23 +105,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -121,6 +163,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -143,13 +214,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: From aebcd36bdb91344d97a79a06b7f157af2b37ec32 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 06:44:03 -0400 Subject: [PATCH 07/19] chore(python): add license header to auto-label.yaml (#122) Source-Link: https://github.com/googleapis/synthtool/commit/eb78c980b52c7c6746d2edb77d9cf7aaa99a2aab Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fa57622..bc893c9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd -# created: 2022-04-01T15:48:07.524222836Z + digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 +# created: 2022-04-06T10:30:21.687684602Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d73..41bff0b 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. requestsize: enabled: true From 2749aaa2f00236ab16a1b384053ed836c23e0ce7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 07:09:45 -0400 Subject: [PATCH 08/19] chore: Use gapic-generator-python 0.65.0 (#125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Use gapic-generator-python 0.65.0 PiperOrigin-RevId: 440970084 Source-Link: https://github.com/googleapis/googleapis/commit/5e0a3d57254ab9857ccac77fc6ffade7b69a2dc7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../api_gateway_service/async_client.py | 31 ++---- .../services/api_gateway_service/client.py | 4 +- .../api_gateway_service/transports/base.py | 32 +++--- .../api_gateway_service/transports/grpc.py | 4 + .../cloud/apigateway_v1/types/apigateway.py | 6 +- .../apigateway_v1/test_api_gateway_service.py | 97 ++++++++++++++----- 6 files changed, 106 insertions(+), 68 deletions(-) diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index 5c806e8..228cc29 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -444,7 +444,6 @@ async def create_gateway( r"""Creates a new Gateway in a given project and location. - .. code-block:: python from google.cloud import apigateway_v1 @@ -543,8 +542,7 @@ def sample_create_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -679,8 +677,7 @@ def sample_update_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -811,8 +808,7 @@ def sample_delete_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -1154,8 +1150,7 @@ def sample_create_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -1285,8 +1280,7 @@ def sample_update_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -1415,8 +1409,7 @@ def sample_delete_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -1667,7 +1660,6 @@ async def create_api_config( r"""Creates a new ApiConfig in a given project and location. - .. code-block:: python from google.cloud import apigateway_v1 @@ -1760,8 +1752,7 @@ def sample_create_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -1890,8 +1881,7 @@ def sample_update_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -2022,8 +2012,7 @@ def sample_delete_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/client.py b/google/cloud/apigateway_v1/services/api_gateway_service/client.py index d605d83..684b9b4 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -747,7 +747,6 @@ def create_gateway( r"""Creates a new Gateway in a given project and location. - .. code-block:: python from google.cloud import apigateway_v1 @@ -1910,7 +1909,6 @@ def create_api_config( r"""Creates a new ApiConfig in a given project and location. - .. code-block:: python from google.cloud import apigateway_v1 diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py index b04f2d7..2f945b3 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py @@ -82,6 +82,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -139,8 +140,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -154,8 +154,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -169,8 +168,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -194,8 +192,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -209,8 +206,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -224,8 +220,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -249,8 +244,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -264,8 +258,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -279,8 +272,7 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, - core_exceptions.Unknown, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -442,5 +434,9 @@ def delete_api_config( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("ApiGatewayServiceTransport",) diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py index 1a90a9d..5d32c0a 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py @@ -640,5 +640,9 @@ def delete_api_config( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("ApiGatewayServiceGrpcTransport",) diff --git a/google/cloud/apigateway_v1/types/apigateway.py b/google/cloud/apigateway_v1/types/apigateway.py index 203956a..88b8e4c 100644 --- a/google/cloud/apigateway_v1/types/apigateway.py +++ b/google/cloud/apigateway_v1/types/apigateway.py @@ -60,7 +60,7 @@ class Api(proto.Message): Output only. Created time. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Updated time. - labels (Sequence[google.cloud.apigateway_v1.types.Api.LabelsEntry]): + labels (Mapping[str, str]): Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. @@ -133,7 +133,7 @@ class ApiConfig(proto.Message): Output only. Created time. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Updated time. - labels (Sequence[google.cloud.apigateway_v1.types.ApiConfig.LabelsEntry]): + labels (Mapping[str, str]): Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. @@ -321,7 +321,7 @@ class Gateway(proto.Message): Output only. Created time. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Updated time. - labels (Sequence[google.cloud.apigateway_v1.types.Gateway.LabelsEntry]): + labels (Mapping[str, str]): Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. diff --git a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index 92fbc49..73efaa2 100644 --- a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -97,24 +97,26 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ApiGatewayServiceClient, - ApiGatewayServiceAsyncClient, + (ApiGatewayServiceClient, "grpc"), + (ApiGatewayServiceAsyncClient, "grpc_asyncio"), ], ) -def test_api_gateway_service_client_from_service_account_info(client_class): +def test_api_gateway_service_client_from_service_account_info( + client_class, transport_name +): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "apigateway.googleapis.com:443" + assert client.transport._host == ("apigateway.googleapis.com:443") @pytest.mark.parametrize( @@ -143,27 +145,33 @@ def test_api_gateway_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ApiGatewayServiceClient, - ApiGatewayServiceAsyncClient, + (ApiGatewayServiceClient, "grpc"), + (ApiGatewayServiceAsyncClient, "grpc_asyncio"), ], ) -def test_api_gateway_service_client_from_service_account_file(client_class): +def test_api_gateway_service_client_from_service_account_file( + client_class, transport_name +): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "apigateway.googleapis.com:443" + assert client.transport._host == ("apigateway.googleapis.com:443") def test_api_gateway_service_client_get_transport_class(): @@ -1033,7 +1041,7 @@ async def test_list_gateways_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1079,7 +1087,9 @@ async def test_list_gateways_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_gateways(request={})).pages: + async for page_ in ( + await client.list_gateways(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2407,7 +2417,7 @@ async def test_list_apis_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2453,7 +2463,9 @@ async def test_list_apis_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_apis(request={})).pages: + async for page_ in ( + await client.list_apis(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3777,7 +3789,7 @@ async def test_list_api_configs_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3823,7 +3835,9 @@ async def test_list_api_configs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_api_configs(request={})).pages: + async for page_ in ( + await client.list_api_configs(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4918,6 +4932,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = ApiGatewayServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ApiGatewayServiceClient( @@ -4979,6 +5006,14 @@ def test_api_gateway_service_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_api_gateway_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -5126,24 +5161,40 @@ def test_api_gateway_service_grpc_transport_client_cert_source_for_mtls( ) -def test_api_gateway_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_api_gateway_service_host_no_port(transport_name): client = ApiGatewayServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="apigateway.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "apigateway.googleapis.com:443" + assert client.transport._host == ("apigateway.googleapis.com:443") -def test_api_gateway_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_api_gateway_service_host_with_port(transport_name): client = ApiGatewayServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="apigateway.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "apigateway.googleapis.com:8000" + assert client.transport._host == ("apigateway.googleapis.com:8000") def test_api_gateway_service_grpc_transport_channel(): From 417926e5fe1d263d3c44e943f727d5db9949ab93 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:09:28 -0400 Subject: [PATCH 09/19] chore: use gapic-generator-python 0.65.1 (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.1 PiperOrigin-RevId: 441524537 Source-Link: https://github.com/googleapis/googleapis/commit/2a273915b3f70fe86c9d2a75470a0b83e48d0abf Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../api_gateway_service/async_client.py | 27 +- .../api_gateway_service/transports/base.py | 27 +- .../snippet_metadata_apigateway_v1.json | 1282 ++++++++++++++++- 3 files changed, 1258 insertions(+), 78 deletions(-) diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index 228cc29..00e5402 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -542,7 +542,8 @@ def sample_create_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -677,7 +678,8 @@ def sample_update_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -808,7 +810,8 @@ def sample_delete_gateway(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1150,7 +1153,8 @@ def sample_create_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1280,7 +1284,8 @@ def sample_update_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1409,7 +1414,8 @@ def sample_delete_api(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1752,7 +1758,8 @@ def sample_create_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -1881,7 +1888,8 @@ def sample_update_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -2012,7 +2020,8 @@ def sample_delete_api_config(): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py index 2f945b3..bd04ccc 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py @@ -140,7 +140,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -154,7 +155,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -168,7 +170,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -192,7 +195,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -206,7 +210,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -220,7 +225,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -244,7 +250,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -258,7 +265,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), @@ -272,7 +280,8 @@ def _prep_wrapped_messages(self, client_info): maximum=60.0, multiplier=2, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, + core_exceptions.Unknown, ), deadline=60.0, ), diff --git a/samples/generated_samples/snippet_metadata_apigateway_v1.json b/samples/generated_samples/snippet_metadata_apigateway_v1.json index 9a2b46d..56ae4ad 100644 --- a/samples/generated_samples/snippet_metadata_apigateway_v1.json +++ b/samples/generated_samples/snippet_metadata_apigateway_v1.json @@ -1,16 +1,69 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.apigateway.v1", + "version": "v1" + } + ], + "language": "PYTHON", + "name": "google-cloud-api-gateway" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.create_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateApiConfigRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "api_config", + "type": "google.cloud.apigateway_v1.types.ApiConfig" + }, + { + "name": "api_config_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_api_config" }, + "description": "Sample for CreateApiConfig", "file": "apigateway_v1_generated_api_gateway_service_create_api_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateApiConfig_async", "segments": [ { @@ -43,18 +96,62 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_api_config_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.create_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateApiConfigRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "api_config", + "type": "google.cloud.apigateway_v1.types.ApiConfig" + }, + { + "name": "api_config_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_api_config" }, + "description": "Sample for CreateApiConfig", "file": "apigateway_v1_generated_api_gateway_service_create_api_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateApiConfig_sync", "segments": [ { @@ -87,19 +184,63 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_api_config_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.create_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateApiRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "api", + "type": "google.cloud.apigateway_v1.types.Api" + }, + { + "name": "api_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_api" }, + "description": "Sample for CreateApi", "file": "apigateway_v1_generated_api_gateway_service_create_api_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateApi_async", "segments": [ { @@ -132,18 +273,62 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_api_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.create_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateApiRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "api", + "type": "google.cloud.apigateway_v1.types.Api" + }, + { + "name": "api_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_api" }, + "description": "Sample for CreateApi", "file": "apigateway_v1_generated_api_gateway_service_create_api_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateApi_sync", "segments": [ { @@ -176,19 +361,63 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_api_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.create_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway", + "type": "google.cloud.apigateway_v1.types.Gateway" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_gateway" }, + "description": "Sample for CreateGateway", "file": "apigateway_v1_generated_api_gateway_service_create_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateGateway_async", "segments": [ { @@ -221,18 +450,62 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.create_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.CreateGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "CreateGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.CreateGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway", + "type": "google.cloud.apigateway_v1.types.Gateway" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_gateway" }, + "description": "Sample for CreateGateway", "file": "apigateway_v1_generated_api_gateway_service_create_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_CreateGateway_sync", "segments": [ { @@ -265,19 +538,55 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_create_gateway_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.delete_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteApiConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_api_config" }, + "description": "Sample for DeleteApiConfig", "file": "apigateway_v1_generated_api_gateway_service_delete_api_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_async", "segments": [ { @@ -310,18 +619,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_api_config_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.delete_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteApiConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_api_config" }, + "description": "Sample for DeleteApiConfig", "file": "apigateway_v1_generated_api_gateway_service_delete_api_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_sync", "segments": [ { @@ -354,19 +699,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_api_config_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.delete_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteApiRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_api" }, + "description": "Sample for DeleteApi", "file": "apigateway_v1_generated_api_gateway_service_delete_api_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteApi_async", "segments": [ { @@ -399,18 +780,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_api_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.delete_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteApiRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_api" }, + "description": "Sample for DeleteApi", "file": "apigateway_v1_generated_api_gateway_service_delete_api_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteApi_sync", "segments": [ { @@ -443,19 +860,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_api_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.delete_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteGatewayRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_gateway" }, + "description": "Sample for DeleteGateway", "file": "apigateway_v1_generated_api_gateway_service_delete_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteGateway_async", "segments": [ { @@ -488,18 +941,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.delete_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.DeleteGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "DeleteGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.DeleteGatewayRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_gateway" }, + "description": "Sample for DeleteGateway", "file": "apigateway_v1_generated_api_gateway_service_delete_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_DeleteGateway_sync", "segments": [ { @@ -532,19 +1021,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_delete_gateway_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.get_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetApiConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.ApiConfig", + "shortName": "get_api_config" }, + "description": "Sample for GetApiConfig", "file": "apigateway_v1_generated_api_gateway_service_get_api_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetApiConfig_async", "segments": [ { @@ -577,18 +1102,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_api_config_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.get_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetApiConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.ApiConfig", + "shortName": "get_api_config" }, + "description": "Sample for GetApiConfig", "file": "apigateway_v1_generated_api_gateway_service_get_api_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetApiConfig_sync", "segments": [ { @@ -621,19 +1182,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_api_config_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.get_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetApiRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.Api", + "shortName": "get_api" }, + "description": "Sample for GetApi", "file": "apigateway_v1_generated_api_gateway_service_get_api_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetApi_async", "segments": [ { @@ -666,18 +1263,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_api_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.get_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetApiRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.Api", + "shortName": "get_api" }, + "description": "Sample for GetApi", "file": "apigateway_v1_generated_api_gateway_service_get_api_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetApi_sync", "segments": [ { @@ -710,19 +1343,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_api_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.get_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetGatewayRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.Gateway", + "shortName": "get_gateway" }, + "description": "Sample for GetGateway", "file": "apigateway_v1_generated_api_gateway_service_get_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetGateway_async", "segments": [ { @@ -755,18 +1424,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.get_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.GetGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "GetGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.GetGatewayRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.types.Gateway", + "shortName": "get_gateway" }, + "description": "Sample for GetGateway", "file": "apigateway_v1_generated_api_gateway_service_get_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_GetGateway_sync", "segments": [ { @@ -799,19 +1504,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_get_gateway_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.list_api_configs", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListApiConfigs", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListApiConfigs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListApiConfigsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListApiConfigsAsyncPager", + "shortName": "list_api_configs" }, + "description": "Sample for ListApiConfigs", "file": "apigateway_v1_generated_api_gateway_service_list_api_configs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListApiConfigs_async", "segments": [ { @@ -844,18 +1585,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_api_configs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.list_api_configs", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListApiConfigs", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListApiConfigs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListApiConfigsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListApiConfigsPager", + "shortName": "list_api_configs" }, + "description": "Sample for ListApiConfigs", "file": "apigateway_v1_generated_api_gateway_service_list_api_configs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListApiConfigs_sync", "segments": [ { @@ -888,19 +1665,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_api_configs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.list_apis", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListApis", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListApis" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListApisRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListApisAsyncPager", + "shortName": "list_apis" }, + "description": "Sample for ListApis", "file": "apigateway_v1_generated_api_gateway_service_list_apis_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListApis_async", "segments": [ { @@ -933,18 +1746,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_apis_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.list_apis", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListApis", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListApis" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListApisRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListApisPager", + "shortName": "list_apis" }, + "description": "Sample for ListApis", "file": "apigateway_v1_generated_api_gateway_service_list_apis_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListApis_sync", "segments": [ { @@ -977,19 +1826,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_apis_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.list_gateways", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListGateways", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListGateways" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListGatewaysRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListGatewaysAsyncPager", + "shortName": "list_gateways" }, + "description": "Sample for ListGateways", "file": "apigateway_v1_generated_api_gateway_service_list_gateways_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListGateways_async", "segments": [ { @@ -1022,18 +1907,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_gateways_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.list_gateways", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.ListGateways", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "ListGateways" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.ListGatewaysRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.apigateway_v1.services.api_gateway_service.pagers.ListGatewaysPager", + "shortName": "list_gateways" }, + "description": "Sample for ListGateways", "file": "apigateway_v1_generated_api_gateway_service_list_gateways_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_ListGateways_sync", "segments": [ { @@ -1066,19 +1987,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_list_gateways_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.update_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateApiConfigRequest" + }, + { + "name": "api_config", + "type": "google.cloud.apigateway_v1.types.ApiConfig" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_api_config" }, + "description": "Sample for UpdateApiConfig", "file": "apigateway_v1_generated_api_gateway_service_update_api_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateApiConfig_async", "segments": [ { @@ -1111,18 +2072,58 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_api_config_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.update_api_config", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateApiConfig", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateApiConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateApiConfigRequest" + }, + { + "name": "api_config", + "type": "google.cloud.apigateway_v1.types.ApiConfig" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_api_config" }, + "description": "Sample for UpdateApiConfig", "file": "apigateway_v1_generated_api_gateway_service_update_api_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateApiConfig_sync", "segments": [ { @@ -1155,19 +2156,59 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_api_config_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.update_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateApiRequest" + }, + { + "name": "api", + "type": "google.cloud.apigateway_v1.types.Api" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_api" }, + "description": "Sample for UpdateApi", "file": "apigateway_v1_generated_api_gateway_service_update_api_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateApi_async", "segments": [ { @@ -1200,18 +2241,58 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_api_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.update_api", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateApi", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateApi" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateApiRequest" + }, + { + "name": "api", + "type": "google.cloud.apigateway_v1.types.Api" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_api" }, + "description": "Sample for UpdateApi", "file": "apigateway_v1_generated_api_gateway_service_update_api_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateApi_sync", "segments": [ { @@ -1244,19 +2325,59 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_api_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient", + "shortName": "ApiGatewayServiceAsyncClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceAsyncClient.update_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateGatewayRequest" + }, + { + "name": "gateway", + "type": "google.cloud.apigateway_v1.types.Gateway" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_gateway" }, + "description": "Sample for UpdateGateway", "file": "apigateway_v1_generated_api_gateway_service_update_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateGateway_async", "segments": [ { @@ -1289,18 +2410,58 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient", + "shortName": "ApiGatewayServiceClient" + }, + "fullName": "google.cloud.apigateway_v1.ApiGatewayServiceClient.update_gateway", "method": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService.UpdateGateway", "service": { + "fullName": "google.cloud.apigateway.v1.ApiGatewayService", "shortName": "ApiGatewayService" }, "shortName": "UpdateGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.apigateway_v1.types.UpdateGatewayRequest" + }, + { + "name": "gateway", + "type": "google.cloud.apigateway_v1.types.Gateway" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_gateway" }, + "description": "Sample for UpdateGateway", "file": "apigateway_v1_generated_api_gateway_service_update_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "apigateway_v1_generated_ApiGatewayService_UpdateGateway_sync", "segments": [ { @@ -1333,7 +2494,8 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "apigateway_v1_generated_api_gateway_service_update_gateway_sync.py" } ] } From ca74cf7b268e73aa1ea6c8810d6305fd53b5e47f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 19:53:45 -0400 Subject: [PATCH 10/19] chore(python): add nox session to sort python imports (#127) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- docs/conf.py | 2 +- google/cloud/apigateway/__init__.py | 51 +++++++++--------- google/cloud/apigateway_v1/__init__.py | 53 ++++++++++--------- .../services/api_gateway_service/__init__.py | 2 +- .../api_gateway_service/async_client.py | 14 ++--- .../services/api_gateway_service/client.py | 12 +++-- .../services/api_gateway_service/pagers.py | 4 +- .../transports/__init__.py | 1 - .../api_gateway_service/transports/base.py | 9 ++-- .../api_gateway_service/transports/grpc.py | 12 ++--- .../transports/grpc_asyncio.py | 12 ++--- .../cloud/apigateway_v1/types/apigateway.py | 4 +- noxfile.py | 28 ++++++++-- setup.py | 1 + .../apigateway_v1/test_api_gateway_service.py | 47 ++++++++-------- 16 files changed, 139 insertions(+), 117 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c9..7c454ab 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/docs/conf.py b/docs/conf.py index 58f89d9..40afee8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/google/cloud/apigateway/__init__.py b/google/cloud/apigateway/__init__.py index b881bb1..047c0a6 100644 --- a/google/cloud/apigateway/__init__.py +++ b/google/cloud/apigateway/__init__.py @@ -14,36 +14,37 @@ # limitations under the License. # +from google.cloud.apigateway_v1.services.api_gateway_service.async_client import ( + ApiGatewayServiceAsyncClient, +) from google.cloud.apigateway_v1.services.api_gateway_service.client import ( ApiGatewayServiceClient, ) -from google.cloud.apigateway_v1.services.api_gateway_service.async_client import ( - ApiGatewayServiceAsyncClient, +from google.cloud.apigateway_v1.types.apigateway import ( + Api, + ApiConfig, + CreateApiConfigRequest, + CreateApiRequest, + CreateGatewayRequest, + DeleteApiConfigRequest, + DeleteApiRequest, + DeleteGatewayRequest, + Gateway, + GetApiConfigRequest, + GetApiRequest, + GetGatewayRequest, + ListApiConfigsRequest, + ListApiConfigsResponse, + ListApisRequest, + ListApisResponse, + ListGatewaysRequest, + ListGatewaysResponse, + OperationMetadata, + UpdateApiConfigRequest, + UpdateApiRequest, + UpdateGatewayRequest, ) -from google.cloud.apigateway_v1.types.apigateway import Api -from google.cloud.apigateway_v1.types.apigateway import ApiConfig -from google.cloud.apigateway_v1.types.apigateway import CreateApiConfigRequest -from google.cloud.apigateway_v1.types.apigateway import CreateApiRequest -from google.cloud.apigateway_v1.types.apigateway import CreateGatewayRequest -from google.cloud.apigateway_v1.types.apigateway import DeleteApiConfigRequest -from google.cloud.apigateway_v1.types.apigateway import DeleteApiRequest -from google.cloud.apigateway_v1.types.apigateway import DeleteGatewayRequest -from google.cloud.apigateway_v1.types.apigateway import Gateway -from google.cloud.apigateway_v1.types.apigateway import GetApiConfigRequest -from google.cloud.apigateway_v1.types.apigateway import GetApiRequest -from google.cloud.apigateway_v1.types.apigateway import GetGatewayRequest -from google.cloud.apigateway_v1.types.apigateway import ListApiConfigsRequest -from google.cloud.apigateway_v1.types.apigateway import ListApiConfigsResponse -from google.cloud.apigateway_v1.types.apigateway import ListApisRequest -from google.cloud.apigateway_v1.types.apigateway import ListApisResponse -from google.cloud.apigateway_v1.types.apigateway import ListGatewaysRequest -from google.cloud.apigateway_v1.types.apigateway import ListGatewaysResponse -from google.cloud.apigateway_v1.types.apigateway import OperationMetadata -from google.cloud.apigateway_v1.types.apigateway import UpdateApiConfigRequest -from google.cloud.apigateway_v1.types.apigateway import UpdateApiRequest -from google.cloud.apigateway_v1.types.apigateway import UpdateGatewayRequest - __all__ = ( "ApiGatewayServiceClient", "ApiGatewayServiceAsyncClient", diff --git a/google/cloud/apigateway_v1/__init__.py b/google/cloud/apigateway_v1/__init__.py index e183466..9d1b4fd 100644 --- a/google/cloud/apigateway_v1/__init__.py +++ b/google/cloud/apigateway_v1/__init__.py @@ -14,31 +14,34 @@ # limitations under the License. # -from .services.api_gateway_service import ApiGatewayServiceClient -from .services.api_gateway_service import ApiGatewayServiceAsyncClient - -from .types.apigateway import Api -from .types.apigateway import ApiConfig -from .types.apigateway import CreateApiConfigRequest -from .types.apigateway import CreateApiRequest -from .types.apigateway import CreateGatewayRequest -from .types.apigateway import DeleteApiConfigRequest -from .types.apigateway import DeleteApiRequest -from .types.apigateway import DeleteGatewayRequest -from .types.apigateway import Gateway -from .types.apigateway import GetApiConfigRequest -from .types.apigateway import GetApiRequest -from .types.apigateway import GetGatewayRequest -from .types.apigateway import ListApiConfigsRequest -from .types.apigateway import ListApiConfigsResponse -from .types.apigateway import ListApisRequest -from .types.apigateway import ListApisResponse -from .types.apigateway import ListGatewaysRequest -from .types.apigateway import ListGatewaysResponse -from .types.apigateway import OperationMetadata -from .types.apigateway import UpdateApiConfigRequest -from .types.apigateway import UpdateApiRequest -from .types.apigateway import UpdateGatewayRequest +from .services.api_gateway_service import ( + ApiGatewayServiceAsyncClient, + ApiGatewayServiceClient, +) +from .types.apigateway import ( + Api, + ApiConfig, + CreateApiConfigRequest, + CreateApiRequest, + CreateGatewayRequest, + DeleteApiConfigRequest, + DeleteApiRequest, + DeleteGatewayRequest, + Gateway, + GetApiConfigRequest, + GetApiRequest, + GetGatewayRequest, + ListApiConfigsRequest, + ListApiConfigsResponse, + ListApisRequest, + ListApisResponse, + ListGatewaysRequest, + ListGatewaysResponse, + OperationMetadata, + UpdateApiConfigRequest, + UpdateApiRequest, + UpdateGatewayRequest, +) __all__ = ( "ApiGatewayServiceAsyncClient", diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/__init__.py b/google/cloud/apigateway_v1/services/api_gateway_service/__init__.py index 7829f6a..3bc359c 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/__init__.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import ApiGatewayServiceClient from .async_client import ApiGatewayServiceAsyncClient +from .client import ApiGatewayServiceClient __all__ = ( "ApiGatewayServiceClient", diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index 00e5402..2057670 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -17,14 +17,14 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,14 +33,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.apigateway_v1.services.api_gateway_service import pagers -from google.cloud.apigateway_v1.types import apigateway from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import ApiGatewayServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import ApiGatewayServiceGrpcAsyncIOTransport + +from google.cloud.apigateway_v1.services.api_gateway_service import pagers +from google.cloud.apigateway_v1.types import apigateway + from .client import ApiGatewayServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, ApiGatewayServiceTransport +from .transports.grpc_asyncio import ApiGatewayServiceGrpcAsyncIOTransport class ApiGatewayServiceAsyncClient: diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/client.py b/google/cloud/apigateway_v1/services/api_gateway_service/client.py index 684b9b4..899f1fa 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/client.py @@ -17,17 +17,17 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,12 +36,14 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.apigateway_v1.services.api_gateway_service import pagers -from google.cloud.apigateway_v1.types import apigateway from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import ApiGatewayServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.apigateway_v1.services.api_gateway_service import pagers +from google.cloud.apigateway_v1.types import apigateway + +from .transports.base import DEFAULT_CLIENT_INFO, ApiGatewayServiceTransport from .transports.grpc import ApiGatewayServiceGrpcTransport from .transports.grpc_asyncio import ApiGatewayServiceGrpcAsyncIOTransport diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/pagers.py b/google/cloud/apigateway_v1/services/api_gateway_service/pagers.py index 4797726..3228ab3 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/pagers.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/pagers.py @@ -18,10 +18,10 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) from google.cloud.apigateway_v1.types import apigateway diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/__init__.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/__init__.py index 248e629..80f23e0 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/__init__.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import ApiGatewayServiceGrpcTransport from .grpc_asyncio import ApiGatewayServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[ApiGatewayServiceTransport]] _transport_registry["grpc"] = ApiGatewayServiceGrpcTransport diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py index bd04ccc..f9b9eeb 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/base.py @@ -15,19 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources from google.cloud.apigateway_v1.types import apigateway -from google.longrunning import operations_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py index 5d32c0a..22b0351 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc.py @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from google.cloud.apigateway_v1.types import apigateway -from google.longrunning import operations_pb2 # type: ignore -from .base import ApiGatewayServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ApiGatewayServiceTransport class ApiGatewayServiceGrpcTransport(ApiGatewayServiceTransport): diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc_asyncio.py b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc_asyncio.py index af70dcf..fc65625 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc_asyncio.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/transports/grpc_asyncio.py @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.api_core import operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.apigateway_v1.types import apigateway -from google.longrunning import operations_pb2 # type: ignore -from .base import ApiGatewayServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ApiGatewayServiceTransport from .grpc import ApiGatewayServiceGrpcTransport diff --git a/google/cloud/apigateway_v1/types/apigateway.py b/google/cloud/apigateway_v1/types/apigateway.py index 88b8e4c..f6306ff 100644 --- a/google/cloud/apigateway_v1/types/apigateway.py +++ b/google/cloud/apigateway_v1/types/apigateway.py @@ -13,11 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.apigateway.v1", diff --git a/noxfile.py b/noxfile.py index 6ee5e8a..7c1742d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/setup.py b/setup.py index 8b48c0a..e40a479 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ import io import os + import setuptools # type: ignore name = "google-cloud-api-gateway" diff --git a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index 73efaa2..6bbb655 100644 --- a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -13,42 +13,41 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError +from google.longrunning import operations_pb2 +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + from google.cloud.apigateway_v1.services.api_gateway_service import ( ApiGatewayServiceAsyncClient, -) -from google.cloud.apigateway_v1.services.api_gateway_service import ( ApiGatewayServiceClient, + pagers, + transports, ) -from google.cloud.apigateway_v1.services.api_gateway_service import pagers -from google.cloud.apigateway_v1.services.api_gateway_service import transports from google.cloud.apigateway_v1.types import apigateway -from google.longrunning import operations_pb2 -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -import google.auth def client_cert_source_callback(): From a18325774b353c3186bf04737539793571ac28ad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:22:14 +0000 Subject: [PATCH 11/19] chore(python): use ubuntu 22.04 in docs image (#129) Source-Link: https://github.com/googleapis/synthtool/commit/f15cc72fb401b4861cedebb10af74afe428fb1f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/docker/docs/Dockerfile | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7c454ab..64f82d6 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 -# created: 2022-04-20T23:42:53.970438194Z + digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd +# created: 2022-04-21T15:43:16.246106921Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] From 4c9a6a4f792cb157960d5d4d6640eb7265ad1e4c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 09:40:28 -0400 Subject: [PATCH 12/19] chore: use gapic-generator-python 0.65.2 (#130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../api_gateway_service/async_client.py | 90 ++++++------- .../apigateway_v1/test_api_gateway_service.py | 126 +++++++++--------- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index 2057670..a5c1dd1 100644 --- a/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -240,9 +240,9 @@ async def list_gateways( from google.cloud import apigateway_v1 - def sample_list_gateways(): + async def sample_list_gateways(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.ListGatewaysRequest( @@ -253,7 +253,7 @@ def sample_list_gateways(): page_result = client.list_gateways(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -348,9 +348,9 @@ async def get_gateway( from google.cloud import apigateway_v1 - def sample_get_gateway(): + async def sample_get_gateway(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.GetGatewayRequest( @@ -358,7 +358,7 @@ def sample_get_gateway(): ) # Make the request - response = client.get_gateway(request=request) + response = await client.get_gateway(request=request) # Handle the response print(response) @@ -450,9 +450,9 @@ async def create_gateway( from google.cloud import apigateway_v1 - def sample_create_gateway(): + async def sample_create_gateway(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) gateway = apigateway_v1.Gateway() @@ -469,7 +469,7 @@ def sample_create_gateway(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -594,9 +594,9 @@ async def update_gateway( from google.cloud import apigateway_v1 - def sample_update_gateway(): + async def sample_update_gateway(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) gateway = apigateway_v1.Gateway() @@ -611,7 +611,7 @@ def sample_update_gateway(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -731,9 +731,9 @@ async def delete_gateway( from google.cloud import apigateway_v1 - def sample_delete_gateway(): + async def sample_delete_gateway(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.DeleteGatewayRequest( @@ -745,7 +745,7 @@ def sample_delete_gateway(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -861,9 +861,9 @@ async def list_apis( from google.cloud import apigateway_v1 - def sample_list_apis(): + async def sample_list_apis(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.ListApisRequest( @@ -874,7 +874,7 @@ def sample_list_apis(): page_result = client.list_apis(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -969,9 +969,9 @@ async def get_api( from google.cloud import apigateway_v1 - def sample_get_api(): + async def sample_get_api(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.GetApiRequest( @@ -979,7 +979,7 @@ def sample_get_api(): ) # Make the request - response = client.get_api(request=request) + response = await client.get_api(request=request) # Handle the response print(response) @@ -1066,9 +1066,9 @@ async def create_api( from google.cloud import apigateway_v1 - def sample_create_api(): + async def sample_create_api(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.CreateApiRequest( @@ -1081,7 +1081,7 @@ def sample_create_api(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1205,9 +1205,9 @@ async def update_api( from google.cloud import apigateway_v1 - def sample_update_api(): + async def sample_update_api(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.UpdateApiRequest( @@ -1218,7 +1218,7 @@ def sample_update_api(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1335,9 +1335,9 @@ async def delete_api( from google.cloud import apigateway_v1 - def sample_delete_api(): + async def sample_delete_api(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.DeleteApiRequest( @@ -1349,7 +1349,7 @@ def sample_delete_api(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1465,9 +1465,9 @@ async def list_api_configs( from google.cloud import apigateway_v1 - def sample_list_api_configs(): + async def sample_list_api_configs(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.ListApiConfigsRequest( @@ -1478,7 +1478,7 @@ def sample_list_api_configs(): page_result = client.list_api_configs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1573,9 +1573,9 @@ async def get_api_config( from google.cloud import apigateway_v1 - def sample_get_api_config(): + async def sample_get_api_config(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.GetApiConfigRequest( @@ -1583,7 +1583,7 @@ def sample_get_api_config(): ) # Make the request - response = client.get_api_config(request=request) + response = await client.get_api_config(request=request) # Handle the response print(response) @@ -1672,9 +1672,9 @@ async def create_api_config( from google.cloud import apigateway_v1 - def sample_create_api_config(): + async def sample_create_api_config(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.CreateApiConfigRequest( @@ -1687,7 +1687,7 @@ def sample_create_api_config(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1810,9 +1810,9 @@ async def update_api_config( from google.cloud import apigateway_v1 - def sample_update_api_config(): + async def sample_update_api_config(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.UpdateApiConfigRequest( @@ -1823,7 +1823,7 @@ def sample_update_api_config(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1941,9 +1941,9 @@ async def delete_api_config( from google.cloud import apigateway_v1 - def sample_delete_api_config(): + async def sample_delete_api_config(): # Create a client - client = apigateway_v1.ApiGatewayServiceClient() + client = apigateway_v1.ApiGatewayServiceAsyncClient() # Initialize request argument(s) request = apigateway_v1.DeleteApiConfigRequest( @@ -1955,7 +1955,7 @@ def sample_delete_api_config(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index 6bbb655..5904980 100644 --- a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -772,7 +772,7 @@ def test_list_gateways_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.ListGatewaysRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_gateways), "__call__") as call: @@ -788,7 +788,7 @@ def test_list_gateways_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -802,7 +802,7 @@ async def test_list_gateways_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.ListGatewaysRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_gateways), "__call__") as call: @@ -820,7 +820,7 @@ async def test_list_gateways_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -951,7 +951,7 @@ def test_list_gateways_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, apigateway.Gateway) for i in results) @@ -1208,7 +1208,7 @@ def test_get_gateway_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.GetGatewayRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_gateway), "__call__") as call: @@ -1224,7 +1224,7 @@ def test_get_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1238,7 +1238,7 @@ async def test_get_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.GetGatewayRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_gateway), "__call__") as call: @@ -1254,7 +1254,7 @@ async def test_get_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1430,7 +1430,7 @@ def test_create_gateway_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.CreateGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_gateway), "__call__") as call: @@ -1446,7 +1446,7 @@ def test_create_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1460,7 +1460,7 @@ async def test_create_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.CreateGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_gateway), "__call__") as call: @@ -1478,7 +1478,7 @@ async def test_create_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1676,7 +1676,7 @@ def test_update_gateway_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.UpdateGatewayRequest() - request.gateway.name = "gateway.name/value" + request.gateway.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_gateway), "__call__") as call: @@ -1692,7 +1692,7 @@ def test_update_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "gateway.name=gateway.name/value", + "gateway.name=name_value", ) in kw["metadata"] @@ -1706,7 +1706,7 @@ async def test_update_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.UpdateGatewayRequest() - request.gateway.name = "gateway.name/value" + request.gateway.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_gateway), "__call__") as call: @@ -1724,7 +1724,7 @@ async def test_update_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "gateway.name=gateway.name/value", + "gateway.name=name_value", ) in kw["metadata"] @@ -1912,7 +1912,7 @@ def test_delete_gateway_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.DeleteGatewayRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_gateway), "__call__") as call: @@ -1928,7 +1928,7 @@ def test_delete_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1942,7 +1942,7 @@ async def test_delete_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.DeleteGatewayRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_gateway), "__call__") as call: @@ -1960,7 +1960,7 @@ async def test_delete_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2148,7 +2148,7 @@ def test_list_apis_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.ListApisRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_apis), "__call__") as call: @@ -2164,7 +2164,7 @@ def test_list_apis_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2178,7 +2178,7 @@ async def test_list_apis_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.ListApisRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_apis), "__call__") as call: @@ -2196,7 +2196,7 @@ async def test_list_apis_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2327,7 +2327,7 @@ def test_list_apis_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, apigateway.Api) for i in results) @@ -2580,7 +2580,7 @@ def test_get_api_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.GetApiRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api), "__call__") as call: @@ -2596,7 +2596,7 @@ def test_get_api_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2610,7 +2610,7 @@ async def test_get_api_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.GetApiRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api), "__call__") as call: @@ -2626,7 +2626,7 @@ async def test_get_api_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2802,7 +2802,7 @@ def test_create_api_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.CreateApiRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_api), "__call__") as call: @@ -2818,7 +2818,7 @@ def test_create_api_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2832,7 +2832,7 @@ async def test_create_api_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.CreateApiRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_api), "__call__") as call: @@ -2850,7 +2850,7 @@ async def test_create_api_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3048,7 +3048,7 @@ def test_update_api_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.UpdateApiRequest() - request.api.name = "api.name/value" + request.api.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_api), "__call__") as call: @@ -3064,7 +3064,7 @@ def test_update_api_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "api.name=api.name/value", + "api.name=name_value", ) in kw["metadata"] @@ -3078,7 +3078,7 @@ async def test_update_api_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.UpdateApiRequest() - request.api.name = "api.name/value" + request.api.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_api), "__call__") as call: @@ -3096,7 +3096,7 @@ async def test_update_api_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "api.name=api.name/value", + "api.name=name_value", ) in kw["metadata"] @@ -3284,7 +3284,7 @@ def test_delete_api_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.DeleteApiRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_api), "__call__") as call: @@ -3300,7 +3300,7 @@ def test_delete_api_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3314,7 +3314,7 @@ async def test_delete_api_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.DeleteApiRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_api), "__call__") as call: @@ -3332,7 +3332,7 @@ async def test_delete_api_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3520,7 +3520,7 @@ def test_list_api_configs_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.ListApiConfigsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_api_configs), "__call__") as call: @@ -3536,7 +3536,7 @@ def test_list_api_configs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3550,7 +3550,7 @@ async def test_list_api_configs_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.ListApiConfigsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_api_configs), "__call__") as call: @@ -3568,7 +3568,7 @@ async def test_list_api_configs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3699,7 +3699,7 @@ def test_list_api_configs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, apigateway.ApiConfig) for i in results) @@ -3956,7 +3956,7 @@ def test_get_api_config_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.GetApiConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api_config), "__call__") as call: @@ -3972,7 +3972,7 @@ def test_get_api_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3986,7 +3986,7 @@ async def test_get_api_config_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.GetApiConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_api_config), "__call__") as call: @@ -4004,7 +4004,7 @@ async def test_get_api_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4188,7 +4188,7 @@ def test_create_api_config_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.CreateApiConfigRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4206,7 +4206,7 @@ def test_create_api_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4220,7 +4220,7 @@ async def test_create_api_config_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.CreateApiConfigRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4240,7 +4240,7 @@ async def test_create_api_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4448,7 +4448,7 @@ def test_update_api_config_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.UpdateApiConfigRequest() - request.api_config.name = "api_config.name/value" + request.api_config.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4466,7 +4466,7 @@ def test_update_api_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "api_config.name=api_config.name/value", + "api_config.name=name_value", ) in kw["metadata"] @@ -4480,7 +4480,7 @@ async def test_update_api_config_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.UpdateApiConfigRequest() - request.api_config.name = "api_config.name/value" + request.api_config.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4500,7 +4500,7 @@ async def test_update_api_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "api_config.name=api_config.name/value", + "api_config.name=name_value", ) in kw["metadata"] @@ -4698,7 +4698,7 @@ def test_delete_api_config_field_headers(): # a field header. Set these to a non-empty value. request = apigateway.DeleteApiConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4716,7 +4716,7 @@ def test_delete_api_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4730,7 +4730,7 @@ async def test_delete_api_config_field_headers_async(): # a field header. Set these to a non-empty value. request = apigateway.DeleteApiConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4750,7 +4750,7 @@ async def test_delete_api_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] From da4688f123c367bad2648bfb0b59b0b9320f769a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 11:45:24 -0400 Subject: [PATCH 13/19] chore: [autoapprove] update readme_gen.py to include autoescape True (#131) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..b631901 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From c33c9ca821cec6bf4de96d4c4258bfe547d3b5a9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 23:34:22 +0000 Subject: [PATCH 14/19] chore(python): auto approve template changes (#133) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" From 429727b26baf86f8b30b52cc8aa3798cd5c28f75 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 13:46:11 -0400 Subject: [PATCH 15/19] chore: use gapic-generator-python 1.0.0 (#145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 1.0.0 PiperOrigin-RevId: 451250442 Source-Link: https://github.com/googleapis/googleapis/commit/cca5e8181f6442b134e8d4d206fbe9e0e74684ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/0b219da161a8bdcc3c6f7b2efcd82105182a30ca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../gapic/apigateway_v1/test_api_gateway_service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index 5904980..60b4eb8 100644 --- a/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -13,9 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import math import os +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock + +import math + from google.api_core import ( future, gapic_v1, @@ -37,7 +45,6 @@ from google.protobuf import timestamp_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest From c1c7fbf9dbf0968cc63a53d5d73dced9dce6d427 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 1 Jun 2022 22:30:55 -0400 Subject: [PATCH 16/19] fix(deps): require protobuf <4.0.0dev (#146) --- setup.py | 3 ++- testing/constraints-3.6.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e40a479..35489a7 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0", + "proto-plus >= 1.15.0, <2.0.0dev", + "protobuf >= 3.19.0, <4.0.0dev", ] package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index fe87928..e96de94 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -21,3 +21,4 @@ # Then this file should have foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 +protobuf==3.19.0 From 6e7f4f1b2310ae510dff2bbcfb262385b090c6d7 Mon Sep 17 00:00:00 2001 From: Dan Lee <71398022+dandhlee@users.noreply.github.com> Date: Thu, 2 Jun 2022 20:40:28 -0400 Subject: [PATCH 17/19] docs: fix changelog header to consistent size (#147) Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bab9e7b..cb676cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -### [1.2.1](https://github.com/googleapis/python-api-gateway/compare/v1.2.0...v1.2.1) (2022-03-05) +## [1.2.1](https://github.com/googleapis/python-api-gateway/compare/v1.2.0...v1.2.1) (2022-03-05) ### Bug Fixes @@ -25,7 +25,7 @@ * add autogenerated code snippets ([033bbc4](https://github.com/googleapis/python-api-gateway/commit/033bbc4c27b13e369df1b4527558f0a4de54fe80)) -### [1.1.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.1.0...v1.1.1) (2021-11-01) +## [1.1.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.1.0...v1.1.1) (2021-11-01) ### Bug Fixes @@ -51,14 +51,14 @@ * improper types in pagers generation ([fc86cd1](https://www.github.com/googleapis/python-api-gateway/commit/fc86cd1c93a932c3c205524040d8547f70dbfb1c)) -### [1.0.4](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.3...v1.0.4) (2021-09-24) +## [1.0.4](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.3...v1.0.4) (2021-09-24) ### Bug Fixes * add 'dict' annotation type to 'request' ([39ee308](https://www.github.com/googleapis/python-api-gateway/commit/39ee308769c9d999acca90c5ac56e4cd5806c822)) -### [1.0.3](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.2...v1.0.3) (2021-07-27) +## [1.0.3](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.2...v1.0.3) (2021-07-27) ### Bug Fixes @@ -75,14 +75,14 @@ * release as 1.0.3 ([#53](https://www.github.com/googleapis/python-api-gateway/issues/53)) ([aa6e493](https://www.github.com/googleapis/python-api-gateway/commit/aa6e49383d2df7b88282ee9fe032e802758a564f)) -### [1.0.2](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.1...v1.0.2) (2021-07-21) +## [1.0.2](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.1...v1.0.2) (2021-07-21) ### Bug Fixes * **deps:** pin 'google-{api,cloud}-core', 'google-auth' to allow 2.x versions ([#47](https://www.github.com/googleapis/python-api-gateway/issues/47)) ([17aed88](https://www.github.com/googleapis/python-api-gateway/commit/17aed8856fd9143e141ffc5c6ff51c0fc8937743)) -### [1.0.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.0...v1.0.1) (2021-07-12) +## [1.0.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.0...v1.0.1) (2021-07-12) ### Bug Fixes @@ -90,7 +90,7 @@ * disable always_use_jwt_access ([b2869e6](https://www.github.com/googleapis/python-api-gateway/commit/b2869e6fc540d65af1bdcf4329f8c888ab61de9a)) * disable always_use_jwt_access ([#41](https://www.github.com/googleapis/python-api-gateway/issues/41)) ([b2869e6](https://www.github.com/googleapis/python-api-gateway/commit/b2869e6fc540d65af1bdcf4329f8c888ab61de9a)) -### [1.0.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.0...v1.0.1) (2021-06-30) +## [1.0.1](https://www.github.com/googleapis/python-api-gateway/compare/v1.0.0...v1.0.1) (2021-06-30) ### Bug Fixes From 136ca3928c6255708305d7785c6b61173f85d00a Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 3 Jun 2022 12:52:00 -0400 Subject: [PATCH 18/19] chore: test minimum dependencies in python 3.7 (#150) --- testing/constraints-3.7.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29..e96de94 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,24 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +google-api-core==1.31.5 +proto-plus==1.15.0 +protobuf==3.19.0 From a84c6a9be9acc7cca7a284e694bf03caa6127651 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 18:18:39 -0400 Subject: [PATCH 19/19] chore(main): release 1.2.2 (#148) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 12 ++++++++++++ setup.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb676cd..af3e1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.2.2](https://github.com/googleapis/python-api-gateway/compare/v1.2.1...v1.2.2) (2022-06-03) + + +### Bug Fixes + +* **deps:** require protobuf <4.0.0dev ([#146](https://github.com/googleapis/python-api-gateway/issues/146)) ([c1c7fbf](https://github.com/googleapis/python-api-gateway/commit/c1c7fbf9dbf0968cc63a53d5d73dced9dce6d427)) + + +### Documentation + +* fix changelog header to consistent size ([#147](https://github.com/googleapis/python-api-gateway/issues/147)) ([6e7f4f1](https://github.com/googleapis/python-api-gateway/commit/6e7f4f1b2310ae510dff2bbcfb262385b090c6d7)) + ## [1.2.1](https://github.com/googleapis/python-api-gateway/compare/v1.2.0...v1.2.1) (2022-03-05) diff --git a/setup.py b/setup.py index 35489a7..2d61547 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import setuptools # type: ignore name = "google-cloud-api-gateway" -version = "1.2.1" +version = "1.2.2" description = "API Gateway client library" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-api-gateway"