From 6780c7adc14fb7063597d6c9a514d0b33fc5dcd6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:06:25 -0500 Subject: [PATCH] fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: https://github.com/googleapis/googleapis/commit/fea43879f83a8d0dacc9353b3f75f8f46d37162f Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py * add gapic_version.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .coveragerc | 5 -- google/cloud/retail_v2/gapic_version.py | 16 ++++++ .../services/catalog_service/async_client.py | 36 ++++++------- .../services/catalog_service/client.py | 36 ++++++------- .../catalog_service/transports/base.py | 13 ++--- .../completion_service/async_client.py | 20 +++---- .../services/completion_service/client.py | 18 +++---- .../completion_service/transports/base.py | 13 ++--- .../services/control_service/async_client.py | 24 ++++----- .../services/control_service/client.py | 24 ++++----- .../control_service/transports/base.py | 13 ++--- .../prediction_service/async_client.py | 16 +++--- .../services/prediction_service/client.py | 16 +++--- .../prediction_service/transports/base.py | 13 ++--- .../services/product_service/async_client.py | 48 ++++++++--------- .../services/product_service/client.py | 36 ++++++------- .../product_service/transports/base.py | 13 ++--- .../services/search_service/async_client.py | 16 +++--- .../services/search_service/client.py | 16 +++--- .../search_service/transports/base.py | 13 ++--- .../serving_config_service/async_client.py | 28 +++++----- .../services/serving_config_service/client.py | 28 +++++----- .../serving_config_service/transports/base.py | 13 ++--- .../user_event_service/async_client.py | 30 +++++------ .../services/user_event_service/client.py | 24 ++++----- .../user_event_service/transports/base.py | 13 ++--- google/cloud/retail_v2alpha/gapic_version.py | 16 ++++++ .../services/catalog_service/async_client.py | 36 ++++++------- .../services/catalog_service/client.py | 36 ++++++------- .../catalog_service/transports/base.py | 13 ++--- .../completion_service/async_client.py | 20 +++---- .../services/completion_service/client.py | 18 +++---- .../completion_service/transports/base.py | 13 ++--- .../services/control_service/async_client.py | 24 ++++----- .../services/control_service/client.py | 24 ++++----- .../control_service/transports/base.py | 13 ++--- .../services/model_service/async_client.py | 32 +++++------- .../services/model_service/client.py | 28 +++++----- .../services/model_service/transports/base.py | 13 ++--- .../prediction_service/async_client.py | 16 +++--- .../services/prediction_service/client.py | 16 +++--- .../prediction_service/transports/base.py | 13 ++--- .../services/product_service/async_client.py | 52 +++++++++---------- .../services/product_service/client.py | 38 ++++++-------- .../product_service/transports/base.py | 13 ++--- .../services/search_service/async_client.py | 16 +++--- .../services/search_service/client.py | 16 +++--- .../search_service/transports/base.py | 13 ++--- .../serving_config_service/async_client.py | 28 +++++----- .../services/serving_config_service/client.py | 28 +++++----- .../serving_config_service/transports/base.py | 13 ++--- .../user_event_service/async_client.py | 30 +++++------ .../services/user_event_service/client.py | 24 ++++----- .../user_event_service/transports/base.py | 13 ++--- google/cloud/retail_v2beta/gapic_version.py | 16 ++++++ .../services/catalog_service/async_client.py | 38 ++++++-------- .../services/catalog_service/client.py | 38 ++++++-------- .../catalog_service/transports/base.py | 13 ++--- .../completion_service/async_client.py | 20 +++---- .../services/completion_service/client.py | 18 +++---- .../completion_service/transports/base.py | 13 ++--- .../services/control_service/async_client.py | 24 ++++----- .../services/control_service/client.py | 24 ++++----- .../control_service/transports/base.py | 13 ++--- .../services/model_service/async_client.py | 32 +++++------- .../services/model_service/client.py | 28 +++++----- .../services/model_service/transports/base.py | 13 ++--- .../prediction_service/async_client.py | 16 +++--- .../services/prediction_service/client.py | 16 +++--- .../prediction_service/transports/base.py | 13 ++--- .../services/product_service/async_client.py | 48 ++++++++--------- .../services/product_service/client.py | 36 ++++++------- .../product_service/transports/base.py | 13 ++--- .../services/search_service/async_client.py | 16 +++--- .../services/search_service/client.py | 16 +++--- .../search_service/transports/base.py | 13 ++--- .../serving_config_service/async_client.py | 28 +++++----- .../services/serving_config_service/client.py | 28 +++++----- .../serving_config_service/transports/base.py | 13 ++--- .../user_event_service/async_client.py | 30 +++++------ .../services/user_event_service/client.py | 24 ++++----- .../user_event_service/transports/base.py | 13 ++--- release-please-config.json | 3 ++ ...on_service_import_completion_data_async.py | 2 +- ...ct_service_add_fulfillment_places_async.py | 2 +- ...uct_service_add_local_inventories_async.py | 2 +- ...d_product_service_import_products_async.py | 2 +- ...service_remove_fulfillment_places_async.py | 2 +- ..._service_remove_local_inventories_async.py | 2 +- ...ted_product_service_set_inventory_async.py | 2 +- ..._event_service_import_user_events_async.py | 2 +- ...r_event_service_purge_user_events_async.py | 2 +- ..._event_service_rejoin_user_events_async.py | 2 +- ...on_service_import_completion_data_async.py | 2 +- ...erated_model_service_create_model_async.py | 2 +- ...enerated_model_service_tune_model_async.py | 2 +- ...ct_service_add_fulfillment_places_async.py | 2 +- ...uct_service_add_local_inventories_async.py | 2 +- ...d_product_service_import_products_async.py | 2 +- ...ed_product_service_purge_products_async.py | 2 +- ...service_remove_fulfillment_places_async.py | 2 +- ..._service_remove_local_inventories_async.py | 2 +- ...ted_product_service_set_inventory_async.py | 2 +- ..._event_service_import_user_events_async.py | 2 +- ...r_event_service_purge_user_events_async.py | 2 +- ..._event_service_rejoin_user_events_async.py | 2 +- ...on_service_import_completion_data_async.py | 2 +- ...erated_model_service_create_model_async.py | 2 +- ...enerated_model_service_tune_model_async.py | 2 +- ...ct_service_add_fulfillment_places_async.py | 2 +- ...uct_service_add_local_inventories_async.py | 2 +- ...d_product_service_import_products_async.py | 2 +- ...service_remove_fulfillment_places_async.py | 2 +- ..._service_remove_local_inventories_async.py | 2 +- ...ted_product_service_set_inventory_async.py | 2 +- ..._event_service_import_user_events_async.py | 2 +- ...r_event_service_purge_user_events_async.py | 2 +- ..._event_service_rejoin_user_events_async.py | 2 +- setup.py | 2 +- testing/constraints-3.7.txt | 2 +- 120 files changed, 777 insertions(+), 1069 deletions(-) create mode 100644 google/cloud/retail_v2/gapic_version.py create mode 100644 google/cloud/retail_v2alpha/gapic_version.py create mode 100644 google/cloud/retail_v2beta/gapic_version.py diff --git a/.coveragerc b/.coveragerc index a8b114f0..6f8bebe0 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/google/cloud/retail_v2/gapic_version.py b/google/cloud/retail_v2/gapic_version.py new file mode 100644 index 00000000..2400e8f4 --- /dev/null +++ b/google/cloud/retail_v2/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.10.2" # {x-release-please-version} diff --git a/google/cloud/retail_v2/services/catalog_service/async_client.py b/google/cloud/retail_v2/services/catalog_service/async_client.py index 7e313c7c..195b98f3 100644 --- a/google/cloud/retail_v2/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2/services/catalog_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -234,7 +235,7 @@ async def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsAsyncPager: r"""Lists all the [Catalog][google.cloud.retail.v2.Catalog]s @@ -358,7 +359,7 @@ async def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2.Catalog]s. @@ -485,7 +486,7 @@ async def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -608,7 +609,7 @@ async def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -713,7 +714,7 @@ async def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -821,7 +822,7 @@ async def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -959,7 +960,7 @@ async def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1064,7 +1065,7 @@ async def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1196,7 +1197,7 @@ async def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1289,7 +1290,7 @@ async def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1379,7 +1380,7 @@ async def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1474,14 +1475,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/catalog_service/client.py b/google/cloud/retail_v2/services/catalog_service/client.py index 7b1135c7..2ece1ea5 100644 --- a/google/cloud/retail_v2/services/catalog_service/client.py +++ b/google/cloud/retail_v2/services/catalog_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -519,7 +520,7 @@ def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsPager: r"""Lists all the [Catalog][google.cloud.retail.v2.Catalog]s @@ -643,7 +644,7 @@ def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2.Catalog]s. @@ -770,7 +771,7 @@ def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -893,7 +894,7 @@ def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -998,7 +999,7 @@ def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -1106,7 +1107,7 @@ def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -1244,7 +1245,7 @@ def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1349,7 +1350,7 @@ def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1481,7 +1482,7 @@ def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1575,7 +1576,7 @@ def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1666,7 +1667,7 @@ def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1771,14 +1772,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceClient",) diff --git a/google/cloud/retail_v2/services/catalog_service/transports/base.py b/google/cloud/retail_v2/services/catalog_service/transports/base.py index 13ebe4a1..027605d7 100644 --- a/google/cloud/retail_v2/services/catalog_service/transports/base.py +++ b/google/cloud/retail_v2/services/catalog_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import catalog from google.cloud.retail_v2.types import catalog as gcr_catalog from google.cloud.retail_v2.types import catalog_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CatalogServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/completion_service/async_client.py b/google/cloud/retail_v2/services/completion_service/async_client.py index 5511ee9f..37392b0d 100644 --- a/google/cloud/retail_v2/services/completion_service/async_client.py +++ b/google/cloud/retail_v2/services/completion_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -308,7 +309,7 @@ async def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of processed completion dataset. @@ -351,7 +352,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -421,14 +422,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/completion_service/client.py b/google/cloud/retail_v2/services/completion_service/client.py index 092d38a1..7e5d9bab 100644 --- a/google/cloud/retail_v2/services/completion_service/client.py +++ b/google/cloud/retail_v2/services/completion_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -451,7 +452,7 @@ def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -536,7 +537,7 @@ def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of processed completion dataset. @@ -657,14 +658,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceClient",) diff --git a/google/cloud/retail_v2/services/completion_service/transports/base.py b/google/cloud/retail_v2/services/completion_service/transports/base.py index 40fa0647..865c617b 100644 --- a/google/cloud/retail_v2/services/completion_service/transports/base.py +++ b/google/cloud/retail_v2/services/completion_service/transports/base.py @@ -24,18 +24,13 @@ 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.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import completion_service, import_config -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CompletionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/control_service/async_client.py b/google/cloud/retail_v2/services/control_service/async_client.py index a7fed6f9..920261fe 100644 --- a/google/cloud/retail_v2/services/control_service/async_client.py +++ b/google/cloud/retail_v2/services/control_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -228,7 +229,7 @@ async def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -360,7 +361,7 @@ async def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -454,7 +455,7 @@ async def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -580,7 +581,7 @@ async def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -684,7 +685,7 @@ async def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsAsyncPager: r"""Lists all Controls by their parent @@ -799,14 +800,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/control_service/client.py b/google/cloud/retail_v2/services/control_service/client.py index 6877454b..e814177d 100644 --- a/google/cloud/retail_v2/services/control_service/client.py +++ b/google/cloud/retail_v2/services/control_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -477,7 +478,7 @@ def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -609,7 +610,7 @@ def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -703,7 +704,7 @@ def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -829,7 +830,7 @@ def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -933,7 +934,7 @@ def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsPager: r"""Lists all Controls by their parent @@ -1055,14 +1056,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceClient",) diff --git a/google/cloud/retail_v2/services/control_service/transports/base.py b/google/cloud/retail_v2/services/control_service/transports/base.py index d6ad95d3..414e6161 100644 --- a/google/cloud/retail_v2/services/control_service/transports/base.py +++ b/google/cloud/retail_v2/services/control_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import control from google.cloud.retail_v2.types import control as gcr_control from google.cloud.retail_v2.types import control_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ControlServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/prediction_service/async_client.py b/google/cloud/retail_v2/services/prediction_service/async_client.py index 6cf8119f..d87f3f9e 100644 --- a/google/cloud/retail_v2/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2/services/prediction_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -217,7 +218,7 @@ async def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -303,14 +304,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/prediction_service/client.py b/google/cloud/retail_v2/services/prediction_service/client.py index b1f0874d..62d16e7c 100644 --- a/google/cloud/retail_v2/services/prediction_service/client.py +++ b/google/cloud/retail_v2/services/prediction_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -448,7 +449,7 @@ def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -542,14 +543,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceClient",) diff --git a/google/cloud/retail_v2/services/prediction_service/transports/base.py b/google/cloud/retail_v2/services/prediction_service/transports/base.py index ad418079..560a463a 100644 --- a/google/cloud/retail_v2/services/prediction_service/transports/base.py +++ b/google/cloud/retail_v2/services/prediction_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import prediction_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class PredictionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/product_service/async_client.py b/google/cloud/retail_v2/services/product_service/async_client.py index 65afcca7..48557666 100644 --- a/google/cloud/retail_v2/services/product_service/async_client.py +++ b/google/cloud/retail_v2/services/product_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -235,7 +236,7 @@ async def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2.Product]. @@ -378,7 +379,7 @@ async def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2.Product]. @@ -492,7 +493,7 @@ async def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsAsyncPager: r"""Gets a list of [Product][google.cloud.retail.v2.Product]s. @@ -617,7 +618,7 @@ async def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2.Product]. @@ -755,7 +756,7 @@ async def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2.Product]. @@ -868,7 +869,7 @@ async def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of multiple @@ -910,7 +911,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -989,7 +990,7 @@ async def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates inventory information for a @@ -1074,7 +1075,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1245,7 +1246,7 @@ async def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally adds place IDs to @@ -1300,7 +1301,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1397,7 +1398,7 @@ async def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally removes place IDs from a @@ -1452,7 +1453,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1549,7 +1550,7 @@ async def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates local inventory information for a @@ -1611,7 +1612,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1710,7 +1711,7 @@ async def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Remove local inventory information for a @@ -1770,7 +1771,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1868,14 +1869,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/product_service/client.py b/google/cloud/retail_v2/services/product_service/client.py index c9f28453..8dc56a9d 100644 --- a/google/cloud/retail_v2/services/product_service/client.py +++ b/google/cloud/retail_v2/services/product_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -488,7 +489,7 @@ def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2.Product]. @@ -631,7 +632,7 @@ def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2.Product]. @@ -745,7 +746,7 @@ def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsPager: r"""Gets a list of [Product][google.cloud.retail.v2.Product]s. @@ -870,7 +871,7 @@ def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2.Product]. @@ -1008,7 +1009,7 @@ def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2.Product]. @@ -1121,7 +1122,7 @@ def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of multiple @@ -1233,7 +1234,7 @@ def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates inventory information for a @@ -1489,7 +1490,7 @@ def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally adds place IDs to @@ -1641,7 +1642,7 @@ def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally removes place IDs from a @@ -1795,7 +1796,7 @@ def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates local inventory information for a @@ -1956,7 +1957,7 @@ def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Remove local inventory information for a @@ -2121,14 +2122,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceClient",) diff --git a/google/cloud/retail_v2/services/product_service/transports/base.py b/google/cloud/retail_v2/services/product_service/transports/base.py index 3f273c9c..46ac91e3 100644 --- a/google/cloud/retail_v2/services/product_service/transports/base.py +++ b/google/cloud/retail_v2/services/product_service/transports/base.py @@ -25,21 +25,16 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import import_config from google.cloud.retail_v2.types import product from google.cloud.retail_v2.types import product as gcr_product from google.cloud.retail_v2.types import product_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ProductServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/search_service/async_client.py b/google/cloud/retail_v2/services/search_service/async_client.py index 4d7c44cd..a58609f4 100644 --- a/google/cloud/retail_v2/services/search_service/async_client.py +++ b/google/cloud/retail_v2/services/search_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchAsyncPager: r"""Performs a search. @@ -327,14 +328,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/search_service/client.py b/google/cloud/retail_v2/services/search_service/client.py index 4f00bd16..9ada1b58 100644 --- a/google/cloud/retail_v2/services/search_service/client.py +++ b/google/cloud/retail_v2/services/search_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchPager: r"""Performs a search. @@ -586,14 +587,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceClient",) diff --git a/google/cloud/retail_v2/services/search_service/transports/base.py b/google/cloud/retail_v2/services/search_service/transports/base.py index e7787fab..f26dbb40 100644 --- a/google/cloud/retail_v2/services/search_service/transports/base.py +++ b/google/cloud/retail_v2/services/search_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import search_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SearchServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/serving_config_service/async_client.py b/google/cloud/retail_v2/services/serving_config_service/async_client.py index 4b47073b..1f30d92c 100644 --- a/google/cloud/retail_v2/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2/services/serving_config_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -372,7 +373,7 @@ async def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -468,7 +469,7 @@ async def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -594,7 +595,7 @@ async def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -702,7 +703,7 @@ async def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsAsyncPager: r"""Lists all ServingConfigs linked to this catalog. @@ -817,7 +818,7 @@ async def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -932,7 +933,7 @@ async def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1042,14 +1043,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/serving_config_service/client.py b/google/cloud/retail_v2/services/serving_config_service/client.py index 964b8ed6..a65383ee 100644 --- a/google/cloud/retail_v2/services/serving_config_service/client.py +++ b/google/cloud/retail_v2/services/serving_config_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -479,7 +480,7 @@ def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -618,7 +619,7 @@ def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -714,7 +715,7 @@ def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -840,7 +841,7 @@ def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -948,7 +949,7 @@ def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsPager: r"""Lists all ServingConfigs linked to this catalog. @@ -1063,7 +1064,7 @@ def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -1178,7 +1179,7 @@ def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1295,14 +1296,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceClient",) diff --git a/google/cloud/retail_v2/services/serving_config_service/transports/base.py b/google/cloud/retail_v2/services/serving_config_service/transports/base.py index 353d14be..4aa300a4 100644 --- a/google/cloud/retail_v2/services/serving_config_service/transports/base.py +++ b/google/cloud/retail_v2/services/serving_config_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import serving_config from google.cloud.retail_v2.types import serving_config as gcr_serving_config from google.cloud.retail_v2.types import serving_config_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ServingConfigServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2/services/user_event_service/async_client.py b/google/cloud/retail_v2/services/user_event_service/async_client.py index 1ea27d42..e5191b95 100644 --- a/google/cloud/retail_v2/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2/services/user_event_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -322,7 +323,7 @@ async def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -452,7 +453,7 @@ async def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes permanently all user events specified by the @@ -487,7 +488,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -562,7 +563,7 @@ async def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of User events. Request processing might be @@ -603,7 +604,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -682,7 +683,7 @@ async def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Starts a user event rejoin operation with latest @@ -722,7 +723,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -789,14 +790,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceAsyncClient",) diff --git a/google/cloud/retail_v2/services/user_event_service/client.py b/google/cloud/retail_v2/services/user_event_service/client.py index 3795ed06..068feb92 100644 --- a/google/cloud/retail_v2/services/user_event_service/client.py +++ b/google/cloud/retail_v2/services/user_event_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -484,7 +485,7 @@ def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -574,7 +575,7 @@ def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -705,7 +706,7 @@ def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes permanently all user events specified by the @@ -806,7 +807,7 @@ def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of User events. Request processing might be @@ -917,7 +918,7 @@ def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Starts a user event rejoin operation with latest @@ -1032,14 +1033,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceClient",) diff --git a/google/cloud/retail_v2/services/user_event_service/transports/base.py b/google/cloud/retail_v2/services/user_event_service/transports/base.py index 10898fa3..3c73de82 100644 --- a/google/cloud/retail_v2/services/user_event_service/transports/base.py +++ b/google/cloud/retail_v2/services/user_event_service/transports/base.py @@ -25,8 +25,8 @@ 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.retail_v2 import gapic_version as package_version from google.cloud.retail_v2.types import ( import_config, purge_config, @@ -34,14 +34,9 @@ user_event_service, ) -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class UserEventServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/gapic_version.py b/google/cloud/retail_v2alpha/gapic_version.py new file mode 100644 index 00000000..2400e8f4 --- /dev/null +++ b/google/cloud/retail_v2alpha/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.10.2" # {x-release-please-version} diff --git a/google/cloud/retail_v2alpha/services/catalog_service/async_client.py b/google/cloud/retail_v2alpha/services/catalog_service/async_client.py index 7c42a8e4..31f18947 100644 --- a/google/cloud/retail_v2alpha/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/catalog_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -234,7 +235,7 @@ async def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsAsyncPager: r"""Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s @@ -358,7 +359,7 @@ async def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. @@ -487,7 +488,7 @@ async def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -610,7 +611,7 @@ async def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -715,7 +716,7 @@ async def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -823,7 +824,7 @@ async def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -961,7 +962,7 @@ async def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1066,7 +1067,7 @@ async def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1198,7 +1199,7 @@ async def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1292,7 +1293,7 @@ async def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1383,7 +1384,7 @@ async def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1479,14 +1480,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/catalog_service/client.py b/google/cloud/retail_v2alpha/services/catalog_service/client.py index 65813ed5..78178bd6 100644 --- a/google/cloud/retail_v2alpha/services/catalog_service/client.py +++ b/google/cloud/retail_v2alpha/services/catalog_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -519,7 +520,7 @@ def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsPager: r"""Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s @@ -643,7 +644,7 @@ def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. @@ -772,7 +773,7 @@ def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -895,7 +896,7 @@ def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -1000,7 +1001,7 @@ def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -1108,7 +1109,7 @@ def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -1246,7 +1247,7 @@ def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1351,7 +1352,7 @@ def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1483,7 +1484,7 @@ def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1578,7 +1579,7 @@ def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1670,7 +1671,7 @@ def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1776,14 +1777,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py b/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py index 11488e21..f0da4fa4 100644 --- a/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import catalog from google.cloud.retail_v2alpha.types import catalog as gcr_catalog from google.cloud.retail_v2alpha.types import catalog_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CatalogServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/completion_service/async_client.py b/google/cloud/retail_v2alpha/services/completion_service/async_client.py index 839b7a4e..d6d73995 100644 --- a/google/cloud/retail_v2alpha/services/completion_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/completion_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -308,7 +309,7 @@ async def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of processed completion dataset. @@ -351,7 +352,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -421,14 +422,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/completion_service/client.py b/google/cloud/retail_v2alpha/services/completion_service/client.py index 088100cf..a457f9a7 100644 --- a/google/cloud/retail_v2alpha/services/completion_service/client.py +++ b/google/cloud/retail_v2alpha/services/completion_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -451,7 +452,7 @@ def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -536,7 +537,7 @@ def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of processed completion dataset. @@ -657,14 +658,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/completion_service/transports/base.py b/google/cloud/retail_v2alpha/services/completion_service/transports/base.py index 96873a8e..6d46f160 100644 --- a/google/cloud/retail_v2alpha/services/completion_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/completion_service/transports/base.py @@ -24,18 +24,13 @@ 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.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import completion_service, import_config -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CompletionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/control_service/async_client.py b/google/cloud/retail_v2alpha/services/control_service/async_client.py index 23945ff0..c3c0e055 100644 --- a/google/cloud/retail_v2alpha/services/control_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/control_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -228,7 +229,7 @@ async def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -362,7 +363,7 @@ async def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -456,7 +457,7 @@ async def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -584,7 +585,7 @@ async def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -688,7 +689,7 @@ async def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsAsyncPager: r"""Lists all Controls linked to this catalog. @@ -802,14 +803,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/control_service/client.py b/google/cloud/retail_v2alpha/services/control_service/client.py index 38ea30d4..1a273d4c 100644 --- a/google/cloud/retail_v2alpha/services/control_service/client.py +++ b/google/cloud/retail_v2alpha/services/control_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -477,7 +478,7 @@ def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -611,7 +612,7 @@ def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -705,7 +706,7 @@ def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -833,7 +834,7 @@ def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -937,7 +938,7 @@ def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsPager: r"""Lists all Controls linked to this catalog. @@ -1058,14 +1059,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/control_service/transports/base.py b/google/cloud/retail_v2alpha/services/control_service/transports/base.py index bfcc5061..856b55ca 100644 --- a/google/cloud/retail_v2alpha/services/control_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/control_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import control from google.cloud.retail_v2alpha.types import control as gcr_control from google.cloud.retail_v2alpha.types import control_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ControlServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/model_service/async_client.py b/google/cloud/retail_v2alpha/services/model_service/async_client.py index 457e717f..67b0a66b 100644 --- a/google/cloud/retail_v2alpha/services/model_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/model_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -238,7 +239,7 @@ async def create_model( parent: Optional[str] = None, model: Optional[gcr_model.Model] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new model. @@ -277,7 +278,7 @@ async def sample_create_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -374,7 +375,7 @@ async def pause_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Pauses the training of an existing model. @@ -480,7 +481,7 @@ async def resume_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Resumes the training of an existing model. @@ -586,7 +587,7 @@ async def delete_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing model. @@ -676,7 +677,7 @@ async def list_models( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListModelsAsyncPager: r"""Lists all the models linked to this event store. @@ -791,7 +792,7 @@ async def update_model( model: Optional[gcr_model.Model] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be @@ -917,7 +918,7 @@ async def tune_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Tunes an existing model. @@ -947,7 +948,7 @@ async def sample_tune_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1037,14 +1038,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ModelServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/model_service/client.py b/google/cloud/retail_v2alpha/services/model_service/client.py index 93134ea0..1f160eec 100644 --- a/google/cloud/retail_v2alpha/services/model_service/client.py +++ b/google/cloud/retail_v2alpha/services/model_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -489,7 +490,7 @@ def create_model( parent: Optional[str] = None, model: Optional[gcr_model.Model] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new model. @@ -625,7 +626,7 @@ def pause_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Pauses the training of an existing model. @@ -731,7 +732,7 @@ def resume_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Resumes the training of an existing model. @@ -837,7 +838,7 @@ def delete_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing model. @@ -927,7 +928,7 @@ def list_models( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListModelsPager: r"""Lists all the models linked to this event store. @@ -1042,7 +1043,7 @@ def update_model( model: Optional[gcr_model.Model] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be @@ -1168,7 +1169,7 @@ def tune_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Tunes an existing model. @@ -1295,14 +1296,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ModelServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/model_service/transports/base.py b/google/cloud/retail_v2alpha/services/model_service/transports/base.py index 0cfde0a8..58391213 100644 --- a/google/cloud/retail_v2alpha/services/model_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/model_service/transports/base.py @@ -25,20 +25,15 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import model from google.cloud.retail_v2alpha.types import model as gcr_model from google.cloud.retail_v2alpha.types import model_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ModelServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/prediction_service/async_client.py b/google/cloud/retail_v2alpha/services/prediction_service/async_client.py index cf1e5d26..6ea788f6 100644 --- a/google/cloud/retail_v2alpha/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/prediction_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -217,7 +218,7 @@ async def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -303,14 +304,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/prediction_service/client.py b/google/cloud/retail_v2alpha/services/prediction_service/client.py index a2354dc1..e94a7889 100644 --- a/google/cloud/retail_v2alpha/services/prediction_service/client.py +++ b/google/cloud/retail_v2alpha/services/prediction_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -448,7 +449,7 @@ def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -542,14 +543,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/prediction_service/transports/base.py b/google/cloud/retail_v2alpha/services/prediction_service/transports/base.py index d96d303a..5ef7c86e 100644 --- a/google/cloud/retail_v2alpha/services/prediction_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/prediction_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import prediction_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class PredictionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/product_service/async_client.py b/google/cloud/retail_v2alpha/services/product_service/async_client.py index 83f3de5d..6241ffbc 100644 --- a/google/cloud/retail_v2alpha/services/product_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/product_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -235,7 +236,7 @@ async def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2alpha.Product]. @@ -380,7 +381,7 @@ async def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2alpha.Product]. @@ -494,7 +495,7 @@ async def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsAsyncPager: r"""Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. @@ -619,7 +620,7 @@ async def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2alpha.Product]. @@ -757,7 +758,7 @@ async def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2alpha.Product]. @@ -871,7 +872,7 @@ async def purge_products( request: Optional[Union[purge_config.PurgeProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Permanently deletes all selected @@ -921,7 +922,7 @@ async def sample_purge_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -986,7 +987,7 @@ async def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of multiple @@ -1028,7 +1029,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1107,7 +1108,7 @@ async def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates inventory information for a @@ -1185,7 +1186,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1357,7 +1358,7 @@ async def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally adds place IDs to @@ -1405,7 +1406,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1502,7 +1503,7 @@ async def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally removes place IDs from a @@ -1550,7 +1551,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1647,7 +1648,7 @@ async def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates local inventory information for a @@ -1702,7 +1703,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1801,7 +1802,7 @@ async def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Remove local inventory information for a @@ -1854,7 +1855,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1952,14 +1953,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/product_service/client.py b/google/cloud/retail_v2alpha/services/product_service/client.py index 067eb386..a8543d2a 100644 --- a/google/cloud/retail_v2alpha/services/product_service/client.py +++ b/google/cloud/retail_v2alpha/services/product_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -488,7 +489,7 @@ def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2alpha.Product]. @@ -633,7 +634,7 @@ def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2alpha.Product]. @@ -747,7 +748,7 @@ def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsPager: r"""Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. @@ -872,7 +873,7 @@ def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2alpha.Product]. @@ -1010,7 +1011,7 @@ def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2alpha.Product]. @@ -1124,7 +1125,7 @@ def purge_products( request: Optional[Union[purge_config.PurgeProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Permanently deletes all selected @@ -1240,7 +1241,7 @@ def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of multiple @@ -1352,7 +1353,7 @@ def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates inventory information for a @@ -1602,7 +1603,7 @@ def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally adds place IDs to @@ -1747,7 +1748,7 @@ def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally removes place IDs from a @@ -1894,7 +1895,7 @@ def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates local inventory information for a @@ -2048,7 +2049,7 @@ def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Remove local inventory information for a @@ -2206,14 +2207,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/product_service/transports/base.py b/google/cloud/retail_v2alpha/services/product_service/transports/base.py index d81e9237..57df3e1a 100644 --- a/google/cloud/retail_v2alpha/services/product_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/product_service/transports/base.py @@ -25,21 +25,16 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import import_config from google.cloud.retail_v2alpha.types import product from google.cloud.retail_v2alpha.types import product as gcr_product from google.cloud.retail_v2alpha.types import product_service, purge_config -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ProductServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/search_service/async_client.py b/google/cloud/retail_v2alpha/services/search_service/async_client.py index 1efd7e29..2592f641 100644 --- a/google/cloud/retail_v2alpha/services/search_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/search_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchAsyncPager: r"""Performs a search. @@ -327,14 +328,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/search_service/client.py b/google/cloud/retail_v2alpha/services/search_service/client.py index 8463b9c8..65e8c781 100644 --- a/google/cloud/retail_v2alpha/services/search_service/client.py +++ b/google/cloud/retail_v2alpha/services/search_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchPager: r"""Performs a search. @@ -586,14 +587,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/search_service/transports/base.py b/google/cloud/retail_v2alpha/services/search_service/transports/base.py index 61e92a3f..b5fff27c 100644 --- a/google/cloud/retail_v2alpha/services/search_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/search_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import search_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SearchServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py b/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py index 42c5ace9..3c5abdf1 100644 --- a/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -373,7 +374,7 @@ async def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -469,7 +470,7 @@ async def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -596,7 +597,7 @@ async def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -705,7 +706,7 @@ async def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsAsyncPager: r"""Lists all ServingConfigs linked to this catalog. @@ -820,7 +821,7 @@ async def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -936,7 +937,7 @@ async def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1047,14 +1048,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/serving_config_service/client.py b/google/cloud/retail_v2alpha/services/serving_config_service/client.py index 26c22089..109b2bb1 100644 --- a/google/cloud/retail_v2alpha/services/serving_config_service/client.py +++ b/google/cloud/retail_v2alpha/services/serving_config_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -479,7 +480,7 @@ def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -619,7 +620,7 @@ def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -715,7 +716,7 @@ def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -842,7 +843,7 @@ def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -951,7 +952,7 @@ def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsPager: r"""Lists all ServingConfigs linked to this catalog. @@ -1066,7 +1067,7 @@ def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -1182,7 +1183,7 @@ def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1300,14 +1301,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/serving_config_service/transports/base.py b/google/cloud/retail_v2alpha/services/serving_config_service/transports/base.py index c9e86cf7..f2a245ab 100644 --- a/google/cloud/retail_v2alpha/services/serving_config_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/serving_config_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import serving_config as gcr_serving_config from google.cloud.retail_v2alpha.types import serving_config from google.cloud.retail_v2alpha.types import serving_config_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ServingConfigServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2alpha/services/user_event_service/async_client.py b/google/cloud/retail_v2alpha/services/user_event_service/async_client.py index d5723675..272662a1 100644 --- a/google/cloud/retail_v2alpha/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/user_event_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -322,7 +323,7 @@ async def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -452,7 +453,7 @@ async def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes permanently all user events specified by the @@ -487,7 +488,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -562,7 +563,7 @@ async def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of User events. Request processing might @@ -603,7 +604,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -682,7 +683,7 @@ async def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Starts a user event rejoin operation with latest @@ -722,7 +723,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -789,14 +790,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceAsyncClient",) diff --git a/google/cloud/retail_v2alpha/services/user_event_service/client.py b/google/cloud/retail_v2alpha/services/user_event_service/client.py index 563232ad..34fa2b44 100644 --- a/google/cloud/retail_v2alpha/services/user_event_service/client.py +++ b/google/cloud/retail_v2alpha/services/user_event_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -484,7 +485,7 @@ def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -574,7 +575,7 @@ def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -705,7 +706,7 @@ def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes permanently all user events specified by the @@ -806,7 +807,7 @@ def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of User events. Request processing might @@ -917,7 +918,7 @@ def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Starts a user event rejoin operation with latest @@ -1032,14 +1033,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceClient",) diff --git a/google/cloud/retail_v2alpha/services/user_event_service/transports/base.py b/google/cloud/retail_v2alpha/services/user_event_service/transports/base.py index 8da8a131..4f7f8573 100644 --- a/google/cloud/retail_v2alpha/services/user_event_service/transports/base.py +++ b/google/cloud/retail_v2alpha/services/user_event_service/transports/base.py @@ -25,8 +25,8 @@ 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.retail_v2alpha import gapic_version as package_version from google.cloud.retail_v2alpha.types import ( import_config, purge_config, @@ -34,14 +34,9 @@ user_event_service, ) -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class UserEventServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/gapic_version.py b/google/cloud/retail_v2beta/gapic_version.py new file mode 100644 index 00000000..2400e8f4 --- /dev/null +++ b/google/cloud/retail_v2beta/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.10.2" # {x-release-please-version} diff --git a/google/cloud/retail_v2beta/services/catalog_service/async_client.py b/google/cloud/retail_v2beta/services/catalog_service/async_client.py index d236a0fd..6ba3fcba 100644 --- a/google/cloud/retail_v2beta/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2beta/services/catalog_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -234,7 +235,7 @@ async def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsAsyncPager: r"""Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s @@ -358,7 +359,7 @@ async def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. @@ -485,7 +486,7 @@ async def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -608,7 +609,7 @@ async def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -713,7 +714,7 @@ async def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -821,7 +822,7 @@ async def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -959,7 +960,7 @@ async def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1064,7 +1065,7 @@ async def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1196,7 +1197,7 @@ async def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1290,7 +1291,7 @@ async def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1381,7 +1382,7 @@ async def batch_remove_catalog_attributes( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.BatchRemoveCatalogAttributesResponse: r"""Removes all specified @@ -1470,7 +1471,7 @@ async def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1566,14 +1567,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/catalog_service/client.py b/google/cloud/retail_v2beta/services/catalog_service/client.py index 5270e042..5ddce5c0 100644 --- a/google/cloud/retail_v2beta/services/catalog_service/client.py +++ b/google/cloud/retail_v2beta/services/catalog_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -519,7 +520,7 @@ def list_catalogs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCatalogsPager: r"""Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s @@ -643,7 +644,7 @@ def update_catalog( catalog: Optional[gcr_catalog.Catalog] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_catalog.Catalog: r"""Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. @@ -770,7 +771,7 @@ def set_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Set a specified branch id as default branch. API methods such as @@ -893,7 +894,7 @@ def get_default_branch( *, catalog: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.GetDefaultBranchResponse: r"""Get which branch is currently default branch set by @@ -998,7 +999,7 @@ def get_completion_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Gets a @@ -1106,7 +1107,7 @@ def update_completion_config( completion_config: Optional[catalog.CompletionConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.CompletionConfig: r"""Updates the @@ -1244,7 +1245,7 @@ def get_attributes_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Gets an @@ -1349,7 +1350,7 @@ def update_attributes_config( attributes_config: Optional[catalog.AttributesConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Updates the @@ -1481,7 +1482,7 @@ def add_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Adds the specified @@ -1576,7 +1577,7 @@ def remove_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Removes the specified @@ -1668,7 +1669,7 @@ def batch_remove_catalog_attributes( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog_service.BatchRemoveCatalogAttributesResponse: r"""Removes all specified @@ -1760,7 +1761,7 @@ def replace_catalog_attribute( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> catalog.AttributesConfig: r"""Replaces the specified @@ -1866,14 +1867,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CatalogServiceClient",) diff --git a/google/cloud/retail_v2beta/services/catalog_service/transports/base.py b/google/cloud/retail_v2beta/services/catalog_service/transports/base.py index 10129cdc..d65176b4 100644 --- a/google/cloud/retail_v2beta/services/catalog_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/catalog_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import catalog from google.cloud.retail_v2beta.types import catalog as gcr_catalog from google.cloud.retail_v2beta.types import catalog_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CatalogServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/completion_service/async_client.py b/google/cloud/retail_v2beta/services/completion_service/async_client.py index c4ab79b1..14f6ebc5 100644 --- a/google/cloud/retail_v2beta/services/completion_service/async_client.py +++ b/google/cloud/retail_v2beta/services/completion_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -308,7 +309,7 @@ async def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of processed completion dataset. @@ -351,7 +352,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -421,14 +422,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/completion_service/client.py b/google/cloud/retail_v2beta/services/completion_service/client.py index 7576ba09..a1519cb1 100644 --- a/google/cloud/retail_v2beta/services/completion_service/client.py +++ b/google/cloud/retail_v2beta/services/completion_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -451,7 +452,7 @@ def complete_query( request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> completion_service.CompleteQueryResponse: r"""Completes the specified prefix with keyword @@ -536,7 +537,7 @@ def import_completion_data( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of processed completion dataset. @@ -657,14 +658,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CompletionServiceClient",) diff --git a/google/cloud/retail_v2beta/services/completion_service/transports/base.py b/google/cloud/retail_v2beta/services/completion_service/transports/base.py index 2ddc30e2..e23bdd6b 100644 --- a/google/cloud/retail_v2beta/services/completion_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/completion_service/transports/base.py @@ -24,18 +24,13 @@ 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.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import completion_service, import_config -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CompletionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/control_service/async_client.py b/google/cloud/retail_v2beta/services/control_service/async_client.py index db582a5c..743c953d 100644 --- a/google/cloud/retail_v2beta/services/control_service/async_client.py +++ b/google/cloud/retail_v2beta/services/control_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -228,7 +229,7 @@ async def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -361,7 +362,7 @@ async def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -455,7 +456,7 @@ async def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -582,7 +583,7 @@ async def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -686,7 +687,7 @@ async def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsAsyncPager: r"""Lists all Controls by their parent @@ -801,14 +802,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/control_service/client.py b/google/cloud/retail_v2beta/services/control_service/client.py index a713abce..210badae 100644 --- a/google/cloud/retail_v2beta/services/control_service/client.py +++ b/google/cloud/retail_v2beta/services/control_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -477,7 +478,7 @@ def create_control( control: Optional[gcr_control.Control] = None, control_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Creates a Control. @@ -610,7 +611,7 @@ def delete_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a Control. @@ -704,7 +705,7 @@ def update_control( control: Optional[gcr_control.Control] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_control.Control: r"""Updates a Control. @@ -831,7 +832,7 @@ def get_control( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> control.Control: r"""Gets a Control. @@ -935,7 +936,7 @@ def list_controls( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsPager: r"""Lists all Controls by their parent @@ -1057,14 +1058,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ControlServiceClient",) diff --git a/google/cloud/retail_v2beta/services/control_service/transports/base.py b/google/cloud/retail_v2beta/services/control_service/transports/base.py index ad228f4b..01900e35 100644 --- a/google/cloud/retail_v2beta/services/control_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/control_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import control from google.cloud.retail_v2beta.types import control as gcr_control from google.cloud.retail_v2beta.types import control_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ControlServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/model_service/async_client.py b/google/cloud/retail_v2beta/services/model_service/async_client.py index 7d420538..f1afc1d3 100644 --- a/google/cloud/retail_v2beta/services/model_service/async_client.py +++ b/google/cloud/retail_v2beta/services/model_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -238,7 +239,7 @@ async def create_model( parent: Optional[str] = None, model: Optional[gcr_model.Model] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new model. @@ -274,7 +275,7 @@ async def sample_create_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -373,7 +374,7 @@ async def pause_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Pauses the training of an existing model. @@ -479,7 +480,7 @@ async def resume_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Resumes the training of an existing model. @@ -585,7 +586,7 @@ async def delete_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing model. @@ -676,7 +677,7 @@ async def list_models( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListModelsAsyncPager: r"""Lists all the models linked to this event store. @@ -791,7 +792,7 @@ async def update_model( model: Optional[gcr_model.Model] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be @@ -916,7 +917,7 @@ async def tune_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Tunes an existing model. @@ -946,7 +947,7 @@ async def sample_tune_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1036,14 +1037,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ModelServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/model_service/client.py b/google/cloud/retail_v2beta/services/model_service/client.py index 320d4e95..b4fad643 100644 --- a/google/cloud/retail_v2beta/services/model_service/client.py +++ b/google/cloud/retail_v2beta/services/model_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -489,7 +490,7 @@ def create_model( parent: Optional[str] = None, model: Optional[gcr_model.Model] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new model. @@ -624,7 +625,7 @@ def pause_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Pauses the training of an existing model. @@ -730,7 +731,7 @@ def resume_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> model.Model: r"""Resumes the training of an existing model. @@ -836,7 +837,7 @@ def delete_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing model. @@ -927,7 +928,7 @@ def list_models( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListModelsPager: r"""Lists all the models linked to this event store. @@ -1042,7 +1043,7 @@ def update_model( model: Optional[gcr_model.Model] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be @@ -1167,7 +1168,7 @@ def tune_model( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Tunes an existing model. @@ -1294,14 +1295,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ModelServiceClient",) diff --git a/google/cloud/retail_v2beta/services/model_service/transports/base.py b/google/cloud/retail_v2beta/services/model_service/transports/base.py index e6c23415..492c7c71 100644 --- a/google/cloud/retail_v2beta/services/model_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/model_service/transports/base.py @@ -25,20 +25,15 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import model from google.cloud.retail_v2beta.types import model as gcr_model from google.cloud.retail_v2beta.types import model_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ModelServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/prediction_service/async_client.py b/google/cloud/retail_v2beta/services/prediction_service/async_client.py index 6655ff97..fcd3a46c 100644 --- a/google/cloud/retail_v2beta/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2beta/services/prediction_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -217,7 +218,7 @@ async def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -303,14 +304,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/prediction_service/client.py b/google/cloud/retail_v2beta/services/prediction_service/client.py index 41707344..66730671 100644 --- a/google/cloud/retail_v2beta/services/prediction_service/client.py +++ b/google/cloud/retail_v2beta/services/prediction_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -448,7 +449,7 @@ def predict( request: Optional[Union[prediction_service.PredictRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> prediction_service.PredictResponse: r"""Makes a recommendation prediction. @@ -542,14 +543,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PredictionServiceClient",) diff --git a/google/cloud/retail_v2beta/services/prediction_service/transports/base.py b/google/cloud/retail_v2beta/services/prediction_service/transports/base.py index c36be9f9..e9c214a7 100644 --- a/google/cloud/retail_v2beta/services/prediction_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/prediction_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import prediction_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class PredictionServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/product_service/async_client.py b/google/cloud/retail_v2beta/services/product_service/async_client.py index ab2afb91..536ce83e 100644 --- a/google/cloud/retail_v2beta/services/product_service/async_client.py +++ b/google/cloud/retail_v2beta/services/product_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -235,7 +236,7 @@ async def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2beta.Product]. @@ -379,7 +380,7 @@ async def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2beta.Product]. @@ -493,7 +494,7 @@ async def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsAsyncPager: r"""Gets a list of [Product][google.cloud.retail.v2beta.Product]s. @@ -618,7 +619,7 @@ async def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2beta.Product]. @@ -756,7 +757,7 @@ async def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2beta.Product]. @@ -870,7 +871,7 @@ async def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of multiple @@ -912,7 +913,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -991,7 +992,7 @@ async def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates inventory information for a @@ -1080,7 +1081,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1251,7 +1252,7 @@ async def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally adds place IDs to @@ -1309,7 +1310,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1406,7 +1407,7 @@ async def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Incrementally removes place IDs from a @@ -1464,7 +1465,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1561,7 +1562,7 @@ async def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates local inventory information for a @@ -1626,7 +1627,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1725,7 +1726,7 @@ async def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Remove local inventory information for a @@ -1788,7 +1789,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1886,14 +1887,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/product_service/client.py b/google/cloud/retail_v2beta/services/product_service/client.py index 6d4fd7c8..c5c05041 100644 --- a/google/cloud/retail_v2beta/services/product_service/client.py +++ b/google/cloud/retail_v2beta/services/product_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -488,7 +489,7 @@ def create_product( product: Optional[gcr_product.Product] = None, product_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Creates a [Product][google.cloud.retail.v2beta.Product]. @@ -632,7 +633,7 @@ def get_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> product.Product: r"""Gets a [Product][google.cloud.retail.v2beta.Product]. @@ -746,7 +747,7 @@ def list_products( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListProductsPager: r"""Gets a list of [Product][google.cloud.retail.v2beta.Product]s. @@ -871,7 +872,7 @@ def update_product( product: Optional[gcr_product.Product] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_product.Product: r"""Updates a [Product][google.cloud.retail.v2beta.Product]. @@ -1009,7 +1010,7 @@ def delete_product( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a [Product][google.cloud.retail.v2beta.Product]. @@ -1123,7 +1124,7 @@ def import_products( request: Optional[Union[import_config.ImportProductsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of multiple @@ -1235,7 +1236,7 @@ def set_inventory( inventory: Optional[product.Product] = None, set_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates inventory information for a @@ -1495,7 +1496,7 @@ def add_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally adds place IDs to @@ -1650,7 +1651,7 @@ def remove_fulfillment_places( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Incrementally removes place IDs from a @@ -1807,7 +1808,7 @@ def add_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates local inventory information for a @@ -1971,7 +1972,7 @@ def remove_local_inventories( *, product: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Remove local inventory information for a @@ -2139,14 +2140,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ProductServiceClient",) diff --git a/google/cloud/retail_v2beta/services/product_service/transports/base.py b/google/cloud/retail_v2beta/services/product_service/transports/base.py index a8288d1d..12107433 100644 --- a/google/cloud/retail_v2beta/services/product_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/product_service/transports/base.py @@ -25,21 +25,16 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import import_config from google.cloud.retail_v2beta.types import product from google.cloud.retail_v2beta.types import product as gcr_product from google.cloud.retail_v2beta.types import product_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ProductServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/search_service/async_client.py b/google/cloud/retail_v2beta/services/search_service/async_client.py index 590037a9..ced9ea86 100644 --- a/google/cloud/retail_v2beta/services/search_service/async_client.py +++ b/google/cloud/retail_v2beta/services/search_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchAsyncPager: r"""Performs a search. @@ -327,14 +328,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/search_service/client.py b/google/cloud/retail_v2beta/services/search_service/client.py index d2e1a1c3..b0566a48 100644 --- a/google/cloud/retail_v2beta/services/search_service/client.py +++ b/google/cloud/retail_v2beta/services/search_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def search( request: Optional[Union[search_service.SearchRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchPager: r"""Performs a search. @@ -586,14 +587,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SearchServiceClient",) diff --git a/google/cloud/retail_v2beta/services/search_service/transports/base.py b/google/cloud/retail_v2beta/services/search_service/transports/base.py index 2d036a35..a1ab48e1 100644 --- a/google/cloud/retail_v2beta/services/search_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/search_service/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import search_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SearchServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/serving_config_service/async_client.py b/google/cloud/retail_v2beta/services/serving_config_service/async_client.py index 25b3fb74..6a58b161 100644 --- a/google/cloud/retail_v2beta/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2beta/services/serving_config_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -372,7 +373,7 @@ async def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -468,7 +469,7 @@ async def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -594,7 +595,7 @@ async def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -702,7 +703,7 @@ async def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsAsyncPager: r"""Lists all ServingConfigs linked to this catalog. @@ -817,7 +818,7 @@ async def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -932,7 +933,7 @@ async def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1042,14 +1043,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/serving_config_service/client.py b/google/cloud/retail_v2beta/services/serving_config_service/client.py index 5c73197a..a00b1d9b 100644 --- a/google/cloud/retail_v2beta/services/serving_config_service/client.py +++ b/google/cloud/retail_v2beta/services/serving_config_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -479,7 +480,7 @@ def create_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, serving_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Creates a ServingConfig. @@ -618,7 +619,7 @@ def delete_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a ServingConfig. @@ -714,7 +715,7 @@ def update_serving_config( serving_config: Optional[gcr_serving_config.ServingConfig] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Updates a ServingConfig. @@ -840,7 +841,7 @@ def get_serving_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> serving_config.ServingConfig: r"""Gets a ServingConfig. @@ -948,7 +949,7 @@ def list_serving_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServingConfigsPager: r"""Lists all ServingConfigs linked to this catalog. @@ -1063,7 +1064,7 @@ def add_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Enables a Control on the specified ServingConfig. The control is @@ -1178,7 +1179,7 @@ def remove_control( *, serving_config: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_serving_config.ServingConfig: r"""Disables a Control on the specified ServingConfig. The control @@ -1295,14 +1296,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ServingConfigServiceClient",) diff --git a/google/cloud/retail_v2beta/services/serving_config_service/transports/base.py b/google/cloud/retail_v2beta/services/serving_config_service/transports/base.py index 09444e97..1b984712 100644 --- a/google/cloud/retail_v2beta/services/serving_config_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/serving_config_service/transports/base.py @@ -24,20 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import serving_config as gcr_serving_config from google.cloud.retail_v2beta.types import serving_config from google.cloud.retail_v2beta.types import serving_config_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ServingConfigServiceTransport(abc.ABC): diff --git a/google/cloud/retail_v2beta/services/user_event_service/async_client.py b/google/cloud/retail_v2beta/services/user_event_service/async_client.py index 931547e5..2d552744 100644 --- a/google/cloud/retail_v2beta/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2beta/services/user_event_service/async_client.py @@ -34,7 +34,8 @@ 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 + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -233,7 +234,7 @@ async def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -322,7 +323,7 @@ async def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -452,7 +453,7 @@ async def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes permanently all user events specified by the @@ -487,7 +488,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -562,7 +563,7 @@ async def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Bulk import of User events. Request processing might be @@ -603,7 +604,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -682,7 +683,7 @@ async def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Starts a user-event rejoin operation with latest @@ -722,7 +723,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -789,14 +790,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceAsyncClient",) diff --git a/google/cloud/retail_v2beta/services/user_event_service/client.py b/google/cloud/retail_v2beta/services/user_event_service/client.py index da5941dd..caed577e 100644 --- a/google/cloud/retail_v2beta/services/user_event_service/client.py +++ b/google/cloud/retail_v2beta/services/user_event_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.retail_v2beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -484,7 +485,7 @@ def write_user_event( request: Optional[Union[user_event_service.WriteUserEventRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> user_event.UserEvent: r"""Writes a single user event. @@ -574,7 +575,7 @@ def collect_user_event( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> httpbody_pb2.HttpBody: r"""Writes a single user event from the browser. This @@ -705,7 +706,7 @@ def purge_user_events( request: Optional[Union[purge_config.PurgeUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes permanently all user events specified by the @@ -806,7 +807,7 @@ def import_user_events( request: Optional[Union[import_config.ImportUserEventsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Bulk import of User events. Request processing might be @@ -917,7 +918,7 @@ def rejoin_user_events( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Starts a user-event rejoin operation with latest @@ -1032,14 +1033,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("UserEventServiceClient",) diff --git a/google/cloud/retail_v2beta/services/user_event_service/transports/base.py b/google/cloud/retail_v2beta/services/user_event_service/transports/base.py index db384719..3e9c1836 100644 --- a/google/cloud/retail_v2beta/services/user_event_service/transports/base.py +++ b/google/cloud/retail_v2beta/services/user_event_service/transports/base.py @@ -25,8 +25,8 @@ 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.retail_v2beta import gapic_version as package_version from google.cloud.retail_v2beta.types import ( import_config, purge_config, @@ -34,14 +34,9 @@ user_event_service, ) -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-retail", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class UserEventServiceTransport(abc.ABC): diff --git a/release-please-config.json b/release-please-config.json index 04a9a94d..cdc1377a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,7 +4,10 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/retail_v2alpha/gapic_version.py", "google/cloud/retail/gapic_version.py", + "google/cloud/retail_v2beta/gapic_version.py", + "google/cloud/retail_v2/gapic_version.py", { "type": "json", "path": "samples/generated_samples/snippet_metadata_google.cloud.retail.v2.json", diff --git a/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py b/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py index 39a43d8e..faa65395 100644 --- a/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py +++ b/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py @@ -53,7 +53,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py b/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py index 925c9b25..89561f0a 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py b/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py index 2b8b9728..b7bf8015 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py @@ -48,7 +48,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py b/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py index 317fbcf3..edb0eb23 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py @@ -52,7 +52,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py b/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py index 62f5a625..8c0a4ec4 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py b/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py index 6acb0672..9fec1e27 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py @@ -49,7 +49,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py b/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py index d2ac1d92..a71fe245 100644 --- a/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py +++ b/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py @@ -51,7 +51,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py b/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py index 987d56dc..ef49a067 100644 --- a/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py +++ b/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py @@ -53,7 +53,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py b/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py index 26bf9500..ee7efe73 100644 --- a/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py +++ b/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py @@ -49,7 +49,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py b/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py index cd61b3ba..8d249b76 100644 --- a/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py +++ b/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py @@ -48,7 +48,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py b/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py index 60a32eb5..c0bd59f2 100644 --- a/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py @@ -53,7 +53,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py b/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py index b8325673..4f7b99e9 100644 --- a/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py @@ -57,7 +57,7 @@ async def sample_create_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py b/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py index d7b69121..5e4a4380 100644 --- a/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py @@ -48,7 +48,7 @@ async def sample_tune_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py index c65bb915..6d431c19 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py index 543c8b4f..4795e19a 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py @@ -48,7 +48,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py index bcf2b4ed..ac3a07ec 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py @@ -52,7 +52,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py index a0c0b17b..93c0689f 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py @@ -49,7 +49,7 @@ async def sample_purge_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py index fd985104..c77d6849 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py index 83da8c0f..a22a1cc7 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py @@ -49,7 +49,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py b/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py index b2aae28b..0b089cdb 100644 --- a/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py @@ -51,7 +51,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py b/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py index c085142a..55338df2 100644 --- a/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py @@ -53,7 +53,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py b/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py index 8139bada..cc14298c 100644 --- a/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py @@ -49,7 +49,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py b/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py index 6e825d8c..94fcefe3 100644 --- a/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py +++ b/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py @@ -48,7 +48,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py b/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py index e72a08e2..5e36f8a4 100644 --- a/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py +++ b/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py @@ -53,7 +53,7 @@ async def sample_import_completion_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py b/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py index 93b875a6..d633195b 100644 --- a/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py +++ b/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py @@ -54,7 +54,7 @@ async def sample_create_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py b/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py index b84413a5..9a9a8251 100644 --- a/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py +++ b/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py @@ -48,7 +48,7 @@ async def sample_tune_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py index e9910300..0a4e61a0 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_add_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py index a6cd767a..0226fd12 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py @@ -48,7 +48,7 @@ async def sample_add_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py index bb0b3993..7ca4496a 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py @@ -52,7 +52,7 @@ async def sample_import_products(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py index d3e7b20e..f95d0717 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py @@ -50,7 +50,7 @@ async def sample_remove_fulfillment_places(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py index 8f1063df..2e057d88 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py @@ -49,7 +49,7 @@ async def sample_remove_local_inventories(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py b/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py index 3d815123..9c119ccc 100644 --- a/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py +++ b/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py @@ -51,7 +51,7 @@ async def sample_set_inventory(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py b/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py index 6d7cd232..8a430e53 100644 --- a/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py +++ b/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py @@ -53,7 +53,7 @@ async def sample_import_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py b/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py index e1999c6e..1b7666b2 100644 --- a/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py +++ b/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py @@ -49,7 +49,7 @@ async def sample_purge_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py b/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py index 6b6e8e79..0d7def73 100644 --- a/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py +++ b/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py @@ -48,7 +48,7 @@ async def sample_rejoin_user_events(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/setup.py b/setup.py index db1f4b51..2a6bba85 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 6f3158cc..6c44adfe 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5