From 87586768a13a48270c2a1f8da6444b8c9589c779 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:28 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#44) - [ ] 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/private_catalog/client.py | 14 +++++++------- .../services/private_catalog/transports/base.py | 2 +- .../services/private_catalog/transports/grpc.py | 6 +++--- .../private_catalog/transports/grpc_asyncio.py | 6 +++--- ...1beta1_private_catalog_search_catalogs_async.py | 3 ++- ...v1beta1_private_catalog_search_catalogs_sync.py | 3 ++- ...1beta1_private_catalog_search_products_async.py | 3 ++- ...v1beta1_private_catalog_search_products_sync.py | 3 ++- ...1beta1_private_catalog_search_versions_async.py | 4 +++- ...v1beta1_private_catalog_search_versions_sync.py | 4 +++- .../fixup_privatecatalog_v1beta1_keywords.py | 8 ++++---- 11 files changed, 32 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/client.py b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/client.py index 18b4ed15bd18..753c9805c8c9 100644 --- a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/client.py +++ b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/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 @@ -396,7 +396,7 @@ def __init__( def search_catalogs( self, - request: private_catalog.SearchCatalogsRequest = None, + request: Union[private_catalog.SearchCatalogsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -407,7 +407,7 @@ def search_catalogs( consumer cloud resource hierarchy context. Args: - request (google.cloud.privatecatalog_v1beta1.types.SearchCatalogsRequest): + request (Union[google.cloud.privatecatalog_v1beta1.types.SearchCatalogsRequest, dict]): The request object. Request message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -457,7 +457,7 @@ def search_catalogs( def search_products( self, - request: private_catalog.SearchProductsRequest = None, + request: Union[private_catalog.SearchProductsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -468,7 +468,7 @@ def search_products( consumer cloud resource hierarchy context. Args: - request (google.cloud.privatecatalog_v1beta1.types.SearchProductsRequest): + request (Union[google.cloud.privatecatalog_v1beta1.types.SearchProductsRequest, dict]): The request object. Request message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -518,7 +518,7 @@ def search_products( def search_versions( self, - request: private_catalog.SearchVersionsRequest = None, + request: Union[private_catalog.SearchVersionsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -529,7 +529,7 @@ def search_versions( consumer cloud resource hierarchy context. Args: - request (google.cloud.privatecatalog_v1beta1.types.SearchVersionsRequest): + request (Union[google.cloud.privatecatalog_v1beta1.types.SearchVersionsRequest, dict]): The request object. Request message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions]. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/base.py b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/base.py index 53d47b3bc1e3..6d6a48e85e53 100644 --- a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/base.py +++ b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/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/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc.py b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc.py index 9dde44530405..bc8ca55bb11a 100644 --- a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc.py +++ b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc.py @@ -101,16 +101,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-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc_asyncio.py b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc_asyncio.py index bf66254751c5..7b729965cffd 100644 --- a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc_asyncio.py +++ b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/services/private_catalog/transports/grpc_asyncio.py @@ -148,16 +148,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-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_async.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_async.py index fb14bd5e34aa..172218332aff 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_async.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_async.py @@ -35,11 +35,12 @@ async def sample_search_catalogs(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchCatalogsRequest( + resource="resource_value", ) # Make the request page_result = client.search_catalogs(request=request) async for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchCatalogs_async] diff --git a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_sync.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_sync.py index 9ac17f19c969..2abf298cfd22 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_sync.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_catalogs_sync.py @@ -35,11 +35,12 @@ def sample_search_catalogs(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchCatalogsRequest( + resource="resource_value", ) # Make the request page_result = client.search_catalogs(request=request) for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchCatalogs_sync] diff --git a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_async.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_async.py index 68be717e7bfa..ca4768bb6bb1 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_async.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_async.py @@ -35,11 +35,12 @@ async def sample_search_products(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchProductsRequest( + resource="resource_value", ) # Make the request page_result = client.search_products(request=request) async for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchProducts_async] diff --git a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_sync.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_sync.py index 0ef79642015f..a0daa33c671c 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_sync.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_products_sync.py @@ -35,11 +35,12 @@ def sample_search_products(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchProductsRequest( + resource="resource_value", ) # Make the request page_result = client.search_products(request=request) for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchProducts_sync] diff --git a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_async.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_async.py index 6db54f4473bf..56ce621545da 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_async.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_async.py @@ -35,11 +35,13 @@ async def sample_search_versions(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchVersionsRequest( + resource="resource_value", + query="query_value", ) # Make the request page_result = client.search_versions(request=request) async for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchVersions_async] diff --git a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_sync.py b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_sync.py index 3a7625e20120..7949686514a6 100644 --- a/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_sync.py +++ b/packages/google-cloud-private-catalog/samples/generated_samples/cloudprivatecatalog_generated_privatecatalog_v1beta1_private_catalog_search_versions_sync.py @@ -35,11 +35,13 @@ def sample_search_versions(): # Initialize request argument(s) request = privatecatalog_v1beta1.SearchVersionsRequest( + resource="resource_value", + query="query_value", ) # Make the request page_result = client.search_versions(request=request) for response in page_result: - print("{}".format(response)) + print(response) # [END cloudprivatecatalog_generated_privatecatalog_v1beta1_PrivateCatalog_SearchVersions_sync] diff --git a/packages/google-cloud-private-catalog/scripts/fixup_privatecatalog_v1beta1_keywords.py b/packages/google-cloud-private-catalog/scripts/fixup_privatecatalog_v1beta1_keywords.py index c390c80ce262..e7afdd236b13 100644 --- a/packages/google-cloud-private-catalog/scripts/fixup_privatecatalog_v1beta1_keywords.py +++ b/packages/google-cloud-private-catalog/scripts/fixup_privatecatalog_v1beta1_keywords.py @@ -39,9 +39,9 @@ def partition( class privatecatalogCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'search_catalogs': ('resource', 'query', 'page_size', 'page_token', ), - 'search_products': ('resource', 'query', 'page_size', 'page_token', ), - 'search_versions': ('resource', 'query', 'page_size', 'page_token', ), + 'search_catalogs': ('resource', 'query', 'page_size', 'page_token', ), + 'search_products': ('resource', 'query', 'page_size', 'page_token', ), + 'search_versions': ('resource', 'query', 'page_size', 'page_token', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -60,7 +60,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 )