From 02dbc4a6cddf932436f24c3df53cf9e8e819b1e7 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 (#79) - [ ] 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 --- .../gkehub_v1/services/gke_hub/client.py | 46 +++++++++---------- .../services/gke_hub/transports/base.py | 2 +- .../services/gke_hub/transports/grpc.py | 6 +-- .../gke_hub/transports/grpc_asyncio.py | 6 +-- .../fixup_configmanagement_v1_keywords.py | 2 +- .../scripts/fixup_gkehub_v1_keywords.py | 24 +++++----- .../fixup_multiclusteringress_v1_keywords.py | 2 +- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py index f3ed8f7ffb39..13791ab97deb 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/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 @@ -387,7 +387,7 @@ def __init__( def list_memberships( self, - request: service.ListMembershipsRequest = None, + request: Union[service.ListMembershipsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -397,7 +397,7 @@ def list_memberships( r"""Lists Memberships in a given project and location. Args: - request (google.cloud.gkehub_v1.types.ListMembershipsRequest): + request (Union[google.cloud.gkehub_v1.types.ListMembershipsRequest, dict]): The request object. Request message for `GkeHub.ListMemberships` method. parent (str): @@ -467,7 +467,7 @@ def list_memberships( def list_features( self, - request: service.ListFeaturesRequest = None, + request: Union[service.ListFeaturesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -477,7 +477,7 @@ def list_features( r"""Lists Features in a given project and location. Args: - request (google.cloud.gkehub_v1.types.ListFeaturesRequest): + request (Union[google.cloud.gkehub_v1.types.ListFeaturesRequest, dict]): The request object. Request message for `GkeHub.ListFeatures` method. parent (str): @@ -547,7 +547,7 @@ def list_features( def get_membership( self, - request: service.GetMembershipRequest = None, + request: Union[service.GetMembershipRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -557,7 +557,7 @@ def get_membership( r"""Gets the details of a Membership. Args: - request (google.cloud.gkehub_v1.types.GetMembershipRequest): + request (Union[google.cloud.gkehub_v1.types.GetMembershipRequest, dict]): The request object. Request message for `GkeHub.GetMembership` method. name (str): @@ -618,7 +618,7 @@ def get_membership( def get_feature( self, - request: service.GetFeatureRequest = None, + request: Union[service.GetFeatureRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -628,7 +628,7 @@ def get_feature( r"""Gets details of a single Feature. Args: - request (google.cloud.gkehub_v1.types.GetFeatureRequest): + request (Union[google.cloud.gkehub_v1.types.GetFeatureRequest, dict]): The request object. Request message for `GkeHub.GetFeature` method. name (str): @@ -689,7 +689,7 @@ def get_feature( def create_membership( self, - request: service.CreateMembershipRequest = None, + request: Union[service.CreateMembershipRequest, dict] = None, *, parent: str = None, resource: membership.Membership = None, @@ -705,7 +705,7 @@ def create_membership( https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster. Args: - request (google.cloud.gkehub_v1.types.CreateMembershipRequest): + request (Union[google.cloud.gkehub_v1.types.CreateMembershipRequest, dict]): The request object. Request message for the `GkeHub.CreateMembership` method. parent (str): @@ -804,7 +804,7 @@ def create_membership( def create_feature( self, - request: service.CreateFeatureRequest = None, + request: Union[service.CreateFeatureRequest, dict] = None, *, parent: str = None, resource: feature.Feature = None, @@ -816,7 +816,7 @@ def create_feature( r"""Adds a new Feature. Args: - request (google.cloud.gkehub_v1.types.CreateFeatureRequest): + request (Union[google.cloud.gkehub_v1.types.CreateFeatureRequest, dict]): The request object. Request message for the `GkeHub.CreateFeature` method. parent (str): @@ -903,7 +903,7 @@ def create_feature( def delete_membership( self, - request: service.DeleteMembershipRequest = None, + request: Union[service.DeleteMembershipRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -918,7 +918,7 @@ def delete_membership( https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. Args: - request (google.cloud.gkehub_v1.types.DeleteMembershipRequest): + request (Union[google.cloud.gkehub_v1.types.DeleteMembershipRequest, dict]): The request object. Request message for `GkeHub.DeleteMembership` method. name (str): @@ -1000,7 +1000,7 @@ def delete_membership( def delete_feature( self, - request: service.DeleteFeatureRequest = None, + request: Union[service.DeleteFeatureRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1010,7 +1010,7 @@ def delete_feature( r"""Removes a Feature. Args: - request (google.cloud.gkehub_v1.types.DeleteFeatureRequest): + request (Union[google.cloud.gkehub_v1.types.DeleteFeatureRequest, dict]): The request object. Request message for `GkeHub.DeleteFeature` method. name (str): @@ -1092,7 +1092,7 @@ def delete_feature( def update_membership( self, - request: service.UpdateMembershipRequest = None, + request: Union[service.UpdateMembershipRequest, dict] = None, *, name: str = None, resource: membership.Membership = None, @@ -1104,7 +1104,7 @@ def update_membership( r"""Updates an existing Membership. Args: - request (google.cloud.gkehub_v1.types.UpdateMembershipRequest): + request (Union[google.cloud.gkehub_v1.types.UpdateMembershipRequest, dict]): The request object. Request message for `GkeHub.UpdateMembership` method. name (str): @@ -1199,7 +1199,7 @@ def update_membership( def update_feature( self, - request: service.UpdateFeatureRequest = None, + request: Union[service.UpdateFeatureRequest, dict] = None, *, name: str = None, resource: feature.Feature = None, @@ -1211,7 +1211,7 @@ def update_feature( r"""Updates an existing Feature. Args: - request (google.cloud.gkehub_v1.types.UpdateFeatureRequest): + request (Union[google.cloud.gkehub_v1.types.UpdateFeatureRequest, dict]): The request object. Request message for `GkeHub.UpdateFeature` method. name (str): @@ -1306,7 +1306,7 @@ def update_feature( def generate_connect_manifest( self, - request: service.GenerateConnectManifestRequest = None, + request: Union[service.GenerateConnectManifestRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -1318,7 +1318,7 @@ def generate_connect_manifest( Most clients should not need to call this method directly. Args: - request (google.cloud.gkehub_v1.types.GenerateConnectManifestRequest): + request (Union[google.cloud.gkehub_v1.types.GenerateConnectManifestRequest, dict]): The request object. Request message for `GkeHub.GenerateConnectManifest` method. . diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/base.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/base.py index 9b814e661f5e..c8635df893c4 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/base.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/base.py @@ -119,7 +119,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/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc.py index 0d1dff545524..f4dcee36418f 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc.py @@ -97,16 +97,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/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc_asyncio.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc_asyncio.py index 2b759381f54c..7438d4653d83 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc_asyncio.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/transports/grpc_asyncio.py @@ -144,16 +144,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/packages/google-cloud-gke-hub/scripts/fixup_configmanagement_v1_keywords.py b/packages/google-cloud-gke-hub/scripts/fixup_configmanagement_v1_keywords.py index b06f1d05e82c..d05df20560af 100644 --- a/packages/google-cloud-gke-hub/scripts/fixup_configmanagement_v1_keywords.py +++ b/packages/google-cloud-gke-hub/scripts/fixup_configmanagement_v1_keywords.py @@ -57,7 +57,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 ) diff --git a/packages/google-cloud-gke-hub/scripts/fixup_gkehub_v1_keywords.py b/packages/google-cloud-gke-hub/scripts/fixup_gkehub_v1_keywords.py index a8a2a9b6e1cb..fb73262d9807 100644 --- a/packages/google-cloud-gke-hub/scripts/fixup_gkehub_v1_keywords.py +++ b/packages/google-cloud-gke-hub/scripts/fixup_gkehub_v1_keywords.py @@ -39,17 +39,17 @@ def partition( class gkehubCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_feature': ('parent', 'feature_id', 'resource', 'request_id', ), - 'create_membership': ('parent', 'membership_id', 'resource', 'request_id', ), - 'delete_feature': ('name', 'force', 'request_id', ), - 'delete_membership': ('name', 'request_id', ), - 'generate_connect_manifest': ('name', 'namespace', 'proxy', 'version', 'is_upgrade', 'registry', 'image_pull_secret_content', ), - 'get_feature': ('name', ), - 'get_membership': ('name', ), - 'list_features': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ), - 'list_memberships': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ), - 'update_feature': ('name', 'update_mask', 'resource', 'request_id', ), - 'update_membership': ('name', 'update_mask', 'resource', 'request_id', ), + 'create_feature': ('parent', 'feature_id', 'resource', 'request_id', ), + 'create_membership': ('parent', 'membership_id', 'resource', 'request_id', ), + 'delete_feature': ('name', 'force', 'request_id', ), + 'delete_membership': ('name', 'request_id', ), + 'generate_connect_manifest': ('name', 'namespace', 'proxy', 'version', 'is_upgrade', 'registry', 'image_pull_secret_content', ), + 'get_feature': ('name', ), + 'get_membership': ('name', ), + 'list_features': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ), + 'list_memberships': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ), + 'update_feature': ('name', 'update_mask', 'resource', 'request_id', ), + 'update_membership': ('name', 'update_mask', 'resource', 'request_id', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -68,7 +68,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 ) diff --git a/packages/google-cloud-gke-hub/scripts/fixup_multiclusteringress_v1_keywords.py b/packages/google-cloud-gke-hub/scripts/fixup_multiclusteringress_v1_keywords.py index e15ebbc4480c..8bcb5cd9c684 100644 --- a/packages/google-cloud-gke-hub/scripts/fixup_multiclusteringress_v1_keywords.py +++ b/packages/google-cloud-gke-hub/scripts/fixup_multiclusteringress_v1_keywords.py @@ -57,7 +57,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 )