From ad2a2d7806593d5f1f19a62562dbf110504b4097 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Dec 2022 15:19:13 -0500 Subject: [PATCH] fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#457) 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 Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .coveragerc | 5 -- google/cloud/automl_v1/gapic_version.py | 16 ++++ .../services/auto_ml/async_client.py | 68 ++++++++-------- .../automl_v1/services/auto_ml/client.py | 50 ++++++------ .../services/auto_ml/transports/base.py | 14 ++-- .../prediction_service/async_client.py | 20 ++--- .../services/prediction_service/client.py | 18 ++--- .../prediction_service/transports/base.py | 14 ++-- google/cloud/automl_v1beta1/gapic_version.py | 16 ++++ .../services/auto_ml/async_client.py | 80 +++++++++---------- .../automl_v1beta1/services/auto_ml/client.py | 62 +++++++------- .../services/auto_ml/transports/base.py | 14 ++-- .../prediction_service/async_client.py | 20 ++--- .../services/prediction_service/client.py | 18 ++--- .../prediction_service/transports/base.py | 14 ++-- release-please-config.json | 2 + ..._generated_auto_ml_create_dataset_async.py | 2 +- ...v1_generated_auto_ml_create_model_async.py | 2 +- ..._generated_auto_ml_delete_dataset_async.py | 2 +- ...v1_generated_auto_ml_delete_model_async.py | 2 +- ...v1_generated_auto_ml_deploy_model_async.py | 2 +- ..._v1_generated_auto_ml_export_data_async.py | 2 +- ...v1_generated_auto_ml_export_model_async.py | 2 +- ..._v1_generated_auto_ml_import_data_async.py | 2 +- ..._generated_auto_ml_undeploy_model_async.py | 2 +- ..._prediction_service_batch_predict_async.py | 2 +- ...a1_generated_auto_ml_create_model_async.py | 2 +- ..._generated_auto_ml_delete_dataset_async.py | 2 +- ...a1_generated_auto_ml_delete_model_async.py | 2 +- ...a1_generated_auto_ml_deploy_model_async.py | 2 +- ...ta1_generated_auto_ml_export_data_async.py | 2 +- ...auto_ml_export_evaluated_examples_async.py | 2 +- ...a1_generated_auto_ml_export_model_async.py | 2 +- ...ta1_generated_auto_ml_import_data_async.py | 2 +- ..._generated_auto_ml_undeploy_model_async.py | 2 +- ..._prediction_service_batch_predict_async.py | 2 +- 36 files changed, 226 insertions(+), 245 deletions(-) create mode 100644 google/cloud/automl_v1/gapic_version.py create mode 100644 google/cloud/automl_v1beta1/gapic_version.py diff --git a/.coveragerc b/.coveragerc index 633bb6d4..c58aa373 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/automl_v1/gapic_version.py b/google/cloud/automl_v1/gapic_version.py new file mode 100644 index 00000000..bb984214 --- /dev/null +++ b/google/cloud/automl_v1/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__ = "2.8.3" # {x-release-please-version} diff --git a/google/cloud/automl_v1/services/auto_ml/async_client.py b/google/cloud/automl_v1/services/auto_ml/async_client.py index dcd6711e..90127b16 100644 --- a/google/cloud/automl_v1/services/auto_ml/async_client.py +++ b/google/cloud/automl_v1/services/auto_ml/async_client.py @@ -27,7 +27,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -250,7 +251,7 @@ async def create_dataset( parent: Optional[str] = None, dataset: Optional[gca_dataset.Dataset] = 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 dataset. @@ -285,7 +286,7 @@ async def sample_create_dataset(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -378,7 +379,7 @@ async def get_dataset( *, 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]] = (), ) -> dataset.Dataset: r"""Gets a dataset. @@ -492,7 +493,7 @@ async def list_datasets( *, 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.ListDatasetsAsyncPager: r"""Lists datasets in a project. @@ -618,7 +619,7 @@ async def update_dataset( dataset: Optional[gca_dataset.Dataset] = 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]] = (), ) -> gca_dataset.Dataset: r"""Updates a dataset. @@ -737,7 +738,7 @@ async def delete_dataset( *, 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"""Deletes a dataset and all of its contents. Returns empty @@ -771,7 +772,7 @@ async def sample_delete_dataset(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -876,7 +877,7 @@ async def import_data( name: Optional[str] = None, input_config: Optional[io.InputConfig] = 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"""Imports data into a dataset. For Tables this method can only be @@ -919,7 +920,7 @@ async def sample_import_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1025,7 +1026,7 @@ async def export_data( name: Optional[str] = None, output_config: Optional[io.OutputConfig] = 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"""Exports dataset's data to the provided output location. Returns @@ -1062,7 +1063,7 @@ async def sample_export_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1165,7 +1166,7 @@ async def get_annotation_spec( *, 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]] = (), ) -> annotation_spec.AnnotationSpec: r"""Gets an annotation spec. @@ -1276,7 +1277,7 @@ async def create_model( parent: Optional[str] = None, model: Optional[gca_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 model. Returns a Model in the @@ -1310,7 +1311,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) @@ -1405,7 +1406,7 @@ async def get_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"""Gets a model. @@ -1515,7 +1516,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 models. @@ -1640,7 +1641,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]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a model. Returns ``google.protobuf.Empty`` in the @@ -1673,7 +1674,7 @@ async def sample_delete_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1778,7 +1779,7 @@ async def update_model( model: Optional[gca_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]] = (), ) -> gca_model.Model: r"""Updates a model. @@ -1890,7 +1891,7 @@ async def deploy_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"""Deploys a model. If a model is already deployed, deploying it @@ -1933,7 +1934,7 @@ async def sample_deploy_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2027,7 +2028,7 @@ async def undeploy_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"""Undeploys a model. If the model is not deployed this method has @@ -2065,7 +2066,7 @@ async def sample_undeploy_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2160,7 +2161,7 @@ async def export_model( name: Optional[str] = None, output_config: Optional[io.ModelExportOutputConfig] = 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"""Exports a trained, "export-able", model to a user specified @@ -2201,7 +2202,7 @@ async def sample_export_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2306,7 +2307,7 @@ async def get_model_evaluation( *, 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_evaluation.ModelEvaluation: r"""Gets a model evaluation. @@ -2417,7 +2418,7 @@ async def list_model_evaluations( parent: Optional[str] = None, filter: 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.ListModelEvaluationsAsyncPager: r"""Lists model evaluations. @@ -2567,14 +2568,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-automl", - ).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__ = ("AutoMlAsyncClient",) diff --git a/google/cloud/automl_v1/services/auto_ml/client.py b/google/cloud/automl_v1/services/auto_ml/client.py index e98cd1e4..142c41e1 100644 --- a/google/cloud/automl_v1/services/auto_ml/client.py +++ b/google/cloud/automl_v1/services/auto_ml/client.py @@ -28,7 +28,8 @@ Union, cast, ) -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -549,7 +550,7 @@ def create_dataset( parent: Optional[str] = None, dataset: Optional[gca_dataset.Dataset] = 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 dataset. @@ -677,7 +678,7 @@ def get_dataset( *, 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]] = (), ) -> dataset.Dataset: r"""Gets a dataset. @@ -781,7 +782,7 @@ def list_datasets( *, 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.ListDatasetsPager: r"""Lists datasets in a project. @@ -897,7 +898,7 @@ def update_dataset( dataset: Optional[gca_dataset.Dataset] = 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]] = (), ) -> gca_dataset.Dataset: r"""Updates a dataset. @@ -1016,7 +1017,7 @@ def delete_dataset( *, 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"""Deletes a dataset and all of its contents. Returns empty @@ -1145,7 +1146,7 @@ def import_data( name: Optional[str] = None, input_config: Optional[io.InputConfig] = 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"""Imports data into a dataset. For Tables this method can only be @@ -1294,7 +1295,7 @@ def export_data( name: Optional[str] = None, output_config: Optional[io.OutputConfig] = 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"""Exports dataset's data to the provided output location. Returns @@ -1434,7 +1435,7 @@ def get_annotation_spec( *, 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]] = (), ) -> annotation_spec.AnnotationSpec: r"""Gets an annotation spec. @@ -1535,7 +1536,7 @@ def create_model( parent: Optional[str] = None, model: Optional[gca_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 model. Returns a Model in the @@ -1664,7 +1665,7 @@ def get_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"""Gets a model. @@ -1764,7 +1765,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 models. @@ -1879,7 +1880,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]] = (), ) -> operation.Operation: r"""Deletes a model. Returns ``google.protobuf.Empty`` in the @@ -2007,7 +2008,7 @@ def update_model( model: Optional[gca_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]] = (), ) -> gca_model.Model: r"""Updates a model. @@ -2119,7 +2120,7 @@ def deploy_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"""Deploys a model. If a model is already deployed, deploying it @@ -2256,7 +2257,7 @@ def undeploy_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"""Undeploys a model. If the model is not deployed this method has @@ -2389,7 +2390,7 @@ def export_model( name: Optional[str] = None, output_config: Optional[io.ModelExportOutputConfig] = 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"""Exports a trained, "export-able", model to a user specified @@ -2535,7 +2536,7 @@ def get_model_evaluation( *, 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_evaluation.ModelEvaluation: r"""Gets a model evaluation. @@ -2636,7 +2637,7 @@ def list_model_evaluations( parent: Optional[str] = None, filter: 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.ListModelEvaluationsPager: r"""Lists model evaluations. @@ -2783,14 +2784,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-automl", - ).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__ = ("AutoMlClient",) diff --git a/google/cloud/automl_v1/services/auto_ml/transports/base.py b/google/cloud/automl_v1/services/auto_ml/transports/base.py index 7631a7b8..f2033128 100644 --- a/google/cloud/automl_v1/services/auto_ml/transports/base.py +++ b/google/cloud/automl_v1/services/auto_ml/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -35,14 +36,9 @@ from google.cloud.automl_v1.types import service from google.longrunning import operations_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-automl", - ).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 AutoMlTransport(abc.ABC): diff --git a/google/cloud/automl_v1/services/prediction_service/async_client.py b/google/cloud/automl_v1/services/prediction_service/async_client.py index 2bb9bac6..32c75edf 100644 --- a/google/cloud/automl_v1/services/prediction_service/async_client.py +++ b/google/cloud/automl_v1/services/prediction_service/async_client.py @@ -27,7 +27,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -229,7 +230,7 @@ async def predict( payload: Optional[data_items.ExamplePayload] = None, params: Optional[MutableMapping[str, 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]] = (), ) -> prediction_service.PredictResponse: r"""Perform an online prediction. The prediction result is directly @@ -422,7 +423,7 @@ async def batch_predict( output_config: Optional[io.BatchPredictOutputConfig] = None, params: Optional[MutableMapping[str, 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"""Perform a batch prediction. Unlike the online @@ -479,7 +480,7 @@ async def sample_batch_predict(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -679,14 +680,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-automl", - ).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/automl_v1/services/prediction_service/client.py b/google/cloud/automl_v1/services/prediction_service/client.py index 8cfbc3dc..ee1817ba 100644 --- a/google/cloud/automl_v1/services/prediction_service/client.py +++ b/google/cloud/automl_v1/services/prediction_service/client.py @@ -28,7 +28,8 @@ Union, cast, ) -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -456,7 +457,7 @@ def predict( payload: Optional[data_items.ExamplePayload] = None, params: Optional[MutableMapping[str, 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]] = (), ) -> prediction_service.PredictResponse: r"""Perform an online prediction. The prediction result is directly @@ -648,7 +649,7 @@ def batch_predict( output_config: Optional[io.BatchPredictOutputConfig] = None, params: Optional[MutableMapping[str, 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"""Perform a batch prediction. Unlike the online @@ -911,14 +912,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-automl", - ).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/automl_v1/services/prediction_service/transports/base.py b/google/cloud/automl_v1/services/prediction_service/transports/base.py index cc9ba2fa..95645225 100644 --- a/google/cloud/automl_v1/services/prediction_service/transports/base.py +++ b/google/cloud/automl_v1/services/prediction_service/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.automl_v1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.automl_v1.types import prediction_service from google.longrunning import operations_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-automl", - ).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/automl_v1beta1/gapic_version.py b/google/cloud/automl_v1beta1/gapic_version.py new file mode 100644 index 00000000..bb984214 --- /dev/null +++ b/google/cloud/automl_v1beta1/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__ = "2.8.3" # {x-release-please-version} diff --git a/google/cloud/automl_v1beta1/services/auto_ml/async_client.py b/google/cloud/automl_v1beta1/services/auto_ml/async_client.py index ac55aed0..290736cc 100644 --- a/google/cloud/automl_v1beta1/services/auto_ml/async_client.py +++ b/google/cloud/automl_v1beta1/services/auto_ml/async_client.py @@ -27,7 +27,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -262,7 +263,7 @@ async def create_dataset( parent: Optional[str] = None, dataset: Optional[gca_dataset.Dataset] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_dataset.Dataset: r"""Creates a dataset. @@ -378,7 +379,7 @@ async def get_dataset( *, 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]] = (), ) -> dataset.Dataset: r"""Gets a dataset. @@ -492,7 +493,7 @@ async def list_datasets( *, 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.ListDatasetsAsyncPager: r"""Lists datasets in a project. @@ -617,7 +618,7 @@ async def update_dataset( *, dataset: Optional[gca_dataset.Dataset] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_dataset.Dataset: r"""Updates a dataset. @@ -727,7 +728,7 @@ async def delete_dataset( *, 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"""Deletes a dataset and all of its contents. Returns empty @@ -761,7 +762,7 @@ async def sample_delete_dataset(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -866,7 +867,7 @@ async def import_data( name: Optional[str] = None, input_config: Optional[io.InputConfig] = 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"""Imports data into a dataset. For Tables this method can only be @@ -905,7 +906,7 @@ async def sample_import_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1011,7 +1012,7 @@ async def export_data( name: Optional[str] = None, output_config: Optional[io.OutputConfig] = 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"""Exports dataset's data to the provided output location. Returns @@ -1044,7 +1045,7 @@ async def sample_export_data(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1147,7 +1148,7 @@ async def get_annotation_spec( *, 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]] = (), ) -> annotation_spec.AnnotationSpec: r"""Gets an annotation spec. @@ -1257,7 +1258,7 @@ async def get_table_spec( *, 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]] = (), ) -> table_spec.TableSpec: r"""Gets a table spec. @@ -1377,7 +1378,7 @@ async def list_table_specs( *, 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.ListTableSpecsAsyncPager: r"""Lists table specs in a dataset. @@ -1502,7 +1503,7 @@ async def update_table_spec( *, table_spec: Optional[gca_table_spec.TableSpec] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_table_spec.TableSpec: r"""Updates a table spec. @@ -1613,7 +1614,7 @@ async def get_column_spec( *, 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]] = (), ) -> column_spec.ColumnSpec: r"""Gets a column spec. @@ -1725,7 +1726,7 @@ async def list_column_specs( *, 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.ListColumnSpecsAsyncPager: r"""Lists column specs in a table spec. @@ -1850,7 +1851,7 @@ async def update_column_spec( *, column_spec: Optional[gca_column_spec.ColumnSpec] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_column_spec.ColumnSpec: r"""Updates a column spec. @@ -1954,7 +1955,7 @@ async def create_model( parent: Optional[str] = None, model: Optional[gca_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 model. Returns a Model in the @@ -1988,7 +1989,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) @@ -2083,7 +2084,7 @@ async def get_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"""Gets a model. @@ -2193,7 +2194,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 models. @@ -2318,7 +2319,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]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a model. Returns ``google.protobuf.Empty`` in the @@ -2351,7 +2352,7 @@ async def sample_delete_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2455,7 +2456,7 @@ async def deploy_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"""Deploys a model. If a model is already deployed, deploying it @@ -2499,7 +2500,7 @@ async def sample_deploy_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2593,7 +2594,7 @@ async def undeploy_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"""Undeploys a model. If the model is not deployed this method has @@ -2631,7 +2632,7 @@ async def sample_undeploy_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2726,7 +2727,7 @@ async def export_model( name: Optional[str] = None, output_config: Optional[io.ModelExportOutputConfig] = 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"""Exports a trained, "export-able", model to a user specified @@ -2764,7 +2765,7 @@ async def sample_export_model(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2870,7 +2871,7 @@ async def export_evaluated_examples( name: Optional[str] = None, output_config: Optional[io.ExportEvaluatedExamplesOutputConfig] = 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"""Exports examples on which the model was evaluated (i.e. which @@ -2914,7 +2915,7 @@ async def sample_export_evaluated_examples(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -3018,7 +3019,7 @@ async def get_model_evaluation( *, 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_evaluation.ModelEvaluation: r"""Gets a model evaluation. @@ -3128,7 +3129,7 @@ async def list_model_evaluations( *, 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.ListModelEvaluationsAsyncPager: r"""Lists model evaluations. @@ -3247,14 +3248,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-automl", - ).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__ = ("AutoMlAsyncClient",) diff --git a/google/cloud/automl_v1beta1/services/auto_ml/client.py b/google/cloud/automl_v1beta1/services/auto_ml/client.py index fe6614b4..38e81ed2 100644 --- a/google/cloud/automl_v1beta1/services/auto_ml/client.py +++ b/google/cloud/automl_v1beta1/services/auto_ml/client.py @@ -28,7 +28,8 @@ Union, cast, ) -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -607,7 +608,7 @@ def create_dataset( parent: Optional[str] = None, dataset: Optional[gca_dataset.Dataset] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_dataset.Dataset: r"""Creates a dataset. @@ -723,7 +724,7 @@ def get_dataset( *, 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]] = (), ) -> dataset.Dataset: r"""Gets a dataset. @@ -827,7 +828,7 @@ def list_datasets( *, 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.ListDatasetsPager: r"""Lists datasets in a project. @@ -942,7 +943,7 @@ def update_dataset( *, dataset: Optional[gca_dataset.Dataset] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_dataset.Dataset: r"""Updates a dataset. @@ -1052,7 +1053,7 @@ def delete_dataset( *, 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"""Deletes a dataset and all of its contents. Returns empty @@ -1181,7 +1182,7 @@ def import_data( name: Optional[str] = None, input_config: Optional[io.InputConfig] = 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"""Imports data into a dataset. For Tables this method can only be @@ -1326,7 +1327,7 @@ def export_data( name: Optional[str] = None, output_config: Optional[io.OutputConfig] = 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"""Exports dataset's data to the provided output location. Returns @@ -1462,7 +1463,7 @@ def get_annotation_spec( *, 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]] = (), ) -> annotation_spec.AnnotationSpec: r"""Gets an annotation spec. @@ -1562,7 +1563,7 @@ def get_table_spec( *, 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]] = (), ) -> table_spec.TableSpec: r"""Gets a table spec. @@ -1672,7 +1673,7 @@ def list_table_specs( *, 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.ListTableSpecsPager: r"""Lists table specs in a dataset. @@ -1787,7 +1788,7 @@ def update_table_spec( *, table_spec: Optional[gca_table_spec.TableSpec] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_table_spec.TableSpec: r"""Updates a table spec. @@ -1898,7 +1899,7 @@ def get_column_spec( *, 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]] = (), ) -> column_spec.ColumnSpec: r"""Gets a column spec. @@ -2000,7 +2001,7 @@ def list_column_specs( *, 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.ListColumnSpecsPager: r"""Lists column specs in a table spec. @@ -2115,7 +2116,7 @@ def update_column_spec( *, column_spec: Optional[gca_column_spec.ColumnSpec] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gca_column_spec.ColumnSpec: r"""Updates a column spec. @@ -2219,7 +2220,7 @@ def create_model( parent: Optional[str] = None, model: Optional[gca_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 model. Returns a Model in the @@ -2348,7 +2349,7 @@ def get_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"""Gets a model. @@ -2448,7 +2449,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 models. @@ -2563,7 +2564,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]] = (), ) -> operation.Operation: r"""Deletes a model. Returns ``google.protobuf.Empty`` in the @@ -2690,7 +2691,7 @@ def deploy_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"""Deploys a model. If a model is already deployed, deploying it @@ -2828,7 +2829,7 @@ def undeploy_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"""Undeploys a model. If the model is not deployed this method has @@ -2961,7 +2962,7 @@ def export_model( name: Optional[str] = None, output_config: Optional[io.ModelExportOutputConfig] = 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"""Exports a trained, "export-able", model to a user specified @@ -3105,7 +3106,7 @@ def export_evaluated_examples( name: Optional[str] = None, output_config: Optional[io.ExportEvaluatedExamplesOutputConfig] = 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"""Exports examples on which the model was evaluated (i.e. which @@ -3255,7 +3256,7 @@ def get_model_evaluation( *, 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_evaluation.ModelEvaluation: r"""Gets a model evaluation. @@ -3355,7 +3356,7 @@ def list_model_evaluations( *, 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.ListModelEvaluationsPager: r"""Lists model evaluations. @@ -3481,14 +3482,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-automl", - ).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__ = ("AutoMlClient",) diff --git a/google/cloud/automl_v1beta1/services/auto_ml/transports/base.py b/google/cloud/automl_v1beta1/services/auto_ml/transports/base.py index d0762936..d7dda939 100644 --- a/google/cloud/automl_v1beta1/services/auto_ml/transports/base.py +++ b/google/cloud/automl_v1beta1/services/auto_ml/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -38,14 +39,9 @@ from google.cloud.automl_v1beta1.types import table_spec as gca_table_spec from google.longrunning import operations_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-automl", - ).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 AutoMlTransport(abc.ABC): diff --git a/google/cloud/automl_v1beta1/services/prediction_service/async_client.py b/google/cloud/automl_v1beta1/services/prediction_service/async_client.py index 1019f36b..698cf838 100644 --- a/google/cloud/automl_v1beta1/services/prediction_service/async_client.py +++ b/google/cloud/automl_v1beta1/services/prediction_service/async_client.py @@ -27,7 +27,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -229,7 +230,7 @@ async def predict( payload: Optional[data_items.ExamplePayload] = None, params: Optional[MutableMapping[str, 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]] = (), ) -> prediction_service.PredictResponse: r"""Perform an online prediction. The prediction result will be @@ -399,7 +400,7 @@ async def batch_predict( output_config: Optional[io.BatchPredictOutputConfig] = None, params: Optional[MutableMapping[str, 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"""Perform a batch prediction. Unlike the online @@ -445,7 +446,7 @@ async def sample_batch_predict(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -644,14 +645,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-automl", - ).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/automl_v1beta1/services/prediction_service/client.py b/google/cloud/automl_v1beta1/services/prediction_service/client.py index 9e3acca3..c55fbd88 100644 --- a/google/cloud/automl_v1beta1/services/prediction_service/client.py +++ b/google/cloud/automl_v1beta1/services/prediction_service/client.py @@ -28,7 +28,8 @@ Union, cast, ) -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -456,7 +457,7 @@ def predict( payload: Optional[data_items.ExamplePayload] = None, params: Optional[MutableMapping[str, 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]] = (), ) -> prediction_service.PredictResponse: r"""Perform an online prediction. The prediction result will be @@ -625,7 +626,7 @@ def batch_predict( output_config: Optional[io.BatchPredictOutputConfig] = None, params: Optional[MutableMapping[str, 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"""Perform a batch prediction. Unlike the online @@ -876,14 +877,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-automl", - ).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/automl_v1beta1/services/prediction_service/transports/base.py b/google/cloud/automl_v1beta1/services/prediction_service/transports/base.py index 54dfcd2d..764aa02d 100644 --- a/google/cloud/automl_v1beta1/services/prediction_service/transports/base.py +++ b/google/cloud/automl_v1beta1/services/prediction_service/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.automl_v1beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.automl_v1beta1.types import prediction_service from google.longrunning import operations_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-automl", - ).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/release-please-config.json b/release-please-config.json index d3cb8868..7669cf3e 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -5,6 +5,8 @@ "release-type": "python", "extra-files": [ "google/cloud/automl/gapic_version.py", + "google/cloud/automl_v1beta1/gapic_version.py", + "google/cloud/automl_v1/gapic_version.py", { "type": "json", "path": "samples/generated_samples/snippet_metadata_google.cloud.automl.v1.json", diff --git a/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py index 7a171e54..7fa024bc 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py @@ -53,7 +53,7 @@ async def sample_create_dataset(): 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/automl_v1_generated_auto_ml_create_model_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py index 8650fd91..911f5c88 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py @@ -48,7 +48,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/automl_v1_generated_auto_ml_delete_dataset_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py index 934aa6df..f5e47523 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py @@ -48,7 +48,7 @@ async def sample_delete_dataset(): 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/automl_v1_generated_auto_ml_delete_model_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py index 798b5bcd..6654d6c2 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py @@ -48,7 +48,7 @@ async def sample_delete_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/automl_v1_generated_auto_ml_deploy_model_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py index f6f819c5..04b4193b 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py @@ -48,7 +48,7 @@ async def sample_deploy_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/automl_v1_generated_auto_ml_export_data_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py index 3d4329bb..589a4209 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py @@ -52,7 +52,7 @@ async def sample_export_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/automl_v1_generated_auto_ml_export_model_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py index 94153169..fb97405c 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py @@ -52,7 +52,7 @@ async def sample_export_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/automl_v1_generated_auto_ml_import_data_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py index eaf86b12..c19087c5 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py @@ -52,7 +52,7 @@ async def sample_import_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/automl_v1_generated_auto_ml_undeploy_model_async.py b/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py index 83752604..f8bbe7df 100644 --- a/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py +++ b/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py @@ -48,7 +48,7 @@ async def sample_undeploy_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/automl_v1_generated_prediction_service_batch_predict_async.py b/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py index 9463fa4e..85a57630 100644 --- a/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py +++ b/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py @@ -56,7 +56,7 @@ async def sample_batch_predict(): 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/automl_v1beta1_generated_auto_ml_create_model_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py index 9a5423bb..152cecd9 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py @@ -48,7 +48,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/automl_v1beta1_generated_auto_ml_delete_dataset_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py index 88e575cf..b0bd8e54 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py @@ -48,7 +48,7 @@ async def sample_delete_dataset(): 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/automl_v1beta1_generated_auto_ml_delete_model_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py index 0dd590e8..3d013c44 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py @@ -48,7 +48,7 @@ async def sample_delete_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/automl_v1beta1_generated_auto_ml_deploy_model_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py index ed2ac2a5..abb20fb8 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py @@ -48,7 +48,7 @@ async def sample_deploy_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/automl_v1beta1_generated_auto_ml_export_data_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py index dffa5468..a07566f0 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py @@ -48,7 +48,7 @@ async def sample_export_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/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py index e6a01e5f..ff0835fc 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py @@ -48,7 +48,7 @@ async def sample_export_evaluated_examples(): 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/automl_v1beta1_generated_auto_ml_export_model_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py index 07dc772e..0d3209e3 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py @@ -48,7 +48,7 @@ async def sample_export_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/automl_v1beta1_generated_auto_ml_import_data_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py index 8f6e7377..8bc3d4bd 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py @@ -48,7 +48,7 @@ async def sample_import_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/automl_v1beta1_generated_auto_ml_undeploy_model_async.py b/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py index 90ce1a93..ae30f58c 100644 --- a/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py @@ -48,7 +48,7 @@ async def sample_undeploy_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/automl_v1beta1_generated_prediction_service_batch_predict_async.py b/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py index 8e17c31b..ddd21ffd 100644 --- a/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py +++ b/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py @@ -48,7 +48,7 @@ async def sample_batch_predict(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response)