Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
chore: upgrade gapic-generator-python to 0.46.3 (#146)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 373649163

Source-Link: googleapis/googleapis@7e1b14e

Source-Link: googleapis/googleapis-gen@0a3c7d2
  • Loading branch information
gcf-owl-bot[bot] committed May 14, 2021
1 parent c26105c commit 5a3e788
Show file tree
Hide file tree
Showing 117 changed files with 5,587 additions and 5,240 deletions.
1 change: 0 additions & 1 deletion docs/vision_v1/product_search.rst
Expand Up @@ -5,7 +5,6 @@ ProductSearch
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1.services.product_search.pagers
:members:
:inherited-members:
1 change: 0 additions & 1 deletion docs/vision_v1p3beta1/product_search.rst
Expand Up @@ -5,7 +5,6 @@ ProductSearch
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1p3beta1.services.product_search.pagers
:members:
:inherited-members:
1 change: 0 additions & 1 deletion docs/vision_v1p4beta1/product_search.rst
Expand Up @@ -5,7 +5,6 @@ ProductSearch
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1p4beta1.services.product_search.pagers
:members:
:inherited-members:
10 changes: 7 additions & 3 deletions google/cloud/vision_v1/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -19,7 +18,10 @@
from google.cloud.vision_helpers import VisionHelpers

from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient
from .services.image_annotator import ImageAnnotatorAsyncClient
from .services.product_search import ProductSearchClient
from .services.product_search import ProductSearchAsyncClient

from .types.geometry import BoundingPoly
from .types.geometry import NormalizedVertex
from .types.geometry import Position
Expand Down Expand Up @@ -55,7 +57,6 @@
from .types.image_annotator import ImageSource
from .types.image_annotator import InputConfig
from .types.image_annotator import LatLongRect
from .types.image_annotator import Likelihood
from .types.image_annotator import LocalizedObjectAnnotation
from .types.image_annotator import LocationInfo
from .types.image_annotator import OperationMetadata
Expand All @@ -64,6 +65,7 @@
from .types.image_annotator import SafeSearchAnnotation
from .types.image_annotator import TextDetectionParams
from .types.image_annotator import WebDetectionParams
from .types.image_annotator import Likelihood
from .types.product_search import ProductSearchParams
from .types.product_search import ProductSearchResults
from .types.product_search_service import AddProductToProductSetRequest
Expand Down Expand Up @@ -113,6 +115,8 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):


__all__ = (
"ImageAnnotatorAsyncClient",
"ProductSearchAsyncClient",
"AddProductToProductSetRequest",
"AnnotateFileRequest",
"AnnotateFileResponse",
Expand Down Expand Up @@ -152,6 +156,7 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"GetReferenceImageRequest",
"Image",
"ImageAnnotationContext",
"ImageAnnotatorClient",
"ImageContext",
"ImageProperties",
"ImageSource",
Expand Down Expand Up @@ -198,5 +203,4 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"WebDetection",
"WebDetectionParams",
"Word",
"ImageAnnotatorClient",
)
1 change: 0 additions & 1 deletion google/cloud/vision_v1/services/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/vision_v1/services/image_annotator/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .client import ImageAnnotatorClient
from .async_client import ImageAnnotatorAsyncClient

Expand Down
45 changes: 16 additions & 29 deletions google/cloud/vision_v1/services/image_annotator/async_client.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,24 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.vision_v1.types import image_annotator

from .transports.base import ImageAnnotatorTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import ImageAnnotatorGrpcAsyncIOTransport
from .client import ImageAnnotatorClient
Expand All @@ -53,39 +50,35 @@ class ImageAnnotatorAsyncClient:
parse_product_path = staticmethod(ImageAnnotatorClient.parse_product_path)
product_set_path = staticmethod(ImageAnnotatorClient.product_set_path)
parse_product_set_path = staticmethod(ImageAnnotatorClient.parse_product_set_path)

common_billing_account_path = staticmethod(
ImageAnnotatorClient.common_billing_account_path
)
parse_common_billing_account_path = staticmethod(
ImageAnnotatorClient.parse_common_billing_account_path
)

common_folder_path = staticmethod(ImageAnnotatorClient.common_folder_path)
parse_common_folder_path = staticmethod(
ImageAnnotatorClient.parse_common_folder_path
)

common_organization_path = staticmethod(
ImageAnnotatorClient.common_organization_path
)
parse_common_organization_path = staticmethod(
ImageAnnotatorClient.parse_common_organization_path
)

common_project_path = staticmethod(ImageAnnotatorClient.common_project_path)
parse_common_project_path = staticmethod(
ImageAnnotatorClient.parse_common_project_path
)

common_location_path = staticmethod(ImageAnnotatorClient.common_location_path)
parse_common_location_path = staticmethod(
ImageAnnotatorClient.parse_common_location_path
)

@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
Expand All @@ -100,7 +93,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
file.
Args:
filename (str): The path to the service account private key json
Expand All @@ -117,7 +110,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):

@property
def transport(self) -> ImageAnnotatorTransport:
"""Return the transport used by the client instance.
"""Returns the transport used by the client instance.
Returns:
ImageAnnotatorTransport: The transport used by the client instance.
Expand All @@ -131,12 +124,12 @@ def transport(self) -> ImageAnnotatorTransport:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
credentials: ga_credentials.Credentials = None,
transport: Union[str, ImageAnnotatorTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the image annotator client.
"""Instantiates the image annotator client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
Expand Down Expand Up @@ -168,7 +161,6 @@ def __init__(
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
"""

self._client = ImageAnnotatorClient(
credentials=credentials,
transport=transport,
Expand Down Expand Up @@ -199,7 +191,6 @@ async def batch_annotate_images(
This corresponds to the ``requests`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -226,7 +217,6 @@ async def batch_annotate_images(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if requests:
request.requests.extend(requests)

Expand All @@ -239,7 +229,8 @@ async def batch_annotate_images(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -284,7 +275,6 @@ async def batch_annotate_files(
This corresponds to the ``requests`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -309,7 +299,6 @@ async def batch_annotate_files(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if requests:
request.requests.extend(requests)

Expand All @@ -322,7 +311,8 @@ async def batch_annotate_files(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -377,7 +367,6 @@ async def async_batch_annotate_images(
This corresponds to the ``output_config`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down Expand Up @@ -407,10 +396,8 @@ async def async_batch_annotate_images(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if output_config is not None:
request.output_config = output_config

if requests:
request.requests.extend(requests)

Expand All @@ -423,7 +410,8 @@ async def async_batch_annotate_images(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -473,7 +461,6 @@ async def async_batch_annotate_files(
This corresponds to the ``requests`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down Expand Up @@ -503,7 +490,6 @@ async def async_batch_annotate_files(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if requests:
request.requests.extend(requests)

Expand All @@ -516,7 +502,8 @@ async def async_batch_annotate_files(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down

0 comments on commit 5a3e788

Please sign in to comment.