From 50db178c9dec3b1214d537da0a9bd9088d9ebf43 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 16:00:25 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#46) - [ ] Regenerate this pull request now. fix: add 'dict' annotation type to 'request' Committer: @busunkim96 PiperOrigin-RevId: 398509016 Source-Link: https://github.com/googleapis/googleapis/commit/b224dfa52642a733ea64849d4e06d15c274bc08f Source-Link: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9 --- .../services/connection_service/client.py | 6 +++--- .../services/connection_service/transports/base.py | 2 +- .../services/connection_service/transports/grpc.py | 6 +++--- .../connection_service/transports/grpc_asyncio.py | 6 +++--- .../cloud/apigeeconnect_v1/services/tether/client.py | 12 +----------- .../services/tether/transports/base.py | 2 +- .../services/tether/transports/grpc.py | 6 +++--- .../services/tether/transports/grpc_asyncio.py | 6 +++--- scripts/fixup_apigeeconnect_v1_keywords.py | 6 +++--- 9 files changed, 21 insertions(+), 31 deletions(-) diff --git a/google/cloud/apigeeconnect_v1/services/connection_service/client.py b/google/cloud/apigeeconnect_v1/services/connection_service/client.py index 0923c89..86dc687 100644 --- a/google/cloud/apigeeconnect_v1/services/connection_service/client.py +++ b/google/cloud/apigeeconnect_v1/services/connection_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -353,7 +353,7 @@ def __init__( def list_connections( self, - request: connection.ListConnectionsRequest = None, + request: Union[connection.ListConnectionsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -364,7 +364,7 @@ def list_connections( given Apigee Connect endpoint. Args: - request (google.cloud.apigeeconnect_v1.types.ListConnectionsRequest): + request (Union[google.cloud.apigeeconnect_v1.types.ListConnectionsRequest, dict]): The request object. The request for [ListConnections][Management.ListConnections]. parent (str): diff --git a/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py b/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py index 3a93550..4f299a0 100644 --- a/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py +++ b/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py b/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py index c9d4913..2f7bd41 100644 --- a/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py +++ b/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py @@ -81,16 +81,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py b/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py index 93ff5d8..0feca49 100644 --- a/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py +++ b/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py @@ -128,16 +128,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/apigeeconnect_v1/services/tether/client.py b/google/cloud/apigeeconnect_v1/services/tether/client.py index 4aa5c86..d2aeb89 100644 --- a/google/cloud/apigeeconnect_v1/services/tether/client.py +++ b/google/cloud/apigeeconnect_v1/services/tether/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore diff --git a/google/cloud/apigeeconnect_v1/services/tether/transports/base.py b/google/cloud/apigeeconnect_v1/services/tether/transports/base.py index b7ae91b..0afb887 100644 --- a/google/cloud/apigeeconnect_v1/services/tether/transports/base.py +++ b/google/cloud/apigeeconnect_v1/services/tether/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/apigeeconnect_v1/services/tether/transports/grpc.py b/google/cloud/apigeeconnect_v1/services/tether/transports/grpc.py index b3780a3..808e219 100644 --- a/google/cloud/apigeeconnect_v1/services/tether/transports/grpc.py +++ b/google/cloud/apigeeconnect_v1/services/tether/transports/grpc.py @@ -83,16 +83,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py b/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py index 89b6509..73cf521 100644 --- a/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py +++ b/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py @@ -130,16 +130,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/scripts/fixup_apigeeconnect_v1_keywords.py b/scripts/fixup_apigeeconnect_v1_keywords.py index f0db5ed..5665359 100644 --- a/scripts/fixup_apigeeconnect_v1_keywords.py +++ b/scripts/fixup_apigeeconnect_v1_keywords.py @@ -39,8 +39,8 @@ def partition( class apigeeconnectCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'egress': ('id', 'http_response', 'status', 'project', 'trace_id', 'endpoint', 'name', ), - 'list_connections': ('parent', 'page_size', 'page_token', ), + 'egress': ('id', 'http_response', 'status', 'project', 'trace_id', 'endpoint', 'name', ), + 'list_connections': ('parent', 'page_size', 'page_token', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -59,7 +59,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs )